/* Cloud Dive — shared floating header + footer */

.cd-header {
  --nav-home:#7357ff;
  --nav-projects:#1389ff;
  --nav-about:#74d79a;
  --nav-search:#73deed;
  --nav-menu:#ff82ba;
  position:sticky;
  top:10px;
  z-index:var(--z-header);
  width:calc(100% - 28px);
  max-width:1480px;
  min-height:64px;
  margin:10px auto 0;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:24px;
  pointer-events:none;
}
.cd-header::before { display:none !important; }
.cd-brand,
.cd-nav,
.cd-mobile-menu { pointer-events:auto; }
.cd-brand {
  position:relative; display:grid; align-content:center; justify-items:start; min-height:58px;
  padding:2px 4px 4px 2px; color:var(--ink); isolation:isolate;
  transform:rotate(-2.2deg) translateY(-1px); transition:transform .18s var(--ease);
}
.cd-brand::before { display:none; }
.cd-brand-word {
  position:relative; display:inline-flex; align-items:baseline; padding:6px 10px 6px 2px;
  font-family:ui-rounded,"Arial Rounded MT Bold","Segoe UI",Arial,sans-serif;
  font-size:clamp(1.58rem,2.35vw,2.4rem); font-weight:950; line-height:.9; letter-spacing:-.08em;
  transform-style:preserve-3d; transform:perspective(920px) rotateX(18deg) rotateY(-14deg);
  filter:drop-shadow(0 8px 0 rgba(17,17,17,.14)) drop-shadow(0 14px 14px rgba(17,17,17,.18));
}
.cd-brand-word::before { content:""; position:absolute; left:0; right:6px; bottom:6px; height:12px; border-radius:999px; background:radial-gradient(ellipse at center,rgba(17,17,17,.22) 0%,rgba(17,17,17,0) 72%); transform:translateY(12px); z-index:-1; pointer-events:none; }
.cd-brand-cloudtext,.cd-brand-divetext { position:relative; display:inline-block; transform:translateZ(18px); -webkit-text-stroke:1.25px #111; paint-order:stroke fill; text-shadow:0 1px 0 #111,0 2px 0 #111,0 3px 0 #111,0 4px 0 rgba(17,17,17,.96),0 5px 0 rgba(17,17,17,.88),0 9px 12px rgba(17,17,17,.18); }
.cd-brand-cloudtext { color:var(--yellow); }
.cd-brand-divetext { color:var(--brand); }
.cd-nav {
  position:relative;
  min-height:58px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:7px 9px 7px 12px;
  margin-left:auto;
  background:color-mix(in srgb,var(--surface-raised) 93%,transparent);
  border:2px solid var(--border);
  border-radius:15px;
  box-shadow:5px 5px 0 var(--shadow-color);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}
.cd-nav-links { display:flex; align-items:center; gap:3px; }
.cd-nav-links a {
  --tab-accent:var(--nav-home);
  position:relative;
  min-height:40px;
  display:inline-flex;
  align-items:center;
  padding:0 11px;
  color:var(--ink);
  border:1.5px solid transparent;
  border-radius:9px;
  font-size:.78rem;
  font-weight:850;
  transition:transform .16s var(--ease),background-color .16s ease,border-color .16s ease,box-shadow .16s var(--ease);
}
.cd-nav-links a[data-nav="home"] { --tab-accent:var(--nav-home); }
.cd-nav-links a[data-nav="projects"] { --tab-accent:var(--nav-projects); }
.cd-nav-links a[data-nav="about"] { --tab-accent:var(--nav-about); }
.cd-nav-links a::after {
  content:"";
  position:absolute;
  left:10px;
  right:10px;
  bottom:-7px;
  height:3px;
  border-radius:999px;
  background:var(--tab-accent);
  opacity:0;
  transform:scaleX(0);
  transform-origin:center;
  transition:opacity .12s ease,transform .2s var(--ease);
}
.cd-nav-links a:not(.is-active):focus-visible { transform:translateY(-1px); }
.cd-nav-links a:not(.is-active):focus-visible::after { opacity:1; transform:scaleX(1); }
.cd-nav-links a.is-active { background:var(--tab-accent); border-color:#111; box-shadow:2px 2px 0 #111; color:#111; }
.cd-nav-links a[data-nav="home"].is-active,
.cd-nav-links a[data-nav="projects"].is-active { color:#111; }
.cd-nav-actions { display:flex; align-items:center; gap:7px; flex:0 0 auto; }
.cd-search-shell { position:relative; min-width:42px; display:flex; justify-content:flex-end; }
.cd-search {
  width:42px; height:42px; display:flex; align-items:center; justify-content:flex-end; overflow:hidden;
  background:var(--surface-soft); border:2px solid var(--border); border-radius:999px; box-shadow:3px 3px 0 var(--shadow-color);
  transition:width .28s var(--ease),background-color .16s ease,box-shadow .16s var(--ease),transform .16s var(--ease);
}
.cd-search.is-open { width:min(360px,38vw); background:color-mix(in srgb,var(--nav-search) 15%,var(--surface-raised)); border-color:#111; transform:none; }
.cd-search-input { order:1; width:0; min-width:0; flex:1 1 auto; padding:0; opacity:0; border:0; outline:0; background:transparent; color:var(--text); font-size:.76rem; font-weight:720; transition:width .2s var(--ease),opacity .14s ease,padding .2s var(--ease); }
.cd-search-input::placeholder { color:var(--muted); opacity:.84; }
.cd-search.is-open .cd-search-input { width:100%; padding:0 4px 0 13px; opacity:1; }
.cd-search.is-open:focus-within { outline:3px solid var(--focus); outline-offset:3px; }
.cd-search-trigger { order:3; width:38px; min-width:38px; height:38px; display:grid; place-items:center; padding:0; border:0; background:transparent; color:var(--ink); }
.cd-search.is-open .cd-search-trigger { color:var(--ink); }
.cd-search-icon { position:relative; width:15px; height:15px; border:2px solid currentColor; border-radius:50%; }
.cd-search-icon::after { content:""; position:absolute; width:6px; height:2px; right:-5px; bottom:-2px; background:currentColor; border-radius:2px; transform:rotate(45deg); }
.cd-search-results { position:absolute; z-index:var(--z-search-results); top:calc(100% + 11px); right:0; width:min(510px,calc(100vw - 42px)); max-height:min(430px,64dvh); overflow:auto; padding:7px; background:var(--surface-raised); color:var(--text); border:2px solid var(--border); border-radius:14px; box-shadow:7px 7px 0 var(--shadow-color); overscroll-behavior:contain; }
.cd-search-results[hidden] { display:none; }
.cd-search-head { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:34px; padding:2px 6px 7px; color:var(--muted); border-bottom:1px solid var(--border-soft); font:800 .75rem/1 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; letter-spacing:.06em; text-transform:uppercase; }
.cd-search-result { display:grid; grid-template-columns:10px minmax(0,1fr) auto; gap:10px; align-items:center; padding:11px 9px; border-radius:9px; transition:background-color .12s ease,transform .12s var(--ease); }
.cd-search-result + .cd-search-result { border-top:1px solid color-mix(in srgb,var(--border-soft) 75%,transparent); }
.cd-search-result.is-active { background:color-mix(in srgb,var(--brand) 11%,var(--surface-raised)); transform:translateX(2px); }
.cd-search-dot { width:8px; height:8px; border:1.5px solid #111; border-radius:50%; background:var(--concept); }
.cd-search-result[data-provider="azure"] .cd-search-dot { background:var(--azure); }
.cd-search-result[data-provider="aws"] .cd-search-dot { background:var(--aws); }
.cd-search-copy { min-width:0; display:grid; gap:3px; }
.cd-search-copy strong { overflow:hidden; color:var(--ink); font-size:.76rem; line-height:1.3; text-overflow:ellipsis; white-space:nowrap; }
.cd-search-copy small { overflow:hidden; color:var(--muted); font:700 .75rem/1.35 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; text-overflow:ellipsis; white-space:nowrap; }
.cd-search-provider { padding:5px 7px; color:#111; background:var(--concept); border:1.5px solid #111; border-radius:999px; font:900 .75rem/1 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; text-transform:uppercase; }
.cd-search-result[data-provider="azure"] .cd-search-provider { background:var(--azure); }
.cd-search-result[data-provider="aws"] .cd-search-provider { background:var(--aws); }
.cd-search-empty { padding:18px 14px; color:var(--muted); font-size:.74rem; line-height:1.5; text-align:center; }
.cd-search-empty strong { display:block; margin-bottom:4px; color:var(--ink); }
.cd-theme { position:relative; width:42px; height:42px; flex:0 0 42px; display:grid; place-items:center; padding:0; overflow:hidden; background:var(--yellow); color:#111; border:2px solid #111; border-radius:50%; box-shadow:3px 3px 0 #111; transition:transform .16s var(--ease),box-shadow .16s var(--ease),background-color .2s ease; }
.cd-theme-face { position:relative; width:28px; height:28px; transition:transform .42s var(--ease); }
.cd-theme-icon { position:absolute; inset:2px; width:24px; height:24px; display:grid; place-items:center; opacity:0; color:#111; transform:scale(.72) rotate(-90deg); transition:opacity .16s ease,transform .36s var(--ease); }
.cd-theme-icon::before { content:""; width:15px; height:15px; background:currentColor; mask:var(--theme-icon) center/contain no-repeat; -webkit-mask:var(--theme-icon) center/contain no-repeat; }
.cd-theme-sun { --theme-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='3.5'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.42 1.42M17.65 17.65l1.42 1.42M2 12h2M20 12h2M4.93 19.07l1.42-1.42M17.65 6.35l1.42-1.42'/%3E%3C/g%3E%3C/svg%3E"); }
.cd-theme-moon { --theme-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 15.4A8 8 0 0 1 8.6 4a8.2 8.2 0 1 0 11.4 11.4Z' fill='black'/%3E%3C/svg%3E"); }
html[data-theme="light"] .cd-theme-sun { opacity:1; transform:scale(1) rotate(0); }
html[data-theme="dark"] .cd-theme { background:#7357ff; color:#fff; }
html[data-theme="dark"] .cd-theme-face { transform:rotate(180deg); }
html[data-theme="dark"] .cd-theme-moon { opacity:1; color:#fff; transform:scale(1) rotate(-180deg); }
.cd-menu-btn { display:none; width:42px; height:42px; padding:0; place-items:center; background:color-mix(in srgb,var(--nav-menu) 28%,var(--surface-raised)); color:#111; border:2px solid #111; border-radius:10px; box-shadow:3px 3px 0 #111; font-weight:950; }
.cd-mobile-menu { position:absolute; top:calc(100% + 8px); right:0; width:min(360px,calc(100vw - 16px)); z-index:var(--z-mobile-menu); padding:8px; background:var(--surface-raised); border:2px solid var(--border); border-radius:13px; box-shadow:6px 6px 0 var(--shadow-color); }
.cd-mobile-menu[hidden],.cd-menu-backdrop[hidden] { display:none; }
.cd-mobile-menu a { --tab-accent:var(--nav-home); display:flex; align-items:center; justify-content:space-between; min-height:46px; padding:0 12px; border:1.5px solid transparent; border-radius:9px; color:var(--ink); font-weight:850; }
.cd-mobile-menu a[data-nav="home"] { --tab-accent:var(--nav-home); }
.cd-mobile-menu a[data-nav="projects"] { --tab-accent:var(--nav-projects); }
.cd-mobile-menu a[data-nav="about"] { --tab-accent:var(--nav-about); }
.cd-mobile-menu a.is-active { background:var(--tab-accent); color:#111; border-color:#111; box-shadow:2px 2px 0 #111; }
.cd-mobile-theme{width:100%;min-height:46px;display:flex;align-items:center;justify-content:space-between;margin-top:5px;padding:0 12px;background:color-mix(in srgb,var(--yellow) 42%,var(--surface-raised));color:var(--ink);border:1.5px solid var(--border);border-radius:9px;font-weight:850;text-align:left}.cd-mobile-theme::after{content:"◐";font-size:1rem}.cd-mobile-theme:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.cd-menu-backdrop { position:fixed; inset:0; z-index:var(--z-menu-backdrop); background:rgba(6,7,10,.58); backdrop-filter:blur(4px); }

@media (max-width:1040px) {
  .cd-header { width:calc(100% - 20px); gap:14px; }
  .cd-nav { gap:8px; padding-left:9px; }
  .cd-nav-links a { padding-inline:8px; font-size:.74rem; }
  .cd-search.is-open { width:min(300px,34vw); }
}
@media (max-width:767px) {
  .cd-header { top:max(6px,env(safe-area-inset-top)); width:calc(100% - 12px); min-height:56px; margin-top:6px; gap:8px; }
  .cd-brand { min-height:50px; padding-inline:1px; transform:rotate(-2.2deg) translateY(-1px); }
  .cd-brand::before { display:none; }
  .cd-brand-word { padding:5px 9px 2px 4px; font-size:clamp(1.35rem,8vw,1.9rem); transform:perspective(820px) rotateX(14deg) rotateY(-10deg); }
  .cd-brand-tag { display:none; }
  .cd-nav { min-height:50px; gap:6px; padding:5px 6px; border-radius:12px; box-shadow:3px 3px 0 var(--shadow-color); }
  .cd-nav-links { display:none; }
  .cd-nav-actions { gap:5px; }
  .cd-search-shell { position:static; min-width:44px; }
  .cd-search { width:44px; height:44px; box-shadow:2px 2px 0 var(--shadow-color); }
  .cd-search-trigger { width:44px; min-width:44px; height:44px; }
  .cd-theme,.cd-menu-btn { width:44px; height:44px; flex-basis:44px; box-shadow:2px 2px 0 #111; }
  .cd-menu-btn { display:grid; }
  .cd-header.search-open .cd-nav { position:absolute; top:0; right:0; width:min(520px,calc(100% - 78px)); min-height:106px; padding-bottom:51px; }
  .cd-search.is-open { position:absolute; z-index:var(--z-search-mobile); left:7px; right:7px; bottom:6px; width:auto; max-width:none; height:44px; border-radius:10px; box-shadow:2px 2px 0 var(--shadow-color); }
  .cd-search.is-open .cd-search-input { padding-left:11px; font-size:16px; }
  .cd-search-results { position:fixed; z-index:var(--z-search-results); top:calc(max(6px,env(safe-area-inset-top)) + 104px); left:8px; right:8px; width:auto; max-height:min(54dvh,430px); }
  .cd-mobile-menu { top:calc(100% + 6px); right:0; }
}
@media (max-width:410px) {
  .cd-brand-word { font-size:1.12rem; letter-spacing:-.09em; }
  .cd-theme { display:none; }
}
@media (prefers-reduced-motion:reduce) { .cd-search,.cd-theme,.cd-theme-face,.cd-theme-icon,.cd-nav-links a,.cd-brand { transition:none !important; } }

@media (hover:hover) and (pointer:fine) {
  .cd-brand:hover { transform:translate(-2px,-2px) rotate(-1.8deg); }
  .cd-nav-links a:not(.is-active):hover { transform:translateY(-1px); }
  .cd-nav-links a:not(.is-active):hover::after { opacity:1; transform:scaleX(1); }
  .cd-search:hover { transform:translate(-1px,-1px); box-shadow:4px 4px 0 var(--shadow-color); }
  .cd-search-result:hover { background:color-mix(in srgb,var(--brand) 11%,var(--surface-raised)); transform:translateX(2px); }
  .cd-theme:hover { transform:translate(-1px,-1px) rotate(5deg); box-shadow:4px 4px 0 #111; }
  .cd-menu-btn:hover { background:var(--nav-menu); }
  .cd-footer-links a:hover { background:#2a2c35; color:#fff; }
}

.cd-footer { position:relative; isolation:isolate; overflow:hidden; margin-top:0; background:#17181e; color:#fff; border-top:5px solid var(--yellow); }
.cd-footer-inner { position:relative; min-height:0; height:auto; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; column-gap:clamp(30px,5vw,76px); padding-top:clamp(26px,3vw,40px); padding-bottom:clamp(20px,2.25vw,30px); }
.cd-footer-manifesto { position:relative; z-index:3; display:block; width:max-content; max-width:100%; margin:0; color:#fff; font-size:clamp(2.35rem,4vw,4.35rem); font-weight:900; line-height:.9; letter-spacing:-.062em; text-wrap:nowrap; }
.cd-footer-line { display:block; width:max-content; max-width:100%; white-space:nowrap; }
.cd-footer-line-two { margin-top:.08em; }
.cd-footer-manifesto .architecture { color:var(--cyan); }
.cd-footer-manifesto .neutral { color:#f5f5fb; }
.cd-footer-manifesto .decisions { color:var(--yellow); }
.cd-footer-meta { position:relative; z-index:3; min-width:220px; display:grid; justify-items:end; gap:14px; padding:0; }
.cd-footer-links { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.cd-footer-links a { min-height:36px; display:inline-flex; align-items:center; padding:7px 9px; color:#d9dae0; border-radius:6px; font:850 .75rem/1 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; text-transform:uppercase; }
.cd-footer-copy { color:#8f929d; font:700 .7rem/1.35 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; }
.cd-footer-ghost { position:absolute; z-index:0; left:50%; top:50%; width:max-content; transform:translate(-50%,-46%); color:#fff; font-family:ui-rounded,"Arial Rounded MT Bold","Segoe UI",Arial,sans-serif; font-size:clamp(7rem,18vw,16rem); font-weight:900; letter-spacing:-.085em; line-height:.72; opacity:.027; white-space:nowrap; pointer-events:none; user-select:none; }

.toast { position:fixed; left:50%; bottom:24px; z-index:var(--z-toast); max-width:calc(100% - 32px); transform:translate(-50%,18px); padding:10px 13px; background:#111; color:#fff; border:2px solid #fff; border-radius:8px; box-shadow:4px 4px 0 rgba(0,0,0,.35); font:800 .65rem/1.3 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; opacity:0; pointer-events:none; transition:opacity .18s ease,transform .18s var(--ease); }
.toast.show { opacity:1; transform:translate(-50%,0); }

@media (max-width:819px) {
  .cd-footer-inner { grid-template-columns:1fr; grid-template-rows:auto auto; row-gap:clamp(18px,4vw,24px); align-items:start; padding-top:clamp(24px,5vw,32px); padding-bottom:clamp(18px,4vw,24px); }
  .cd-footer-manifesto { font-size:clamp(2rem,7vw,3.25rem); }
  .cd-footer-meta { width:100%; min-width:0; display:flex; justify-content:space-between; align-items:center; gap:14px; }
  .cd-footer-copy { text-align:right; }
  .cd-footer-ghost { font-size:clamp(5rem,18vw,8rem); opacity:.022; }
}
@media (max-width:599px) {
  .cd-footer-inner { row-gap:17px; padding-top:22px; padding-bottom:16px; }
  .cd-footer-manifesto { width:max-content; max-width:100%; font-size:clamp(1.35rem,6.4vw,2.35rem); line-height:.91; letter-spacing:-.055em; }
  .cd-footer-meta { flex-direction:column; align-items:flex-start; gap:8px; }
  .cd-footer-copy { text-align:left; }
  .cd-footer-links a { min-height:44px; padding-inline:10px; font-size:.74rem; }
  .cd-footer-ghost { max-width:calc(100vw - 28px); font-size:clamp(3.2rem,16vw,4rem); opacity:.021; }
}
@media (max-width:390px) {
  .cd-footer-manifesto { font-size:clamp(1.18rem,6.15vw,1.55rem); }
  .cd-footer-links { gap:4px; }
}
