:root {
  /* No "classic black" theme: stay bright, warm, and colorful by default. */
  --bg: #fff7f1;
  --surface: rgba(255, 255, 255, 0.72);
  --text: #171418;
  --muted: #504852;
  --line: rgba(23, 20, 24, 0.10);
  --accent: #d9b77a;
  --accent-2: #f3dec0;
  --pop: #79d3c5;
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.2, 1.2, 0.2, 1);
  --mx: 0.5;
  --my: 0.35;
  --scene-a: #ffe2d6;
  --scene-b: #e7f6ff;
  --scene-pop: #ff5da2;
}

/* Deep, colorful dark mode (not classic black). */
:root[data-theme="dark"] {
  --bg: #111425;
  --surface: rgba(255, 255, 255, 0.06);
  --text: #f4f1ff;
  --muted: rgba(244, 241, 255, 0.72);
  --line: rgba(244, 241, 255, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Vazirmatn", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at calc(var(--mx) * 100%) calc(var(--my) * 100%), color-mix(in srgb, var(--scene-pop) 26%, transparent), transparent 42%),
    radial-gradient(circle at 12% -8%, color-mix(in srgb, var(--scene-a) 85%, white), transparent 48%),
    radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--scene-b) 75%, white), transparent 54%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 400ms var(--ease), color 400ms var(--ease);
  animation: pageIn 900ms var(--ease) both;
}

/* Scene change "pulse" so it feels like motion even when colors shift subtly. */
html.scene-shift body { animation: scenePulse 420ms var(--ease); }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    radial-gradient(circle, #fff 0.7px, transparent 0.7px),
    radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--scene-pop) 12%, transparent), transparent 40%);
  background-size: 4px 4px, 100% 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 6vw;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg), transparent 22%);
}

nav { display: flex; gap: 1rem; align-items: center; }
a, button { color: var(--text); text-decoration: none; }
.brand { font-weight: 600; font-size: 1.15rem; letter-spacing: 0; }

a, .theme-toggle {
  opacity: 0.9;
  transition: opacity 250ms var(--ease), transform 250ms var(--ease);
}

a:hover, .theme-toggle:hover { opacity: 1; transform: translateY(-1px); }

.theme-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: color-mix(in srgb, var(--surface), transparent 30%);
}

.theme-icon {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 35% 35%, var(--accent-2), var(--accent));
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.0);
  transition: transform 380ms var(--ease-spring), box-shadow 380ms var(--ease);
}

main { width: min(1100px, 92vw); margin: 0 auto; }
section[id] { scroll-margin-top: 110px; }

.hero {
  min-height: 92vh;
  display: grid;
  align-content: center;
  gap: 1.2rem;
  position: relative;
}

.hero-bg { position: absolute; inset: -40px -20px -60px; pointer-events: none; }
.orb {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.9;
  transform: translate3d(0,0,0);
  will-change: transform;
}
.orb-a {
  right: -180px;
  top: 6%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 85%, white), transparent 62%);
  animation: floatA 9.5s var(--ease) infinite alternate;
  transform: translate3d(calc((var(--mx) - 0.5) * -26px), calc((var(--my) - 0.5) * -18px), 0);
}
.orb-b {
  left: -180px;
  bottom: -160px;
  background: radial-gradient(circle, color-mix(in srgb, var(--pop) 85%, white), transparent 60%);
  animation: floatB 11.5s var(--ease) infinite alternate;
  transform: translate3d(calc((var(--mx) - 0.5) * 28px), calc((var(--my) - 0.5) * 22px), 0);
}
.orb-c {
  left: 24%;
  top: 22%;
  width: 380px;
  height: 380px;
  opacity: 0.65;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 80%, white), transparent 62%);
  animation: floatC 8.5s var(--ease) infinite alternate;
  transform: translate3d(calc((var(--mx) - 0.5) * 14px), calc((var(--my) - 0.5) * -16px), 0);
}
.grain {
  position: absolute;
  inset: 0;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.65) 0.6px, transparent 0.6px),
    radial-gradient(circle, rgba(0,0,0,0.55) 0.7px, transparent 0.7px);
  background-size: 6px 6px, 8px 8px;
  filter: blur(0.3px);
  animation: grainMove 10s linear infinite;
}

.eyebrow { letter-spacing: 0; font-size: 0.85rem; color: var(--muted); }
h1 {
  font-family: "Cormorant Garamond", "Vazirmatn", "Manrope", system-ui, sans-serif;
  font-size: clamp(2.4rem, 5vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  max-width: 14ch;
  margin: 0;
}
.lead { max-width: 56ch; color: var(--muted); line-height: 1.75; }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.cta {
  width: fit-content;
  border: 1px solid var(--line);
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--accent) 32%, transparent),
    color-mix(in srgb, var(--pop) 14%, transparent)
  );
  transition: transform 260ms var(--ease), border-color 260ms var(--ease), background 260ms var(--ease);
}

.cta:hover { transform: translateY(-2px); border-color: var(--accent); }

.ghost {
  border: 1px solid var(--line);
  padding: 0.8rem 1.05rem;
  border-radius: 999px;
  background: transparent;
}

.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 3vw, 2rem);
  margin-bottom: 1.2rem;
  backdrop-filter: blur(8px);
}

.story { overflow: clip; }
.timeline {
  position: relative;
  display: grid;
  gap: 1rem;
  margin-top: 0.4rem;
  padding-inline-start: 1.1rem;
}
.timeline::before {
  content: "";
  position: absolute;
  inset-inline-start: 0.3rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--scene-a) 70%, transparent),
    color-mix(in srgb, var(--scene-b) 70%, transparent),
    color-mix(in srgb, var(--scene-pop) 70%, transparent)
  );
  border-radius: 999px;
  opacity: 0.8;
}

.scene { position: relative; }
.scene-dot {
  position: absolute;
  inset-inline-start: -0.95rem;
  top: 1.2rem;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, var(--scene-pop), var(--scene-b));
  border: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--scene-pop) 20%, transparent);
}

.scene-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem 1.1rem 1.2rem;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--bg1) 62%, var(--bg)),
    color-mix(in srgb, var(--bg2) 58%, var(--bg))
  );
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
}
.scene-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--scene-pop) 18%, transparent);
}

.scene-time { margin: 0; font-size: 0.78rem; color: color-mix(in srgb, var(--text) 45%, transparent); }
.scene-title { margin: 0.15rem 0 0; font-family: "Cormorant Garamond", serif; font-size: 1.6rem; }
.scene-logline { margin: 0.25rem 0 0; color: color-mix(in srgb, var(--text) 68%, transparent); }
.scene-body { margin: 0.65rem 0 0; color: color-mix(in srgb, var(--text) 80%, transparent); line-height: 1.85; }

.stack { display: grid; gap: 1rem; }
h2 { font-family: "Vazirmatn", "Manrope", system-ui, sans-serif; font-size: clamp(1.8rem, 3vw, 2.8rem); margin: 0; font-weight: 700; }

.about { display: grid; gap: 1rem; grid-template-columns: 220px 1fr; align-items: center; }
.portrait {
  aspect-ratio: 1;
  border-radius: 16px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent) 34%, transparent),
    color-mix(in srgb, var(--pop) 20%, transparent)
  );
  border: 1px solid var(--line);
}

.now { color: var(--muted); margin-top: 0.9rem; }

.kicker { letter-spacing: 0; font-size: 0.8rem; color: var(--muted); margin: 0; }
.highlights { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.76rem;
  background: color-mix(in srgb, var(--surface), transparent 10%);
}

.socials { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: color-mix(in srgb, var(--surface), transparent 10%);
  transition: transform 260ms var(--ease), border-color 260ms var(--ease);
}
.pill:hover { transform: translateY(-2px); border-color: var(--accent); }

.skill-grid { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.skill-card, .post-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: color-mix(in srgb, var(--surface), transparent 15%);
  transform: translateY(0);
  transition: transform 260ms var(--ease), border-color 260ms var(--ease);
}

.skill-card:hover, .post-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.post-card h3 { margin-top: 0.2rem; font-family: "Cormorant Garamond", serif; font-size: 1.5rem; }
.post-card p { color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.post-list { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.work-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.work-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.05rem;
  background: color-mix(in srgb, var(--surface), transparent 10%);
  transition: transform 260ms var(--ease), border-color 260ms var(--ease);
}
.work-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--pop) 55%, var(--accent)); }
.work-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; }
.work-top h3 { margin: 0; font-family: "Cormorant Garamond", serif; font-size: 1.35rem; letter-spacing: 0; }
.work-link { opacity: 0.9; }
.work-desc { margin: 0.35rem 0 0.8rem; color: var(--muted); line-height: 1.7; }

.contact-form {
  display: grid;
  gap: 0.9rem;
  max-width: 620px;
}

.contact-form label { display: grid; gap: 0.45rem; color: var(--muted); }
input, textarea, .contact-form button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0.8rem;
  font: inherit;
  transition: border-color 250ms var(--ease), background 250ms var(--ease);
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
.contact-form button {
  width: fit-content;
  cursor: pointer;
  background: linear-gradient(120deg, rgba(213, 187, 137, 0.24), transparent);
}

.fineprint { color: var(--muted); margin: 0; }

[data-reveal] {
  /* Visible by default; JS opts-in to hiding for reveal animations. */
  opacity: 1;
  transform: none;
  filter: none;
}

html.reveal [data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(8px);
  transition:
    opacity 700ms var(--ease),
    transform 700ms var(--ease),
    filter 700ms var(--ease);
  transition-delay: var(--d, 0ms);
}

html.reveal [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

@keyframes drift {
  from { transform: translateY(-10px); }
  to { transform: translateY(14px); }
}

@keyframes floatA {
  from { transform: translate3d(calc((var(--mx) - 0.5) * -26px), calc((var(--my) - 0.5) * -18px), 0) scale(1); }
  to { transform: translate3d(calc((var(--mx) - 0.5) * -10px), calc((var(--my) - 0.5) * 4px), 0) scale(1.06); }
}
@keyframes floatB {
  from { transform: translate3d(calc((var(--mx) - 0.5) * 28px), calc((var(--my) - 0.5) * 22px), 0) scale(1.04); }
  to { transform: translate3d(calc((var(--mx) - 0.5) * 10px), calc((var(--my) - 0.5) * 8px), 0) scale(0.98); }
}
@keyframes floatC {
  from { transform: translate3d(calc((var(--mx) - 0.5) * 14px), calc((var(--my) - 0.5) * -16px), 0) scale(1); }
  to { transform: translate3d(calc((var(--mx) - 0.5) * -10px), calc((var(--my) - 0.5) * -2px), 0) scale(1.08); }
}
@keyframes grainMove {
  from { transform: translate3d(-2%, -2%, 0); }
  to { transform: translate3d(2%, 2%, 0); }
}

@keyframes scenePulse {
  from { filter: saturate(1.05) blur(0px); }
  to { filter: saturate(1) blur(0px); }
}

@keyframes pageIn {
  from { opacity: 0; filter: blur(14px); transform: translateY(8px); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@media (max-width: 800px) {
  .about { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; gap: 0.8rem; }
  .timeline { padding-inline-start: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
