/* ─────────────────────────────────────────────────────────────────
   Grace Chandra · Personal Portfolio
   ───────────────────────────────────────────────────────────────── */

:root {
  /* Page-specific palette tweaks (sit on top of colors_and_type.css) */
  --bg-deep: #0a0c12;
  --bg-elev: #11141c;
  --bg-card: #161a24;
  --line:    #22272f;
  --line-soft: #1a1e26;

  /* Override action to a warm gold that still lives in the design system family */
  --action:       #e8b86b;
  --action-soft:  rgba(232, 184, 107, 0.12);
  --action-hover: #f3c884;
  --action-fg:    #0a0c12;
  --link:         #e8b86b;

  --max:    1200px;
  --gutter: clamp(20px, 4vw, 56px);

  --tx-fast: 0.18s;
  --tx-med:  0.45s;
  --ease:    cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }
html, body { background: var(--bg-deep); }

body {
  font-family: var(--font-sans);
  color: var(--fg-2);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: var(--action); text-decoration: none; transition: color var(--tx-fast); }
a:hover { color: var(--action-hover); }

/* Subtle grid background, very low contrast */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(ellipse 80% 50% at 70% -10%, rgba(232,184,107,0.10), transparent 60%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(232,184,107,0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* ─────────────────────────────────────────────────────────────────
   NAV
   ───────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  z-index: 100;
  transition: background var(--tx-med) var(--ease), backdrop-filter var(--tx-med), border-color var(--tx-med);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10, 12, 18, 0.78);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom-color: var(--line-soft);
}

.brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--fg-1);
}
.brand:hover { color: var(--fg-1); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border: 1.5px solid var(--action);
  color: var(--action);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 700; font-size: 13px;
  letter-spacing: 0.04em;
}
.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-name {
  font-family: var(--font-mono); font-size: 12.5px;
  letter-spacing: 0.08em; color: var(--fg-1);
  text-transform: uppercase; font-weight: 600;
}
.brand-sub {
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.16em; color: var(--fg-4);
  text-transform: uppercase;
}

.nav-links {
  display: flex; gap: 4px; align-items: center;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding: 10px 14px;
  border-radius: 4px;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 1.5px; background: var(--action);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--tx-fast) var(--ease);
}
.nav-links a:hover { color: var(--fg-1); }
.nav-links a.active { color: var(--action); }
.nav-links a.active::after { transform: scaleX(1); }

@media (max-width: 680px) {
  .brand-text { display: none; }
  .nav-links a { padding: 8px 10px; font-size: 10.5px; letter-spacing: 0.1em; }
}

/* Dark/light toggle in nav */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg-2);
  cursor: pointer;
  margin-left: 8px;
  padding: 0;
  transition: all var(--tx-fast) var(--ease);
  position: relative;
}
.theme-toggle:hover {
  border-color: var(--action);
  color: var(--action);
  transform: rotate(-12deg);
}
.theme-toggle svg {
  position: absolute;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
/* Default (dark / midnight): show moon */
:root .theme-toggle .icon-sun  { opacity: 0; transform: rotate(-90deg) scale(0.6); }
:root .theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }
/* Light: show sun */
:root[data-theme="paper"] .theme-toggle .icon-sun  { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="paper"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }

@media (max-width: 680px) {
  .theme-toggle { width: 34px; height: 34px; margin-left: 4px; }
}


/* ─────────────────────────────────────────────────────────────────
   HERO
   ───────────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  padding: 140px var(--gutter) 80px;
  display: flex; align-items: center;
  position: relative;
}
.hero-grid {
  width: 100%; max-width: var(--max); margin: 0;
  display: grid; grid-template-columns: 1fr;
  gap: 0; align-items: center;
}
@media (max-width: 880px) {
  .hero { padding-top: 120px; }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-3);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(232,184,107,0.04);
  margin-bottom: 32px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--action);
  box-shadow: 0 0 0 4px rgba(232,184,107,0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(232,184,107,0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(232,184,107,0.06); }
}

.display {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(56px, 9vw, 132px);
  line-height: 0.88;
  letter-spacing: -0.025em;
  color: var(--fg-1);
  margin-bottom: 28px;
  text-align: left;
  /* Reserve exactly two lines so the cycle's type/delete doesn't shove the page around */
  min-height: 2lh;
}
.display em {
  font-style: italic;
  font-weight: 400;
  color: var(--action);
}

/* Hero title — typewriter cycle through identities */
.display-cycle .cyc {
  display: block;
  white-space: pre;
  /* Reserve one line of height so an empty span still occupies its line */
  min-height: 1lh;
}
.display-cycle .cyc-text {
  display: inline;
}
.display-cycle .cyc-caret {
  display: inline-block;
  width: 0.06em;
  height: 0.85em;
  background: var(--action);
  margin-left: 0.04em;
  vertical-align: -0.06em;
  opacity: 0;
  transition: opacity 0.15s linear;
  border-radius: 1px;
}
.display-cycle .cyc-caret.active {
  opacity: 1;
  animation: caretBlink 1.05s steps(1) infinite;
}
@keyframes caretBlink {
  0%, 50%   { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}
/* When actively typing/deleting, keep caret solid (no blink) */
.display-cycle .cyc-caret.typing {
  animation: none;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .display-cycle .cyc-caret { display: none; }
}

.lede {
  font-family: var(--font-serif-text);
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.6;
  color: var(--fg-2);
  max-width: 680px;
  margin-bottom: 24px;
}
.lede a {
  color: var(--action);
  border-bottom: 1px solid rgba(232,184,107,0.4);
  padding-bottom: 1px;
}
.lede a:hover { border-bottom-color: var(--action); }

.subline {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 36px;
}
.pill {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-2);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
}

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  padding: 14px 22px;
  border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.12em;
  cursor: pointer; border: 1px solid transparent;
  transition: all var(--tx-fast) var(--ease);
}
.btn-primary { background: var(--action); color: var(--action-fg); }
.btn-primary:hover { background: var(--action-hover); transform: translateY(-1px); color: var(--action-fg); }
.btn-ghost { background: transparent; color: var(--fg-1); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--action); color: var(--action); }
.btn .arrow { transition: transform var(--tx-fast); }
.btn:hover .arrow { transform: translateX(3px); }

/* Hero photo */
.hero-photo {
  position: relative;
  display: flex; justify-content: center; align-items: center;
}
.photo-frame {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-card);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.55),
    0 0 0 1px rgba(232,184,107,0.08) inset;
}
.photo-frame img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.05) contrast(1.02);
}
.photo-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 18px;
  display: flex; justify-content: space-between;
  background: linear-gradient(to top, rgba(10,12,18,0.95), transparent);
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-1);
}
.photo-meta span:last-child { color: var(--action); }
.photo-ring {
  position: absolute;
  inset: -28px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  pointer-events: none;
  z-index: -1;
  animation: ring-rotate 60s linear infinite;
}
@keyframes ring-rotate {
  to { transform: rotate(360deg); }
}

.scroll-cue {
  position: absolute;
  bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--fg-4);
}
.scroll-cue:hover { color: var(--action); }
.scroll-cue .arrow-down {
  font-size: 16px; animation: bob 2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}
@media (max-width: 880px) {
  .scroll-cue { display: none; }
}


/* ─────────────────────────────────────────────────────────────────
   SECTIONS · shared
   ───────────────────────────────────────────────────────────────── */
section { padding: 120px var(--gutter); max-width: 100%; }
section > * { max-width: var(--max); margin-left: auto; margin-right: auto; }

.section-head {
  margin-bottom: 56px;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.section-head.in { opacity: 1; transform: none; }
.section-head.centered { text-align: center; }
.section-head .kicker {
  display: inline-block;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--action);
  margin-bottom: 12px;
  position: relative; padding-left: 22px;
}
.section-head .kicker::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: 14px; height: 1px; background: var(--action);
}
.section-head.centered .kicker { padding-left: 0; }
.section-head.centered .kicker::before { display: none; }
.section-head .section-title {
  font-family: var(--font-serif); font-weight: 300;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--fg-1);
}
.section-head .section-sub {
  margin-top: 16px;
  font-family: var(--font-serif-text);
  font-size: 17px; line-height: 1.55;
  color: var(--fg-3); max-width: 620px;
}


/* ─────────────────────────────────────────────────────────────────
   ABOUT
   ───────────────────────────────────────────────────────────────── */
.about {
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-elev) 60%, var(--bg-deep) 100%);
}

.about-grid {
  display: grid; grid-template-columns: minmax(240px, 360px) 1fr;
  gap: clamp(28px, 4vw, 64px); align-items: center;
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.about-grid.in { opacity: 1; transform: none; }
@media (max-width: 680px) { .about-grid { grid-template-columns: 1fr; gap: 32px; align-items: start; } }

.about-portrait { position: relative; }
@media (max-width: 920px) { .about-portrait { max-width: 380px; } }
.portrait-frame {
  aspect-ratio: 4 / 5;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-card);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.portrait-caption {
  margin-top: 12px;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-4);
  display: flex; justify-content: space-between;
  padding: 0 2px;
}

.about-body p {
  font-family: var(--font-serif-text);
  font-size: 18px; line-height: 1.7;
  color: var(--fg-2);
  margin-bottom: 22px;
  max-width: 640px;
}
.about-body p.hello {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin-bottom: 28px;
}
.about-body p strong { color: var(--fg-1); font-weight: 600; }
.about-body p a {
  color: var(--action);
  border-bottom: 1px solid rgba(232,184,107,0.4);
}

.bio-blocks {
  margin-top: clamp(56px, 8vw, 96px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 880px) { .bio-blocks { grid-template-columns: 1fr; } }
.bio-block {
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  position: relative;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.bio-block.in { opacity: 1; transform: none; }
.bio-block::before {
  content: ''; position: absolute; left: -1px; top: 14px; bottom: 14px;
  width: 2px; background: var(--action);
  border-radius: 2px;
}
.bio-block h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--action);
  margin-bottom: 14px;
}
.bio-block ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.bio-block li {
  font-family: var(--font-serif-text);
  font-size: 15.5px; color: var(--fg-2); line-height: 1.5;
}
.bio-block li strong { color: var(--fg-1); font-weight: 600; }
.bio-block li em {
  color: var(--fg-4); font-style: normal;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.06em;
  margin-left: 4px;
}


/* ─────────────────────────────────────────────────────────────────
   SKILLS
   ───────────────────────────────────────────────────────────────── */
.skills-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) { .skills-grid { grid-template-columns: 1fr; } }

.skill-card {
  padding: 32px 28px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color var(--tx-fast), transform var(--tx-fast);
  opacity: 0; transform: translateY(20px);
}
.skill-card.in {
  opacity: 1; transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), border-color var(--tx-fast);
}
.skill-card:hover {
  border-color: rgba(232,184,107,0.35);
  transform: translateY(-3px);
}
.skill-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px;
  border-radius: 10px;
  background: var(--action-soft);
  color: var(--action);
  margin-bottom: 24px;
}
.skill-card h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin-bottom: 18px;
}
.skill-card .skill-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--action);
  margin-top: 14px;
  margin-bottom: 6px;
}
.skill-card p {
  font-family: var(--font-serif-text);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fg-2);
}


/* ─────────────────────────────────────────────────────────────────
   PORTFOLIO / PROJECTS
   ───────────────────────────────────────────────────────────────── */
.portfolio {
  border-top: 1px solid var(--line-soft);
}

.project-grid {
  display: flex; flex-direction: column; gap: 16px;
}

.project {
  display: grid;
  grid-template-columns: 80px 1fr 60px;
  gap: 28px; align-items: center;
  padding: 32px 32px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  position: relative; overflow: hidden;
  transition: all var(--tx-fast) var(--ease);
  opacity: 0; transform: translateY(20px);
}
.project.in {
  opacity: 1; transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), border-color var(--tx-fast), background var(--tx-fast);
}
.project::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--action);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform var(--tx-fast) var(--ease);
}
.project:hover {
  border-color: rgba(232,184,107,0.45);
  background: #1a1f2a;
}
.project:hover::before { transform: scaleY(1); transform-origin: top; }
.project:hover .project-arrow { transform: translate(6px, -6px); color: var(--action); }
.project:hover .project-title { color: var(--action); }

.project-no {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 60px;
  line-height: 1; color: var(--action);
  letter-spacing: -0.04em;
  opacity: 0.6;
}
.project-body { min-width: 0; }
.project-tags {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.project-tags span {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg-3);
}
.project-tags span:first-child {
  color: var(--action);
  border-color: rgba(232,184,107,0.35);
  background: var(--action-soft);
}
.project-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.015em;
  color: var(--fg-1);
  margin-bottom: 10px;
  transition: color var(--tx-fast);
}
.project-desc {
  font-family: var(--font-serif-text);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--fg-3);
  max-width: 720px;
  margin-bottom: 14px;
}
.project-links {
  display: flex; gap: 14px; flex-wrap: wrap;
}
.project-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.project-arrow {
  font-family: var(--font-mono);
  font-size: 28px;
  color: var(--fg-4);
  transition: all var(--tx-fast) var(--ease);
  text-align: right;
}

@media (max-width: 720px) {
  .project { grid-template-columns: 56px 1fr; padding: 24px; gap: 20px; }
  .project-no { font-size: 42px; }
  .project-arrow { display: none; }
}


/* ─────────────────────────────────────────────────────────────────
   CONTACT
   ───────────────────────────────────────────────────────────────── */
.contact {
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-elev) 100%);
}

.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 60px; align-items: center;
}
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; gap: 40px; } }

.contact-blurb {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.contact-blurb.in { opacity: 1; transform: none; }

.contact-illo {
  position: relative;
  width: 140px; height: 140px;
  margin-bottom: 24px;
}
.coffee-svg {
  width: 140px; height: 140px;
  color: var(--action);
}
.illo-variant {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity var(--tx-med) var(--ease);
  pointer-events: none;
}
:root[data-contact-illo="coffee"] .illo-variant[data-illo="coffee"],
:root[data-contact-illo="ripple"] .illo-variant[data-illo="ripple"],
:root[data-contact-illo="waves"]  .illo-variant[data-illo="waves"],
:root[data-contact-illo="bean"]   .illo-variant[data-illo="bean"] { opacity: 1; }
/* Default when no tweak set: show coffee */
:root:not([data-contact-illo]) .illo-variant[data-illo="coffee"] { opacity: 1; }

/* A) Coffee cup — steam wisps drift up & fade, cup gently bobs */
.cup-group { transform-origin: 100px 100px; animation: cupBob 4.5s ease-in-out infinite; }
.wisp { transform-origin: center; opacity: 0; }
.wisp-1 { animation: wisp 3.2s ease-out infinite; animation-delay: 0s;   }
.wisp-2 { animation: wisp 3.2s ease-out infinite; animation-delay: 1.0s; }
.wisp-3 { animation: wisp 3.2s ease-out infinite; animation-delay: 2.0s; }
@keyframes wisp {
  0%   { transform: translate(0, 12px) scale(0.85); opacity: 0; }
  20%  { opacity: 0.85; }
  60%  { opacity: 0.55; }
  100% { transform: translate(0, -28px) scale(1.05); opacity: 0; }
}
@keyframes cupBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

/* B) Ripple — concentric circles expand outward */
.ripple { transform-origin: 100px 100px; opacity: 0; }
.ripple-1 { animation: rippleOut 3.6s ease-out infinite; animation-delay: 0s;   }
.ripple-2 { animation: rippleOut 3.6s ease-out infinite; animation-delay: 1.2s; }
.ripple-3 { animation: rippleOut 3.6s ease-out infinite; animation-delay: 2.4s; }
@keyframes rippleOut {
  0%   { transform: scale(0.35); opacity: 0; }
  15%  { opacity: 0.7; }
  100% { transform: scale(9); opacity: 0; }
}

/* C) Waves — gentle horizontal drift */
.wave { animation: waveDrift 6s ease-in-out infinite; }
.wave-1 { animation-delay: 0s;   }
.wave-2 { animation-delay: 0.3s; }
.wave-3 { animation-delay: 0.6s; }
.wave-4 { animation-delay: 0.9s; }
@keyframes waveDrift {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-8px); }
}

/* D) Bean — slow rotation, dot orbit */
.bean-group { transform-origin: 100px 100px; animation: beanFloat 5s ease-in-out infinite; }
@keyframes beanFloat {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50%      { transform: rotate(3deg)  translateY(-3px); }
}
.orbit-dot { transform-origin: 100px 100px; }
.orbit-1 { animation: orbit 6s linear infinite; }
.orbit-2 { animation: orbit 6s linear infinite; animation-delay: -3s; }
@keyframes orbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .wisp, .ripple, .wave, .bean-group, .cup-group, .orbit-dot { animation: none !important; }
  .wisp, .ripple { opacity: 0.6; }
}

.contact-blurb p {
  font-family: var(--font-serif-text);
  font-size: 17px; line-height: 1.65;
  color: var(--fg-2);
  margin-bottom: 16px;
  max-width: 480px;
}
.contact-blurb p.lede {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--fg-1);
}
.contact-blurb strong { color: var(--fg-1); font-weight: 600; }

.contact-list {
  list-style: none;
  display: flex; flex-direction: column; gap: 10px;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.7s var(--ease) 0.1s, transform 0.7s var(--ease) 0.1s;
}
.contact-list.in { opacity: 1; transform: none; }
.contact-list a {
  display: grid;
  grid-template-columns: 44px 1fr 24px;
  gap: 18px; align-items: center;
  padding: 14px 22px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg-1);
  text-decoration: none;
  transition: all var(--tx-fast) var(--ease);
}
.contact-list a:hover {
  border-color: rgba(232,184,107,0.45);
  background: #1a1f2a;
  transform: translateX(4px);
}
.contact-list a:hover .ch-arrow { color: var(--action); transform: translate(3px, -3px); }
.contact-list a:hover .ch-icon  { transform: scale(1.06); }

.ch-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18), 0 0 0 1px var(--line) inset;
  transition: transform var(--tx-fast) var(--ease);
  overflow: hidden;
}
.ch-icon svg { width: 28px; height: 28px; display: block; }
:root[data-theme="paper"] .ch-icon {
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 0 0 1px var(--line) inset;
}

.ch-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ch-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-4);
}
.ch-value {
  font-family: var(--font-serif-text);
  font-size: 15.5px;
  color: var(--fg-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch-arrow {
  font-family: var(--font-mono); font-size: 16px;
  color: var(--fg-4);
  transition: all var(--tx-fast) var(--ease);
  text-align: right;
}
@media (max-width: 540px) {
  .contact-list a { grid-template-columns: 36px 1fr 20px; gap: 12px; padding: 12px 16px; }
  .ch-icon { width: 32px; height: 32px; }
  .ch-icon svg { width: 22px; height: 22px; }
  .ch-label { font-size: 9.5px; }
  .ch-value { font-size: 13.5px; }
}


/* ─────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────── */
.footer {
  padding: 28px var(--gutter);
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-4);
  max-width: var(--max); margin: 0 auto;
}
.foot-row { display: flex; gap: 14px; }
.footer a { color: var(--fg-4); }
.footer a:hover { color: var(--action); }


/* ─────────────────────────────────────────────────────────────────
   Reveal helpers (in state set by IntersectionObserver in HTML)
   ───────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .section-head, .about-grid, .bio-block, .skill-card, .project, .contact-blurb, .contact-list, .hero-text, .hero-photo {
    opacity: 1 !important; transform: none !important;
  }
}


/* ─────────────────────────────────────────────────────────────────
   TWEAKS · variants
   ───────────────────────────────────────────────────────────────── */

/* Heading style */
:root[data-heading-style="plain"] .display em {
  font-style: normal; color: var(--fg-1);
}
:root[data-heading-style="underline"] .display em {
  font-style: normal;
  color: var(--fg-1);
  text-decoration: underline;
  text-decoration-color: var(--action);
  text-decoration-thickness: 6px;
  text-underline-offset: 12px;
}

/* Portrait shape */
:root[data-portrait-shape="rounded"] .portrait-frame,
:root[data-portrait-shape="rounded"] .photo-frame { border-radius: 28px; }
:root[data-portrait-shape="circle"] .portrait-frame,
:root[data-portrait-shape="circle"] .photo-frame { border-radius: 50%; aspect-ratio: 1 / 1; }
:root[data-portrait-shape="circle"] .portrait-frame img,
:root[data-portrait-shape="circle"] .photo-frame img { object-position: center 30%; }

/* Density */
:root[data-density="compact"] section { padding-top: 80px; padding-bottom: 80px; }
:root[data-density="compact"] .hero { padding-top: 110px; padding-bottom: 60px; }
:root[data-density="compact"] .section-head { margin-bottom: 36px; }
:root[data-density="compact"] .project { padding: 22px 24px; gap: 20px; }
:root[data-density="compact"] .skill-card { padding: 24px 22px; }
:root[data-density="compact"] .bio-block { padding: 16px 20px; }

:root[data-density="roomy"] section { padding-top: 160px; padding-bottom: 160px; }
:root[data-density="roomy"] .hero { padding-top: 180px; padding-bottom: 120px; }
:root[data-density="roomy"] .section-head { margin-bottom: 72px; }
:root[data-density="roomy"] .project { padding: 44px 40px; }
:root[data-density="roomy"] .skill-card { padding: 40px 36px; }
:root[data-density="roomy"] .bio-block { padding: 28px 32px; }

/* Theme variants */
:root[data-theme="midnight"] {
  --bg-deep: #07080d;
  --bg-elev: #0c0e16;
  --bg-card: #11141e;
  --line: #1d2230;
  --line-soft: #161a25;
}
:root[data-theme="paper"] {
  --bg-deep: #f5ede1;
  --bg-elev: #fbf3e7;
  --bg-card: #fff8eb;
  --line: #e2d6c0;
  --line-soft: #ece1cc;
  --fg-1: #1a1612;
  --fg-2: #3a342c;
  --fg-3: #6a6155;
  --fg-4: #948876;
  --fg-5: #c8bba2;
}
:root[data-theme="paper"] body::before {
  background-image:
    radial-gradient(ellipse 80% 50% at 70% -10%, rgba(232,184,107,0.18), transparent 60%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(232,184,107,0.10), transparent 60%);
}
:root[data-theme="paper"] .nav.scrolled {
  background: rgba(245, 237, 225, 0.85);
  border-bottom-color: var(--line);
}
:root[data-theme="paper"] .project:hover,
:root[data-theme="paper"] .contact-list a:hover {
  background: #fff9ec;
}

/* Coffee illustration toggle */
:root[data-show-coffee="off"] .coffee-svg { display: none; }

/* Display weight */
:root[data-display-weight="regular"] .display { font-weight: 400; }
:root[data-display-weight="regular"] .display em { font-weight: 500; }
:root[data-display-weight="bold"] .display { font-weight: 600; letter-spacing: -0.04em; }
:root[data-display-weight="bold"] .display em { font-weight: 700; }

/* Background style */
:root[data-background="grid"] body::before {
  background-image:
    linear-gradient(rgba(232,184,107,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,184,107,0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
}
:root[data-background="grid"][data-theme="paper"] body::before {
  background-image:
    linear-gradient(rgba(120,90,40,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,90,40,0.10) 1px, transparent 1px);
}
:root[data-background="plain"] body::before { display: none; }

/* Nav style */
:root[data-nav-style="solid"] .nav {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: none;
}
:root[data-nav-style="solid"] .nav.scrolled {
  background: var(--bg-elev);
  backdrop-filter: none;
}
:root[data-nav-style="minimal"] .nav {
  background: transparent !important;
  backdrop-filter: none !important;
  border-bottom: none !important;
}
:root[data-nav-style="minimal"] .brand-mark {
  border: none;
  background: var(--action);
  color: var(--action-fg);
}
:root[data-nav-style="minimal"] .nav-links a::after { display: none; }

/* Project tile style */
:root[data-project-style="minimal"] .project {
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 28px 0;
  gap: 24px;
}
:root[data-project-style="minimal"] .project:last-child { border-bottom: 1px solid var(--line); }
:root[data-project-style="minimal"] .project::before { display: none; }
:root[data-project-style="minimal"] .project:hover { background: transparent; }
:root[data-project-style="minimal"] .project:hover .project-no { transform: translateX(4px); }

:root[data-project-style="index"] .project-grid {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
  gap: 0;
}
:root[data-project-style="index"] .project {
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 22px 28px;
  grid-template-columns: 56px 1fr auto 40px;
  gap: 20px;
}
:root[data-project-style="index"] .project:first-child { border-top: none; }
:root[data-project-style="index"] .project::before { display: none; }
:root[data-project-style="index"] .project-no {
  font-size: 32px; line-height: 1.2;
}
:root[data-project-style="index"] .project-desc {
  font-size: 14px;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
:root[data-project-style="index"] .project-links { display: none; }
:root[data-project-style="index"] .project:hover { background: var(--bg-elev); }

/* Hero pills */
:root[data-show-pills="off"] .subline { display: none; }

/* Skills section */
:root[data-show-skills="off"] .skills-grid,
:root[data-show-skills="off"] .skills-grid + *,
:root[data-show-skills="off"] .about > .section-head:nth-of-type(2) { display: none; }
/* Robust hide: target the second .section-head inside .about and the .skills-grid */
:root[data-show-skills="off"] .about .section-head + .about-grid + .section-head,
:root[data-show-skills="off"] .about .section-head + .about-grid + .section-head + .skills-grid {
  display: none;
}


/* ─────────────────────────────────────────────────────────────────
   TWEAKS panel · UI
   ───────────────────────────────────────────────────────────────── */
.tweaks {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 296px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(232,184,107,0.06) inset;
  font-family: var(--font-mono);
  color: var(--fg-1);
  z-index: 200;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.tweaks.open { opacity: 1; transform: none; }

.tweaks-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--action);
}
.tweaks-close {
  background: none; border: none; color: var(--fg-3);
  font-size: 22px; line-height: 1; cursor: pointer;
  padding: 0 4px; transition: color var(--tx-fast);
}
.tweaks-close:hover { color: var(--fg-1); }

.tweaks-body {
  padding: 14px 16px 18px;
  display: flex; flex-direction: column; gap: 16px;
  max-height: 70vh; overflow-y: auto;
}

.tw-section { display: flex; flex-direction: column; gap: 8px; }
.tw-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-4);
}

/* Swatches */
.tw-swatches { display: flex; gap: 8px; }
.tw-swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform var(--tx-fast), border-color var(--tx-fast);
  box-shadow: 0 0 0 1px var(--line) inset;
}
.tw-swatch:hover { transform: scale(1.1); }
.tw-swatch.active {
  border-color: var(--fg-1);
  box-shadow: 0 0 0 2px var(--bg-card) inset;
}

/* Radio / toggle */
.tw-radio, .tw-toggle {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 2px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.tw-radio button, .tw-toggle button {
  background: transparent;
  border: none;
  padding: 8px 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--tx-fast);
}
.tw-radio button:hover, .tw-toggle button:hover { color: var(--fg-1); }
.tw-radio button.active, .tw-toggle button.active {
  background: var(--action);
  color: var(--action-fg);
}

@media (max-width: 540px) {
  .tweaks { bottom: 12px; right: 12px; left: 12px; width: auto; }
}
