:root {
  --bg: #FFFFFF;
  --fg: #0D0D0D;
  --accent: #0066FF;
  --accent-2: #4DA3FF;
  --accent-light: #E8F1FF;
  --muted: #888888;
  --surface: #F8F8F8;
  --surface-solid: #FFFFFF;
  --border: #EBEBEB;
  --border-solid: #E0E0E0;
  --gradient-text: var(--accent);
  --gradient-bg: var(--accent-light);
}

/* ── THEMES ───────────────────────────────────────── */
html[data-theme="blue"]   { --accent: #0066FF; --accent-2: #4DA3FF; --accent-light: #E8F1FF; }
html[data-theme="coral"]  { --accent: #FF6458; --accent-2: #FFAB7B; --accent-light: #FFF0EE; }
html[data-theme="green"]  { --accent: #1FAA59; --accent-2: #6FCF97; --accent-light: #E6F7ED; }
html[data-theme="violet"] { --accent: #7C4DFF; --accent-2: #B39DFF; --accent-light: #F1EBFF; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ── PASSWORD ─────────────────────────────────────── */
#pw-screen {
  position: fixed; inset: 0;
  background: var(--accent-light);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 500; padding: 2rem;
  transition: opacity 0.5s ease;
}
#pw-screen.fade-out { opacity: 0; pointer-events: none; }

.pw-mono {
  font-family: 'Playfair Display', serif;
  font-size: 3.75rem; font-weight: 700;
  letter-spacing: -0.02em; color: var(--fg);
  margin-bottom: 0.2rem; line-height: 1;
}
.pw-mono span { background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.pw-subtitle {
  font-size: 0.78rem; color: var(--muted);
  text-transform: lowercase; letter-spacing: 0.12em;
  margin-bottom: 2.75rem; font-weight: 400;
}
.pw-form { display: flex; flex-direction: column; gap: 0.65rem; width: 100%; max-width: 300px; }
.pw-input {
  width: 100%; padding: 0.9rem 1.1rem;
  border: 1px solid var(--border-solid); border-radius: 12px;
  background: var(--surface); backdrop-filter: blur(12px);
  font-family: 'DM Sans', sans-serif; font-size: 1rem; color: var(--fg);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.pw-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,102,255,0.15);
}
.pw-input.error { border-color: #c0392b; }
.pw-btn {
  width: 100%; padding: 0.9rem 1.1rem;
  background: var(--fg); color: var(--bg);
  border: none; border-radius: 12px;
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.01em;
}
.pw-btn:hover { background: var(--accent); }
.pw-btn:active { transform: scale(0.99); }
.pw-err { font-size: 0.78rem; color: #c0392b; text-align: center; min-height: 1.1em; }

/* ── NAV ──────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2.5rem; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.1rem;
  color: var(--fg); cursor: pointer; user-select: none; letter-spacing: -0.01em;
}
.nav-logo span { background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-size: 0.83rem; color: var(--muted);
  text-decoration: none; cursor: pointer; transition: color 0.2s; font-weight: 400;
  letter-spacing: 0.02em;
}
.nav-links a:hover { color: var(--fg); }

/* ── LAYOUT ───────────────────────────────────────── */
.container { max-width: 1080px; margin: 0 auto; padding: 0 2.5rem; }
.page { min-height: 100vh; }
.page.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.page:not(.hidden) { animation: fadeIn 0.35s ease; }

/* ── HERO ─────────────────────────────────────────── */
.hero { padding: 7.5rem 0 6rem; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
  background: var(--fg); color: #FFFFFF;
  padding: 0.35rem 0.85rem; border-radius: 20px;
  margin-bottom: 1.5rem;
}
.hero-name {
  font-family: 'Playfair Display', serif; font-weight: 700;
  font-size: clamp(4.5rem, 9vw, 8rem);
  line-height: 0.9; letter-spacing: -0.03em;
  color: var(--fg); margin-bottom: 1.75rem;
}
.hero-bio {
  font-size: 1.1rem; color: var(--muted);
  max-width: 520px; line-height: 1.78;
  margin-bottom: 2.5rem; font-weight: 300;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.875rem; color: var(--fg);
  border-bottom: 1px solid var(--fg);
  padding-bottom: 2px; cursor: pointer;
  text-decoration: none; transition: color 0.2s, border-color 0.2s;
  background: none; border-top: none; border-left: none; border-right: none;
  font-family: 'DM Sans', sans-serif;
}
.hero-cta:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── SECTIONS ─────────────────────────────────────── */
.section { padding: 5rem 0; border-top: 1px solid var(--border); }
.section-label {
  display: inline-flex;
  font-family: 'Playfair Display', serif; font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.02em; color: var(--fg);
  margin-bottom: 2.5rem;
}
.section-heading {
  font-family: 'Playfair Display', serif; font-weight: 700;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  letter-spacing: -0.02em; margin-bottom: 2.5rem; color: var(--fg);
}

/* ── PROCESS ──────────────────────────────────────── */
.process-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2rem;
}
@media (max-width: 860px) { .process-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .process-grid { grid-template-columns: 1fr; } }
.process-step { display: flex; flex-direction: column; gap: 0.75rem; }
.step-num {
  font-family: 'Playfair Display', serif; font-size: 3rem;
  font-weight: 500; color: var(--accent); line-height: 1;
}
.step-title { font-size: 0.88rem; font-weight: 500; color: var(--fg); }
.step-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.65; }

/* ── PROJECT CARDS ────────────────────────────────── */
.projects-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem;
}
@media (max-width: 680px) { .projects-grid { grid-template-columns: 1fr; } }

.pcard {
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 1.85rem;
  cursor: pointer; display: flex; flex-direction: column; gap: 0.9rem;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
  text-align: left; box-shadow: 0 2px 20px rgba(26, 21, 16, 0.04);
}
.pcard:hover {
  box-shadow: 0 12px 48px rgba(0, 102, 255, 0.12);
  transform: translateY(-3px);
  border-color: rgba(0, 102, 255, 0.25);
}
.pcard-tag {
  display: inline-flex; align-items: center;
  font-size: 0.67rem; text-transform: lowercase; letter-spacing: 0.09em;
  color: var(--accent); background: var(--accent-light);
  padding: 0.22rem 0.6rem; border-radius: 6px; font-weight: 500;
  align-self: flex-start;
}
.pcard-title {
  font-family: 'Playfair Display', serif; font-weight: 700;
  font-size: 1.35rem; line-height: 1.2; color: var(--fg);
}
.pcard-desc { font-size: 0.875rem; color: var(--muted); line-height: 1.65; flex: 1; }
.pcard-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pcard-pill {
  font-size: 0.7rem; color: var(--muted);
  background: rgba(250, 245, 238, 0.6);
  border: 1px solid var(--border);
  padding: 0.18rem 0.5rem; border-radius: 6px;
}
.pcard-impact {
  font-size: 0.78rem; font-weight: 500; color: var(--fg);
  display: flex; align-items: center; gap: 0.35rem;
  padding-top: 0.85rem; border-top: 1px solid var(--border);
}
.pcard-impact::before { content: '→'; color: var(--accent); }

/* ── ABOUT ────────────────────────────────────────── */
.about-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 5rem; align-items: start;
}
@media (max-width: 700px) { .about-grid { grid-template-columns: 1fr; gap: 2rem; } }
.about-bio { font-size: 1rem; line-height: 1.82; color: var(--fg); font-weight: 300; }
.about-bio strong { font-weight: 500; }
.about-bio p + p { margin-top: 1rem; }
.exp-list { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; }
.exp-item { display: flex; flex-direction: column; gap: 0.15rem; }
.exp-year { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.04em; }
.exp-role { font-size: 0.875rem; font-weight: 500; line-height: 1.3; }
.exp-org { font-size: 0.78rem; color: var(--muted); }
.skills-block { margin-top: 2rem; }
.skills-label {
  font-size: 0.67rem; text-transform: lowercase;
  letter-spacing: 0.12em; color: var(--muted);
  margin-bottom: 0.7rem; font-weight: 500;
}
.skills-wrap { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.skill-chip {
  font-size: 0.75rem; color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.28rem 0.7rem; border-radius: 20px;
}

/* ── CONTACT ──────────────────────────────────────── */
.contact-section { padding: 5.5rem 0 4.5rem; border-top: 1px solid var(--border); }
.contact-heading {
  font-family: 'Playfair Display', serif; font-weight: 700;
  font-size: clamp(2.75rem, 6.5vw, 4.5rem);
  letter-spacing: -0.025em; margin-bottom: 0.75rem; line-height: 1.0;
}
.contact-heading em { font-style: normal; background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.contact-sub { font-size: 1rem; color: var(--muted); margin-bottom: 2.25rem; font-weight: 300; }
.contact-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.contact-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.9rem; color: var(--fg); text-decoration: none;
  border-bottom: 1px solid var(--fg); padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.contact-link:hover { color: var(--accent); border-color: var(--accent); }

footer {
  padding: 2rem 2.5rem; border-top: 1px solid var(--border);
  text-align: center; font-size: 0.78rem; color: var(--muted);
}

/* ── CASE STUDY ───────────────────────────────────── */
.cs-wrap { padding-bottom: 6rem; }
.cs-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; color: var(--muted); cursor: pointer;
  transition: color 0.2s; padding: 2rem 0 2.5rem;
  background: none; border: none; font-family: 'DM Sans', sans-serif;
}
.cs-back:hover { color: var(--fg); }
.cs-cat {
  display: flex; width: fit-content; font-size: 0.67rem;
  text-transform: lowercase; letter-spacing: 0.09em;
  color: var(--accent); background: var(--accent-light);
  padding: 0.22rem 0.6rem; border-radius: 6px; font-weight: 500;
  margin-bottom: 1rem;
}
.cs-title {
  font-family: 'Playfair Display', serif; font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.0; letter-spacing: -0.025em; margin-bottom: 2.25rem;
  color: var(--accent);
}
.cs-metabar {
  display: flex; flex-wrap: wrap; gap: 2rem;
  padding: 1.35rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px; margin-bottom: 2.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.cs-meta-item { display: flex; flex-direction: column; gap: 0.2rem; }
.cs-meta-label {
  font-size: 0.64rem; text-transform: lowercase;
  letter-spacing: 0.12em; color: var(--muted); font-weight: 500;
}
.cs-meta-value { font-size: 0.85rem; font-weight: 500; color: var(--fg); }

/* Tabs */
.tab-pills {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 4px; gap: 2px;
  margin-bottom: 2.5rem; overflow-x: auto;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.tab-pill {
  flex: 1; padding: 0.58rem 1rem; font-size: 0.82rem;
  font-family: 'DM Sans', sans-serif; font-weight: 400;
  color: var(--muted); border: none; background: transparent;
  border-radius: 10px; cursor: pointer;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap; text-align: center; min-width: fit-content;
}
.tab-pill.active { background: var(--fg); color: #FDF8F3; font-weight: 500; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* CS content */
.cs-h2 {
  font-family: 'Playfair Display', serif; font-weight: 700;
  font-size: 1.8rem; letter-spacing: -0.02em;
  margin-bottom: 0.9rem; margin-top: 2.25rem;
}
.cs-h2:first-child { margin-top: 0; }
.cs-p { font-size: 0.92rem; color: var(--fg); line-height: 1.82; margin-bottom: 0.9rem; font-weight: 300; }
.cs-p strong { font-weight: 500; }
.cs-two { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
@media (max-width: 680px) { .cs-two { grid-template-columns: 1fr; gap: 1.5rem; } }
.cs-img-block { display: flex; flex-direction: column; gap: 0.5rem; }
.cs-img { width: 100%; border-radius: 12px; border: 1px solid var(--border); display: block;
  box-shadow: 0 4px 20px rgba(26, 21, 16, 0.06);
  -webkit-user-drag: none; user-select: none; pointer-events: none; }
.cs-caption { font-size: 0.75rem; color: var(--muted); font-style: italic; text-align: center; }

.cs-callout {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 1.15rem 1.5rem; margin: 1.5rem 0;
}
/* Gradient text utility */
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.cs-callout-label {
  font-size: 0.64rem; text-transform: lowercase;
  letter-spacing: 0.12em; color: var(--accent); font-weight: 600; margin-bottom: 0.45rem;
}
.cs-callout-text { font-size: 0.875rem; color: var(--fg); line-height: 1.65; }

.cs-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.9rem; }
.cs-list li {
  font-size: 0.875rem; color: var(--fg);
  display: flex; align-items: flex-start; gap: 0.6rem;
  line-height: 1.65; font-weight: 300;
}
.cs-list li::before { content: '—'; color: var(--accent); flex-shrink: 0; margin-top: 0.05rem; opacity:0.7; }

.cs-impact {
  background: var(--accent-light);
  border-radius: 16px; padding: 2.25rem; margin-top: 3rem;
}
.cs-impact-label {
  font-size: 0.64rem; text-transform: lowercase;
  letter-spacing: 0.14em; color: var(--accent);
  margin-bottom: 0.65rem; font-weight: 600;
}
.cs-impact-title {
  font-family: 'Playfair Display', serif; font-weight: 700;
  font-size: 1.4rem; margin-bottom: 0.75rem; line-height: 1.3; color: var(--fg);
}
.cs-impact-desc { font-size: 0.875rem; line-height: 1.72; color: var(--fg); opacity: 0.7; }

.cs-nav {
  display: flex; justify-content: space-between; gap: 1.5rem;
  margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border);
}
.cs-nav-link {
  display: flex; flex-direction: column; gap: 0.4rem;
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: inherit; color: var(--fg); max-width: 46%; text-align: left;
}
.cs-nav-next { margin-left: auto; align-items: flex-end; text-align: right; }
.cs-nav-dir {
  font-size: 0.68rem; text-transform: lowercase; letter-spacing: 0.1em;
  color: var(--accent); font-weight: 600;
}
.cs-nav-title {
  font-family: 'Playfair Display', serif; font-weight: 700;
  font-size: 1.05rem; line-height: 1.35; transition: opacity 0.2s;
}
.cs-nav-link:hover .cs-nav-title { opacity: 0.65; }
@media (max-width: 680px) { .cs-nav-link { max-width: 100%; } }

/* Tools */
.tools-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-top: 0.5rem; max-width: 640px; }
.tool-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 2rem;
  display: flex; flex-direction: column; gap: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.tool-icon {
  font-size: 1.3rem; width: 2.75rem; height: 2.75rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-light); border-radius: 10px;
}
.tool-name { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.35rem; }
.tool-desc { font-size: 0.875rem; color: var(--muted); line-height: 1.65; flex: 1; }
.tool-features { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.25rem; }
.tool-feature { font-size: 0.8rem; color: var(--fg); display: flex; gap: 0.5rem; align-items: flex-start; }
.tool-feature::before { content: '·'; color: var(--accent); font-size: 1.1rem; line-height: 1.1; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-solid); border-radius: 3px; }

/* ── THEME PICKER ─────────────────────────────────── */
.theme-picker {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 600;
  display: flex; gap: 0.5rem;
  background: var(--surface-solid); border: 1px solid var(--border);
  border-radius: 20px; padding: 0.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.theme-swatch {
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  border: 2px solid transparent; padding: 0; cursor: pointer;
  background: var(--swatch-color);
}
.theme-swatch.active { border-color: var(--fg); }
