/* ============================================================
   Nicole — Portfolio Foundation (dark)
   Original design; type-driven, keyboard nav, draggable hero.
   ============================================================ */

/* Dark: Material-recommended #121212 (avoids pure-black halation),
   text is dimmed white (#e8e8e8) rather than harsh #fff. */
:root {
  --bg: #121212;
  --ink: #e8e8e8;
  --muted: #9b9b97;
  --line: rgba(232, 232, 232, 0.12);
  --card: #1b1b1c;
  --card-2: #222224;
  --sel: #6f92ff;            /* selection-box blue */
  --tag-bg: #2a2a2c;
  --nav-bg: rgba(18, 18, 18, 0.55);
  --chip-line: rgba(232, 232, 232, 0.22);
  --soft-line: rgba(232, 232, 232, 0.06);
  --soft-fill: rgba(232, 232, 232, 0.07);
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(20px, 4vw, 56px);
}

/* Light: soft warm off-white (less glare than pure #fff),
   with a soft near-black for text instead of harsh #000. */
html[data-theme="light"] {
  --bg: #f7f5f1;
  --ink: #1b1b18;
  --muted: #87837a;
  --line: rgba(27, 27, 24, 0.12);
  --card: #efece5;
  --card-2: #e8e4db;
  --sel: #3d6bff;
  --tag-bg: #ffffff;
  --nav-bg: rgba(247, 245, 241, 0.6);
  --chip-line: rgba(27, 27, 24, 0.25);
  --soft-line: rgba(27, 27, 24, 0.07);
  --soft-fill: rgba(27, 27, 24, 0.06);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

::selection { background: var(--ink); color: var(--bg); }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }

/* ---------- Page transition veil ---------- */
.veil {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
body.is-leaving .veil { opacity: 1; pointer-events: all; }
body.is-entering .veil { opacity: 1; }

/* ---------- Corner header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 20px var(--gutter);
  pointer-events: none;
}
.site-header a, .site-header span, .site-header button { pointer-events: all; }
.wordmark { display: block; color: var(--ink); transition: opacity 0.3s var(--ease); }
.wordmark:hover { opacity: 0.7; }
.wordmark svg { width: 30px; height: 30px; display: block; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--chip-line);
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- Top key nav ---------- */
.key-nav {
  position: fixed; top: 16px; left: 50%; z-index: 60;
  display: flex; align-items: center; gap: 4px;
  padding: 6px;
  border-radius: 99px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--soft-line);
  opacity: 0; transform: translate(-50%, -14px);
  transition: opacity 0.8s var(--ease) 0.35s, transform 0.8s var(--ease) 0.35s;
}
.is-loaded .key-nav { opacity: 1; transform: translate(-50%, 0); }
.key-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px 0 6px;
  border-radius: 99px;
  color: var(--muted);
  font-size: 13.5px; font-weight: 500;
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}
.key-nav a:hover, .key-nav a.is-active { color: var(--ink); background: var(--soft-fill); }
.key-nav .key {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border: 1px solid var(--chip-line);
  border-radius: 5px;
  font-size: 10.5px; font-weight: 650;
  color: var(--muted);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.key-nav a:hover .key, .key-nav a.is-active .key {
  color: var(--ink); border-color: var(--ink);
}
.key-nav .divider, .key-nav .hint { display: none; }
.key-nav .label { }

/* ---------- Reveal animations ---------- */
.line-mask { display: block; overflow: hidden; }
.line-mask > span {
  display: block;
  transform: translateY(110%);
  transition: transform 1s var(--ease);
}
.is-loaded .line-mask > span { transform: translateY(0); }

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
[data-reveal].in-view { opacity: 1; transform: translateY(0); }

.d-1 { transition-delay: 0.08s; }
.d-2 { transition-delay: 0.16s; }
.d-3 { transition-delay: 0.24s; }
.d-4 { transition-delay: 0.32s; }
.d-5 { transition-delay: 0.4s; }

/* ---------- Hero with draggable selection ---------- */
.hero {
  position: relative;
  min-height: 58svh;
  overflow: hidden;
}
.drag-stage { position: absolute; inset: 108px 0 0 0; }

.fig-select {
  position: absolute;
  left: 50%; top: 50%;
  touch-action: none;
  cursor: grab;
  will-change: transform;
  opacity: 0;
  transition: opacity 1s var(--ease) 0.25s;
}
.is-loaded .fig-select { opacity: 1; }
.fig-select:active { cursor: grabbing; }

.fig-box {
  position: relative;
  /* match the About text column exactly: (about max-width or viewport) minus the page gutters */
  width: calc(min(720px, 100vw) - 2 * var(--gutter));
  padding: clamp(20px, 3.5vw, 36px) clamp(24px, 4vw, 44px);
  border: 1px solid var(--sel);
}

.fig-box .handle {
  position: absolute;
  width: 9px; height: 9px;
  background: #fff;
  border: 1px solid var(--sel);
}
.fig-box .tl { top: -5px; left: -5px; }
.fig-box .tr { top: -5px; right: -5px; }
.fig-box .bl { bottom: -5px; left: -5px; }
.fig-box .br { bottom: -5px; right: -5px; }

.fig-label {
  position: absolute;
  top: -32px; left: -1px;
  font-size: 12px; font-weight: 550;
  background: var(--tag-bg);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.hero-copy {
  font-size: clamp(1.7rem, 3.4vw, 2.8rem);
  font-weight: 550;
  letter-spacing: -0.025em;
  line-height: 1.16;
  user-select: none;
}
.hero-copy .hi { color: var(--ink); }
.hero-copy .lo { color: var(--muted); }

/* ---------- Work section ---------- */
.work {
  padding: 0 var(--gutter) clamp(100px, 16vh, 180px);
  display: grid;
  gap: clamp(70px, 11vh, 130px);
  max-width: 1180px;
  margin: 0 auto;
}

.project-card { display: block; }

.project-head {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr auto;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 22px;
}
.project-head .client {
  position: relative;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 500;
  padding-left: 0;
  transition: color 0.45s var(--ease), padding 0.5s var(--ease);
}
.project-head .client::before {
  content: "→";
  position: absolute;
  left: 0; top: 0;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.45s var(--ease), transform 0.5s var(--ease);
}
.project-card:hover .client { color: var(--ink); padding-left: 1.5em; }
.project-card:hover .client::before { opacity: 1; transform: translateX(0); }
.project-head h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
}
@media (max-width: 640px) {
  .project-head { grid-template-columns: 1fr auto; }
  .project-head h3 { grid-column: 1 / -1; }
}

.project-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(233, 233, 228, 0.06);
  padding: clamp(26px, 5vw, 60px) clamp(26px, 5vw, 60px) 0;
}
.project-media .thumb-wrap {
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  transform: translateY(6px);
  transition: transform 0.9s var(--ease);
}
.project-card:hover .thumb-wrap { transform: translateY(0); }
.project-media .thumb-wrap { aspect-ratio: 16 / 9; }
.project-media .thumb {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(1.005);
  transition: transform 1.1s var(--ease);
}
.project-card:hover .thumb { transform: scale(1.03); }
.project-media .view-tag {
  position: absolute; top: 18px; right: 18px; z-index: 2;
  background: var(--ink); color: var(--bg);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em;
  padding: 9px 16px; border-radius: 99px;
  opacity: 0; transform: translateY(8px) scale(0.94);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.project-card:hover .view-tag { opacity: 1; transform: translateY(0) scale(1); }

/* ============================================================
   Inner pages
   ============================================================ */

.page {
  padding: clamp(130px, 20vh, 190px) var(--gutter) clamp(100px, 16vh, 160px);
  max-width: 1200px;
}
.page.narrow {
  max-width: 720px;
  margin: 0 auto;
}
.page-title {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 600; letter-spacing: -0.03em; line-height: 1.08;
}
.page-title .soft { color: var(--muted); }

/* ---------- About ---------- */
.bio {
  margin-top: 48px;
  max-width: 58ch;
  display: grid; gap: 22px;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  font-weight: 450; letter-spacing: -0.01em;
}
.bio a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--muted); }
.bio a:hover { text-decoration-color: var(--ink); }

.experience { margin-top: clamp(60px, 9vh, 100px); }
.section-label {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted);
  display: flex; align-items: center; gap: 12px;
}
.section-label::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.exp-row {
  display: grid;
  /* fixed date column keeps the role column aligned across rows */
  grid-template-columns: 1.2fr 1.4fr 120px;
  gap: 20px; align-items: baseline;
  padding: 22px 12px;
  border-bottom: 1px solid var(--line);
  transition: background 0.35s var(--ease), padding 0.35s var(--ease);
  border-radius: 10px;
}
.exp-row:first-of-type { border-top: 1px solid var(--line); }
.exp-row:hover { background: var(--card); padding-left: 20px; padding-right: 20px; }
.exp-row .company { font-weight: 550; letter-spacing: -0.01em; }
.exp-row .role { color: var(--muted); }
.exp-row .dates { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 640px) {
  .exp-row { grid-template-columns: 1fr auto; }
  .exp-row .role { grid-column: 1 / -1; margin-top: -12px; font-size: 15px; }
}

.about-gallery {
  margin-top: clamp(60px, 9vh, 100px);
  /* 16fr : 9fr makes a 4:3 landscape and a 3:4 portrait share the same height */
  display: grid; grid-template-columns: 16fr 9fr; gap: 20px;
}
.about-gallery .frame {
  border-radius: 12px; overflow: hidden; background: var(--card);
}
.about-gallery .frame.landscape { aspect-ratio: 4 / 3; }
.about-gallery .frame.portrait { aspect-ratio: 3 / 4; }
@media (max-width: 640px) {
  .about-gallery { grid-template-columns: 1fr; }
  .about-gallery .frame.portrait { max-width: 75%; margin: 0 auto; }
}
.about-gallery svg { width: 100%; height: 100%; transition: transform 1.1s var(--ease); }
.about-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.1s var(--ease); }
.about-gallery .frame:hover img { transform: scale(1.04); }
.about-gallery .frame:hover svg { transform: scale(1.04); }

/* ---------- Contact ---------- */
.contact-list { margin-top: clamp(40px, 7vh, 70px); }
.contact-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: clamp(22px, 4vh, 36px) 6px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.6rem, 4.5vw, 3.2rem);
  font-weight: 550; letter-spacing: -0.03em;
  transition: padding 0.45s var(--ease), color 0.35s var(--ease);
}
.contact-row:first-child { border-top: 1px solid var(--line); }
.contact-row:hover { padding-left: 22px; color: var(--muted); }
.contact-row .go {
  font-size: 0.6em; font-weight: 450;
  transform: translateX(-10px) rotate(45deg);
  opacity: 0.35;
  transition: transform 0.45s var(--ease), opacity 0.45s var(--ease);
}
.contact-row:hover .go { transform: translateX(0) rotate(0deg); opacity: 1; }
.contact-note { margin-top: 40px; color: var(--muted); max-width: 44ch; }

/* ---------- Case study ---------- */
.case-hero {
  padding: clamp(130px, 20vh, 180px) var(--gutter) 0;
  max-width: 720px; margin: 0 auto;
}
.case-hero .kicker {
  font-size: 13px; font-weight: 500;
  color: var(--muted); margin-bottom: 18px; display: block;
}
.case-title {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 600; letter-spacing: -0.025em; line-height: 1.15;
}
.case-intro {
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  font-weight: 450;
}
.case-meta {
  margin-top: clamp(28px, 5vh, 44px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 32px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.case-meta > div { display: grid; gap: 6px; align-content: start; }
@media (max-width: 640px) {
  .case-meta { grid-template-columns: repeat(2, 1fr); }
}
.case-meta dt {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted);
}
.case-meta dd { font-weight: 500; font-size: 14.5px; }
.case-meta a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.3s var(--ease);
}
.case-meta a:hover { color: var(--muted); }

.case-cover {
  margin: clamp(48px, 8vh, 80px) auto 0;
  max-width: 1180px;
  padding: 0 var(--gutter);
}
.case-cover .cover-inner {
  border-radius: var(--radius); overflow: hidden;
  background: var(--card); aspect-ratio: 16 / 8.5;
}
.case-cover svg { width: 100%; height: 100%; }

.case-body {
  padding: clamp(60px, 9vh, 100px) var(--gutter) 0;
  max-width: 720px; margin: 0 auto;
  display: grid; gap: 22px;
  font-size: 16.5px;
}
.case-body h2 {
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  font-weight: 600; letter-spacing: -0.015em;
  margin-top: 30px;
}
.case-body p { font-weight: 450; color: var(--muted); }
.case-body .placeholder-note {
  background: var(--card); border-radius: 14px;
  padding: 18px 22px; color: var(--muted); font-size: 15px;
}

.case-figure {
  margin: 26px calc(-1 * clamp(0px, 12vw, 230px)) 26px;
  border-radius: var(--radius);
  overflow: hidden; background: var(--card);
}
.case-figure svg { width: 100%; height: 100%; aspect-ratio: 16 / 9; }
.case-figure img { width: 100%; height: auto; display: block; }
@media (max-width: 900px) { .case-figure { margin-left: 0; margin-right: 0; } }

figure.case-figure { display: block; }
.case-figure + figcaption, .fig-caption {
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  margin: -12px 0 10px;
}

.cover-inner img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

.case-body ul {
  display: grid; gap: 12px;
  padding-left: 22px;
  list-style: disc;
  color: var(--muted);
  font-weight: 450;
}
.case-body ul li::marker { color: var(--muted); }
.case-body ul strong { color: var(--ink); font-weight: 550; }

.case-body blockquote {
  border-left: 2px solid var(--sel);
  padding: 6px 0 6px 22px;
  margin: 10px 0;
  color: var(--ink);
  font-size: 1.08em;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.case-body .placeholder-note a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Next project (selection-box style) ---------- */
.next-project {
  display: flex; justify-content: center;
  padding: clamp(80px, 14vh, 140px) var(--gutter) clamp(100px, 16vh, 170px);
}
.next-box {
  position: relative;
  display: block;
  border: 1px solid var(--sel);
  padding: clamp(22px, 3.5vw, 36px) clamp(28px, 4.5vw, 48px);
  max-width: 620px;
  transition: transform 0.5s var(--ease);
}
.next-project:hover .next-box { transform: scale(1.015); }
.next-box .handle {
  position: absolute;
  width: 9px; height: 9px;
  background: #fff;
  border: 1px solid var(--sel);
}
.next-box .tl { top: -5px; left: -5px; }
.next-box .tr { top: -5px; right: -5px; }
.next-box .bl { bottom: -5px; left: -5px; }
.next-box .br { bottom: -5px; right: -5px; }
.next-box .fig-label {
  position: absolute;
  top: -32px; left: -1px;
  font-size: 12px; font-weight: 550;
  background: var(--tag-bg);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.next-box .next-title {
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  font-weight: 600; letter-spacing: -0.025em; line-height: 1.15;
  color: var(--ink);
}

/* ---------- Scrolling page showcase ---------- */
.scroll-frame {
  border-radius: 14px;
  overflow: hidden;
  background: #f0eee8;
}
.scroll-chrome {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px;
}
.scroll-chrome span { width: 11px; height: 11px; border-radius: 50%; background: #d8d4ca; }
.scroll-chrome em {
  font-style: normal;
  margin: 0 auto;
  background: #ffffff; border: 1px solid #dcd9d1; border-radius: 99px;
  font-size: 12.5px; color: #a09b8e;
  padding: 4px 22px;
}
.scroll-viewport { aspect-ratio: 16 / 10; overflow: hidden; }
.scroll-viewport img {
  width: 100%; height: auto; display: block;
  animation: page-scroll 34s ease-in-out infinite alternate;
}
@keyframes page-scroll {
  0%, 4% { transform: translateY(0); }
  96%, 100% { transform: translateY(-87.7%); }
}

/* ---------- Case cover mockup scene ---------- */
.cover-scene {
  width: 100%; height: 100%;
  display: grid; place-items: center;
}
.device-browser {
  width: min(72%, 800px);
  border-radius: 12px; overflow: hidden;
  background: #ffffff;
  box-shadow: 0 34px 90px rgba(20, 24, 32, 0.35);
}
.device-bar { display: flex; gap: 7px; padding: 12px 16px; background: #f0efeb; }
.device-bar span { width: 10px; height: 10px; border-radius: 50%; background: #d6d3ca; }
.device-browser img { width: 100%; height: auto; display: block; }

.cover-inner img.scene { object-position: center; }

/* ---------- Figma-style theme tooltip ---------- */
.theme-toggle { position: relative; }
.theme-tip {
  position: absolute; top: calc(100% + 12px); right: -6px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  background: var(--ink); color: var(--bg);
  padding: 7px 8px 7px 13px;
  border-radius: 8px;
  font-size: 12.5px; font-weight: 550;
  letter-spacing: 0;
  white-space: nowrap;
  opacity: 0; transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.25s var(--ease) 0.2s, transform 0.25s var(--ease) 0.2s;
}
.theme-tip::before {
  content: ""; position: absolute; top: -4px; right: 17px;
  width: 9px; height: 9px; background: var(--ink);
  transform: rotate(45deg); border-radius: 1px;
}
.theme-tip .tip-row { display: flex; align-items: center; gap: 9px; }
.theme-tip .tip-sub { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; opacity: 0.55; }
.theme-tip .tip-sub kbd { width: 16px; height: 16px; font-size: 10px; }
.theme-tip kbd {
  font-family: inherit; font-size: 11px; font-weight: 650;
  display: grid; place-items: center;
  width: 19px; height: 19px; border-radius: 4px;
  background: rgba(128, 128, 128, 0.38);
}
.theme-toggle:hover .theme-tip, .theme-toggle:focus-visible .theme-tip {
  opacity: 1; transform: translateY(0);
}

/* ---------- Cursor chat (press "/") ---------- */
.cursor-chat {
  position: fixed; left: 0; top: 0; z-index: 200;
  display: flex; align-items: center;
  background: var(--sel);
  color: #ffffff;
  padding: 13px 20px;
  border: 1.5px solid rgba(0, 0, 0, 0.22);
  border-radius: 10px 28px 28px 28px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
  will-change: transform;
}
.cursor-chat.show { opacity: 1; }
.cursor-chat input {
  pointer-events: all;
  background: transparent; border: none; outline: none;
  color: #ffffff; font: inherit; font-size: 15.5px;
  width: 130px;
}
.cursor-chat .cc-measure {
  position: absolute;
  visibility: hidden;
  white-space: pre;
  font-size: 15.5px;
}
.cursor-chat input::placeholder { color: rgba(255, 255, 255, 0.72); }
.cursor-chat .cc-msg { font-size: 15.5px; }

/* ---------- williambout-style feed ---------- */
.work.feed { max-width: 1040px; gap: clamp(48px, 7vh, 84px); }
.feed-card { display: block; }
.feed-media {
  border-radius: 16px;
  overflow: hidden;
}
.feed-card:first-of-type .feed-media {
  transform: scale(0.75);
  will-change: transform;
}
.feed-media img {
  width: 100%; height: auto; display: block;
  aspect-ratio: 16 / 9; object-fit: cover;
}
.feed-caption {
  display: flex; align-items: baseline; gap: 12px;
  margin-top: 14px;
  padding: 0 4px;
  font-size: 14px;
}
.feed-caption strong { font-weight: 550; color: var(--ink); }
.feed-caption span { color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .feed-media { transform: none !important; }
}

/* ---------- Whimsy mode: retro, colorful, liquid glass ---------- */
html[data-theme="whimsy"] {
  --bg: #b3adc6;
  --ink: #1b1b18;
  --muted: #57544c;
  --line: rgba(27, 27, 24, 0.16);
  --card: rgba(255, 255, 255, 0.55);
  --card-2: rgba(255, 255, 255, 0.4);
  --sel: #ff6b4a;
  --tag-bg: rgba(255, 255, 255, 0.65);
  --nav-bg: rgba(255, 255, 255, 0.3);
  --chip-line: rgba(42, 35, 80, 0.3);
  --soft-line: rgba(255, 255, 255, 0.6);
  --soft-fill: rgba(255, 255, 255, 0.35);
}
html[data-theme="whimsy"] body {
  background-color: #b3adc6;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.17 0'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>"),
    linear-gradient(180deg,
      #96a3c9 0%,
      #a0a7cb 16%,
      #aca9c7 30%,
      #bcaab4 44%,
      #d0ab97 58%,
      #e4a97d 72%,
      #efa161 86%,
      #f29a4f 100%);
  background-attachment: scroll, fixed;
}
/* liquid glass surfaces */
html[data-theme="whimsy"] .key-nav,
html[data-theme="whimsy"] .theme-toggle,
html[data-theme="whimsy"] .fig-label,
html[data-theme="whimsy"] .view-tag {
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 10px 30px rgba(90, 70, 150, 0.16);
}
html[data-theme="whimsy"] .fig-box {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 16px 44px rgba(90, 70, 150, 0.2);
}
html[data-theme="whimsy"] .fig-box .handle { border-radius: 50%; }
html[data-theme="whimsy"] .feed-media,
html[data-theme="whimsy"] .thumb-wrap,
html[data-theme="whimsy"] .cover-inner,
html[data-theme="whimsy"] .scroll-frame,
html[data-theme="whimsy"] .next-box {
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 18px 50px rgba(90, 70, 150, 0.22);
}
/* retro type accent */
html[data-theme="whimsy"] .cursor-chat {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 30px rgba(90, 70, 150, 0.2);
  color: var(--ink);
}
html[data-theme="whimsy"] .cursor-chat input,
html[data-theme="whimsy"] .cursor-chat .cc-msg { color: var(--ink); }
html[data-theme="whimsy"] .cursor-chat input::placeholder { color: rgba(27, 27, 24, 0.5); }

#whimsyBg {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ---------- Figma embeds (click to load) ---------- */
.figma-embed {
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: var(--card);
  display: grid; place-items: center;
  overflow: hidden;
}
.figma-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.fig-load {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px;
  border-radius: 99px;
  border: 1px solid var(--chip-line);
  color: var(--ink);
  font-size: 14.5px; font-weight: 550;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.fig-load:hover { background: var(--soft-fill); border-color: var(--ink); }

/* ---------- About, inlined on the home page ---------- */
.home-about {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px var(--gutter) clamp(110px, 17vh, 190px);
  scroll-margin-top: 90px;
}
.about-title { margin-bottom: clamp(28px, 4vh, 44px); }
.home-about .bio { margin-top: 0; }
.home-about .about-gallery { margin-top: clamp(40px, 6vh, 64px); }
.work.feed { scroll-margin-top: 90px; }

/* mobile nav: drop the keyboard-shortcut chips (no keyboard on touch) and keep the pill from clipping */
@media (max-width: 560px) {
  .key-nav { max-width: calc(100vw - 24px); }
  .key-nav .key { display: none; }
  .key-nav a { padding: 0 12px; }
}

/* mobile bottom spacing: vh-based paddings get oversized on tall phones */
@media (max-width: 640px) {
  .home-about { padding-bottom: 64px; }
  .work { padding-bottom: 72px; }
}
