/* ============================================================================
   alavisadr.com — shared design system for the studio pages
   Cosmic dark, gold accent, Cormorant Garamond display. Consumed by
   about / work / vision / journal / contact. Tokens first, then chrome,
   then components, then per-page layouts.
   ========================================================================= */

:root {
  --ink: #04060a;
  --ink-2: #070a12;
  --ivory: #f3efe4;
  --gold: #d3a95c;
  --gold-hi: #f0d9a8;
  --mist: #96a0ad;
  --line: rgba(243, 239, 228, 0.14);
  --line-2: rgba(243, 239, 228, 0.08);
  --card: rgba(12, 16, 24, 0.5);
  --r-card: 16px;
  --t-fast: 180ms;
  --t-base: 420ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

::selection { background: rgba(211, 169, 92, 0.35); color: var(--ivory); }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--ivory);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

body.fine, body.fine a, body.fine button { cursor: none; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Fixed cosmic backdrop (canvas painted by engine.js) ─────────────── */
#gl, #dust {
  position: fixed; inset: 0; width: 100%; height: 100%;
}
#gl { z-index: -3; opacity: 0; transition: opacity 2.4s ease; }
#gl.on { opacity: 1; }
#dust { z-index: -2; pointer-events: none; }

.no-gl body::before, body.no-gl::before {
  content: ""; position: fixed; inset: -25%; z-index: -3;
  background:
    radial-gradient(42% 42% at 26% 28%, rgba(14, 94, 84, 0.42), transparent 70%),
    radial-gradient(40% 40% at 74% 70%, rgba(58, 42, 94, 0.42), transparent 70%),
    radial-gradient(30% 30% at 60% 22%, rgba(211, 169, 92, 0.12), transparent 70%);
  filter: blur(70px);
  animation: swirl 26s ease-in-out infinite alternate;
}
@keyframes swirl { from { transform: rotate(0) scale(1); } to { transform: rotate(9deg) scale(1.12); } }

.vignette {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 30%, transparent 55%, rgba(2, 3, 6, 0.62) 100%);
}
.grain {
  position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cursor-glow {
  position: fixed; z-index: -1; width: 340px; height: 340px; margin: -170px 0 0 -170px;
  left: 50%; top: 50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(211, 169, 92, 0.1), transparent 65%);
}
.cursor-ring, .cursor-dot {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  border-radius: 50%; opacity: 0; transition: opacity 0.35s ease;
}
.cursor-ring { width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1.5px solid rgba(243, 239, 228, 0.5); }
.cursor-dot { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: var(--gold-hi); }
body.fine .cursor-ring, body.fine .cursor-dot { opacity: 1; }
.cursor-ring.hot { border-color: var(--gold); transform: scale(1.6); }

/* ── Top bar + full-screen menu ──────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 40px);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--mist); transition: color var(--t-fast) ease;
}
.brand b { color: var(--gold); font-weight: 600; }
.brand:hover { color: var(--ivory); }

.menu-btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: none; border: none; color: var(--mist);
  font-family: inherit; font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.28em; text-transform: uppercase;
  transition: color var(--t-fast) ease;
}
.menu-btn:hover { color: var(--gold-hi); }
.menu-btn .bars { display: inline-flex; flex-direction: column; gap: 4px; width: 22px; }
.menu-btn .bars i { height: 1.5px; background: currentColor; transition: transform var(--t-base) var(--ease), opacity var(--t-base) ease; }
.menu-btn .bars i:nth-child(1) { width: 22px; }
.menu-btn .bars i:nth-child(2) { width: 14px; align-self: flex-end; }
body.menu-open .menu-btn .bars i:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
body.menu-open .menu-btn .bars i:nth-child(2) { width: 22px; transform: translateY(-4px) rotate(-45deg); }

.overlay {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(3, 5, 9, 0.72);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; opacity: 0; visibility: hidden;
  transition: opacity var(--t-base) ease, visibility var(--t-base) ease;
}
body.menu-open .overlay { opacity: 1; visibility: visible; }
.overlay nav { display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.4vh, 14px); }
.overlay a {
  font-family: "Cormorant Garamond", ui-serif, Georgia, serif;
  font-weight: 300; font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.1;
  letter-spacing: 0.01em; color: var(--ivory);
  position: relative; opacity: 0; transform: translateY(18px);
  transition: color var(--t-fast) ease;
}
body.menu-open .overlay a { opacity: 1; transform: none; transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease), color var(--t-fast) ease; }
.overlay a:nth-child(1) { transition-delay: 0.06s; }
.overlay a:nth-child(2) { transition-delay: 0.12s; }
.overlay a:nth-child(3) { transition-delay: 0.18s; }
.overlay a:nth-child(4) { transition-delay: 0.24s; }
.overlay a:nth-child(5) { transition-delay: 0.30s; }
.overlay a:nth-child(6) { transition-delay: 0.36s; }
.overlay a:hover, .overlay a.current { color: var(--gold-hi); }
.overlay a.current::after {
  content: "✦"; font-size: 0.4em; color: var(--gold);
  position: absolute; top: 50%; right: -1.2em; transform: translateY(-50%);
}
.overlay .menu-foot {
  margin-top: clamp(20px, 5vh, 48px); display: flex; gap: 22px;
  font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--mist);
}
.overlay .menu-foot a { font-family: inherit; font-size: inherit; opacity: 1; transform: none; }
.overlay .menu-foot a:hover { color: var(--gold); }

/* ── Sound toggle (shared) ───────────────────────────────────────────── */
.sound {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: rgba(4, 6, 10, 0.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--mist); transition: color var(--t-fast) ease, border-color var(--t-fast) ease;
}
.sound:hover { color: var(--gold-hi); border-color: var(--gold); }
.sound:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sound svg { width: 18px; height: 18px; }
.sound .on-icon { display: none; }
.sound[aria-pressed="true"] { color: var(--gold-hi); border-color: var(--gold); }
.sound[aria-pressed="true"] .on-icon { display: block; }
.sound[aria-pressed="true"] .off-icon { display: none; }

/* ── Page shell ──────────────────────────────────────────────────────── */
.page {
  position: relative; z-index: 1;
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(96px, 16vh, 168px) clamp(22px, 5vw, 56px) 40px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before { content: ""; width: 30px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }

.display {
  font-family: "Cormorant Garamond", ui-serif, Georgia, serif;
  font-weight: 300; letter-spacing: -0.01em; line-height: 1.06;
  font-size: clamp(2.6rem, 8vw, 5.4rem); text-wrap: balance; margin: 18px 0 0;
}
.display em { font-style: italic; background: linear-gradient(100deg, var(--gold), var(--gold-hi)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.lede {
  font-family: "Cormorant Garamond", ui-serif, Georgia, serif;
  font-weight: 300; font-size: clamp(1.2rem, 2.4vw, 1.7rem); line-height: 1.5;
  color: #d9d5c9; max-width: 40ch; margin-top: 22px;
}
.body-copy { max-width: 62ch; line-height: 1.75; color: #cfd3d9; font-size: 1.02rem; }
.body-copy p + p { margin-top: 1.1em; }
.body-copy .drop { color: var(--gold-hi); }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* buttons / links */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: inherit; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 14px 26px; border-radius: 999px; border: 1px solid var(--gold);
  color: var(--gold-hi); background: rgba(211, 169, 92, 0.06);
  transition: background var(--t-fast) ease, transform var(--t-fast) ease, box-shadow var(--t-base) ease;
}
.btn:hover { background: rgba(211, 169, 92, 0.16); box-shadow: 0 0 30px rgba(211, 169, 92, 0.2); }
.btn:active { transform: translateY(1px); }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; color: var(--gold-hi); font-weight: 600; letter-spacing: 0.04em; }
.link-arrow .a { transition: transform var(--t-fast) ease; }
.link-arrow:hover .a { transform: translateX(5px); }

/* ── Components: cards / grid ────────────────────────────────────────── */
.grid { display: grid; gap: clamp(16px, 2.5vw, 26px); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

.card {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--card); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: clamp(22px, 3vw, 32px); overflow: hidden;
  transition: border-color var(--t-base) ease, transform var(--t-base) var(--ease), box-shadow var(--t-base) ease;
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(340px 200px at var(--mx, 50%) var(--my, 0%), rgba(211, 169, 92, 0.1), transparent 60%);
  opacity: 0; transition: opacity var(--t-base) ease;
}
.card:hover { border-color: rgba(211, 169, 92, 0.4); transform: translateY(-4px); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4); }
.card:hover::after { opacity: 1; }
.card .kicker { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold); }
.card h3 { font-family: "Cormorant Garamond", ui-serif, Georgia, serif; font-weight: 400; font-size: 1.7rem; margin: 12px 0 8px; }
.card p { color: #c4c9d1; line-height: 1.6; font-size: 0.96rem; }
.card .badge {
  position: absolute; top: 16px; right: 16px; font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-hi);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px;
}

/* ── Timeline (journal) ──────────────────────────────────────────────── */
.timeline { position: relative; margin-top: 40px; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(180deg, transparent, var(--line), var(--line), transparent); }
.entry { position: relative; padding: 0 0 clamp(34px, 6vh, 60px); }
.entry::before {
  content: ""; position: absolute; left: -32px; top: 7px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 4px rgba(211, 169, 92, 0.14), 0 0 18px rgba(211, 169, 92, 0.6);
}
.entry time { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }
.entry h3 { font-family: "Cormorant Garamond", ui-serif, Georgia, serif; font-weight: 400; font-size: 1.7rem; margin: 8px 0 8px; }
.entry p { color: #c8ccd3; line-height: 1.7; max-width: 60ch; }

/* ── Manifesto (vision) ──────────────────────────────────────────────── */
.tenets { margin-top: 30px; display: flex; flex-direction: column; gap: clamp(20px, 4vh, 44px); }
.tenet { display: grid; grid-template-columns: 60px 1fr; gap: 20px; align-items: start; }
.tenet .n { font-family: "Cormorant Garamond", serif; font-size: 2rem; color: var(--gold); line-height: 1; }
.tenet h3 { font-family: "Cormorant Garamond", serif; font-weight: 400; font-size: 1.7rem; margin-bottom: 6px; }
.tenet p { color: #cbd0d7; line-height: 1.65; max-width: 56ch; }
@media (max-width: 560px) { .tenet { grid-template-columns: 40px 1fr; gap: 14px; } .tenet .n { font-size: 1.5rem; } }

/* ── Contact form ────────────────────────────────────────────────────── */
.form { margin-top: 30px; display: flex; flex-direction: column; gap: 20px; max-width: 560px; }
.field { position: relative; }
.field label {
  display: block; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--mist); margin-bottom: 8px;
}
.field input, .field textarea {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--ivory);
  background: rgba(8, 11, 18, 0.6); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; outline: none; transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #6a7482; }
.field input:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(211, 169, 92, 0.14); }
.field.err input, .field.err textarea { border-color: #e0654f; box-shadow: 0 0 0 4px rgba(224, 101, 79, 0.14); }
.field .msg { margin-top: 6px; font-size: 0.78rem; color: #e0917f; min-height: 1em; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }
.form-note { font-size: 0.9rem; color: var(--mist); }
.channels { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 26px; }
.channels a { display: inline-flex; align-items: center; gap: 8px; color: #cbd0d7; letter-spacing: 0.02em; transition: color var(--t-fast) ease; }
.channels a:hover { color: var(--gold-hi); }
.sent {
  margin-top: 22px; padding: 16px 18px; border: 1px solid rgba(211, 169, 92, 0.4);
  border-radius: 12px; background: rgba(211, 169, 92, 0.06); color: var(--gold-hi);
  display: none;
}
.sent.show { display: block; animation: rise 0.7s var(--ease) both; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.foot {
  position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto;
  padding: 40px clamp(22px, 5vw, 56px) 40px; margin-top: clamp(40px, 10vh, 100px);
  border-top: 1px solid var(--line-2);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
}
.foot .cols { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a, .foot span { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mist); }
.foot a:hover { color: var(--gold); }

/* ── Hero row (about/work heros) ─────────────────────────────────────── */
.hero { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(24px, 5vw, 60px); align-items: center; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.orb {
  position: relative; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, rgba(211,169,92,0.5), rgba(14,94,84,0.25) 42%, rgba(4,6,10,0.1) 70%);
  box-shadow: inset 0 0 60px rgba(0,0,0,0.5), 0 0 80px rgba(211,169,92,0.14);
  animation: breathe 8s ease-in-out infinite alternate;
}
.orb::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 1px solid rgba(211,169,92,0.28); }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.04); } }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .orb, body.no-gl::before, .no-gl body::before { animation: none; }
  #gl { transition: none; }
  .cursor-ring, .cursor-dot { display: none; }
}
