:root {
  --bg: #0f0f11;
  --surface: rgba(255, 255, 255, 0.05);
  --text: #f3efe8;
  --muted: #c9c1b4;
  --line: rgba(230, 215, 185, 0.2);
  --accent: #d5bb89;
  --accent-2: #f0dfbf;
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.2, 1.2, 0.2, 1);
}

:root[data-theme="light"] {
  --bg: #f6f4f0;
  --surface: rgba(255, 255, 255, 0.8);
  --text: #1d1d20;
  --muted: #5e5b55;
  --line: rgba(30, 26, 18, 0.12);
  --accent: #a8844d;
  --accent-2: #d9b77a;
}

* { 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 10% -10%, rgba(213, 187, 137, 0.22), transparent 42%),
    radial-gradient(circle at 90% 10%, rgba(240, 223, 191, 0.10), transparent 46%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 400ms var(--ease), color 400ms var(--ease);
  animation: pageIn 900ms var(--ease) both;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: radial-gradient(circle, #fff 0.6px, transparent 0.6px);
  background-size: 4px 4px;
}

.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 35%);
}

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;
}

.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(213, 187, 137, 0.0);
  transition: transform 380ms var(--ease-spring), box-shadow 380ms var(--ease);
}

:root[data-theme="light"] .theme-icon {
  transform: rotate(14deg) scale(1.04);
  box-shadow: 0 0 24px 0 rgba(168, 132, 77, 0.22);
}

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-light {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  right: -120px;
  top: 10%;
  background: radial-gradient(circle, rgba(213, 187, 137, 0.22), transparent 65%);
  filter: blur(10px);
  animation: drift 8s ease-in-out infinite alternate;
}

.eyebrow { letter-spacing: 0; font-size: 0.85rem; color: var(--muted); }
h1 {
  font-family: "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, rgba(213, 187, 137, 0.26), rgba(240, 223, 191, 0.08));
  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);
}

.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, rgba(213, 187, 137, 0.35), rgba(15, 15, 17, 0.35));
  border: 1px solid var(--line);
}

.now { color: var(--muted); margin-top: 0.9rem; }

.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)); }

.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] {
  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);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

@keyframes drift {
  from { transform: translateY(-10px); }
  to { transform: translateY(14px); }
}

@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; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
