/* ----------------------------------------------------------------------- */
/*  Design Tokens & Apple Ease Curves (Default Theme: Dark Mode)            */
/* ----------------------------------------------------------------------- */
:root, [data-theme="dark"] {
  --paper: #0B0C0E;
  --paper-dim: #16181C;
  --card-bg: #1A1C21;
  --ink: #FAFAF6;
  --ink-soft: #9CA3AF;
  --line: #282C34;
  --line-soft: rgba(255, 255, 255, 0.08);
  --chroma: #12B57B;
  --chroma-deep: #0D8F60;
  --coral: #FF5A4E;
  --blue: #3E7BFA;
  --white: #FFFFFF;
  --shadow-card: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-popover: 0 20px 40px -18px rgba(0, 0, 0, 0.6);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Apple Easing Curves & Speeds */
  --apple-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --apple-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --apple-glass-bg: rgba(17, 19, 23, 0.82);
}

[data-theme="light"] {
  --paper: #FAFAF6;
  --paper-dim: #F1EFE7;
  --card-bg: #FFFFFF;
  --ink: #14161A;
  --ink-soft: #5B5E63;
  --line: #E3E1D6;
  --line-soft: rgba(0, 0, 0, 0.08);
  --chroma: #12B57B;
  --chroma-deep: #0D8F60;
  --coral: #FF5A4E;
  --blue: #3E7BFA;
  --white: #FFFFFF;
  --shadow-card: 0 24px 60px -30px rgba(20, 22, 26, 0.35);
  --shadow-popover: 0 20px 40px -18px rgba(20, 22, 26, 0.35);
  --apple-glass-bg: rgba(250, 250, 246, 0.82);
}

/* ----------------------------------------------------------------------- */
/*  Base Resets & Globals                                                   */
/* Custom Minimalist Scrollbar — No background track */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--chroma);
}

/* Firefox scrollbar */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ink) 22%, transparent) transparent;
}

html, body {
  overflow-x: clip;
  width: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s var(--apple-ease), color 0.3s var(--apple-ease);
}

/* ----------------------------------------------------------------------- */
/*  Ambient Foil Background                                                */
/*  Adapted from the supplied animation, rebuilt without remote textures.  */
/* ----------------------------------------------------------------------- */
#foil-background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  opacity: .34;
  transition: opacity .35s var(--apple-ease);
}

[data-theme="light"] #foil-background {
  opacity: .30;
}

/* Keep the working canvas calm and stop the decorative animation entirely. */
body:not(.is-home-view) #foil-background {
  opacity: 0 !important;
}

body:not(.is-home-view) #foil-background > div,
body:not(.is-home-view) #foil-background > div > span,
body:not(.is-home-view) #foil-background > div > span::after {
  animation-play-state: paused;
}

.foil-mark {
  --x: 50vw;
  --size: 48px;
  --duration: 18s;
  --delay: 0s;
  position: absolute;
  top: calc(-1 * var(--size));
  left: var(--x);
  width: var(--size);
  height: var(--size);
  animation: foilFall var(--duration) var(--delay) linear infinite;
  will-change: transform;
}

.foil-mark::after {
  content: "✦";
  display: block;
  width: 100%;
  height: 100%;
  font-family: Georgia, serif;
  font-size: var(--size);
  line-height: 1;
  color: transparent;
  background: linear-gradient(125deg, #effff3 0%, #12b57b 18%, #ffdf68 38%, #77c7ff 58%, #ff8adc 77%, #effff3 100%);
  background-size: 260% 260%;
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 7px rgba(18, 181, 123, .24));
  animation: foilSpin 3.8s ease-in-out infinite alternate, foilShine 8s linear infinite alternate;
}

@keyframes foilFall {
  from { transform: translate3d(0, 0, 0) rotate(-12deg); }
  to { transform: translate3d(6vw, 112vh, 0) rotate(28deg); }
}

@keyframes foilSpin {
  from { transform: rotate(0deg) scale(.72); }
  to { transform: rotate(220deg) scale(1.12); }
}

@keyframes foilShine {
  from { background-position: 0% 0%; }
  to { background-position: 100% 100%; }
}

.foil-mark:nth-child(1) { --x: 3vw; --size: 30px; --duration: 20s; --delay: -12s; }
.foil-mark:nth-child(2) { --x: 10vw; --size: 62px; --duration: 26s; --delay: -4s; }
.foil-mark:nth-child(3) { --x: 17vw; --size: 36px; --duration: 17s; --delay: -9s; }
.foil-mark:nth-child(4) { --x: 24vw; --size: 76px; --duration: 30s; --delay: -21s; }
.foil-mark:nth-child(5) { --x: 31vw; --size: 42px; --duration: 23s; --delay: -16s; }
.foil-mark:nth-child(6) { --x: 39vw; --size: 28px; --duration: 18s; --delay: -6s; }
.foil-mark:nth-child(7) { --x: 46vw; --size: 58px; --duration: 28s; --delay: -25s; }
.foil-mark:nth-child(8) { --x: 53vw; --size: 34px; --duration: 21s; --delay: -14s; }
.foil-mark:nth-child(9) { --x: 61vw; --size: 70px; --duration: 31s; --delay: -10s; }
.foil-mark:nth-child(10) { --x: 68vw; --size: 39px; --duration: 19s; --delay: -17s; }
.foil-mark:nth-child(11) { --x: 75vw; --size: 54px; --duration: 25s; --delay: -2s; }
.foil-mark:nth-child(12) { --x: 82vw; --size: 32px; --duration: 16s; --delay: -11s; }
.foil-mark:nth-child(13) { --x: 90vw; --size: 68px; --duration: 29s; --delay: -19s; }
.foil-mark:nth-child(14) { --x: 96vw; --size: 41px; --duration: 22s; --delay: -7s; }
.foil-mark:nth-child(15) { --x: 7vw; --size: 56px; --duration: 27s; --delay: -24s; }
.foil-mark:nth-child(16) { --x: 35vw; --size: 25px; --duration: 15s; --delay: -5s; }
.foil-mark:nth-child(17) { --x: 57vw; --size: 47px; --duration: 24s; --delay: -20s; }
.foil-mark:nth-child(18) { --x: 87vw; --size: 29px; --duration: 18s; --delay: -13s; }

/* Keep all actual UI above the purely decorative layer. */
.nav-bar,
main#app { position: relative; z-index: 1; }

/* Faithful foil layer: preserve the supplied demo's varied symbols and its
   moving photographic foil texture instead of replacing it with one icon. */
#foil-background { opacity: .72; }
[data-theme="light"] #foil-background { opacity: .62; }
#foil-background > div {
  --size: 5vw;
  --symbol: "✽";
  --pos-x: 0vw;
  --move-duration: 7s;
  --move-delay: 0s;
  --spin-duration: 1.5s;
  --spin-delay: 0s;
  --shine-duration: 10s;
  --hue: 0deg;
  position: absolute;
  top: 0;
  left: 0;
  font: clamp(15px, var(--size), 80px) / 1.2 "Noto Sans Symbols 2", "Segoe UI Symbol", sans-serif;
  transform-origin: center top;
  animation: foil-demo-fall var(--move-duration) var(--move-delay) linear infinite both;
}
#foil-background > div > span {
  display: block;
  transform-origin: center;
  animation: foil-demo-rotate var(--spin-duration) var(--spin-delay) ease-in-out infinite alternate both;
}
#foil-background > div > span::after {
  content: var(--symbol);
  display: block;
  color: transparent;
  -webkit-text-stroke: .5px rgba(0, 0, 0, .20);
  background: url("https://images.unsplash.com/photo-1580822115965-0b2532068eff?ixlib=rb-4.0.3&q=100&w=200&dpr=2") center / 200px auto repeat;
  -webkit-background-clip: text;
  background-clip: text;
  filter: brightness(1.28) saturate(1.45) hue-rotate(var(--hue));
  animation: foil-demo-shine var(--shine-duration) linear infinite alternate both;
}
@keyframes foil-demo-fall { from { transform: translate3d(var(--pos-x), calc(0vh - var(--size)), 0); } to { transform: translate3d(var(--pos-x), 100vh, 0); } }
@keyframes foil-demo-rotate { from { transform: rotate(115deg); } to { transform: rotate(245deg); } }
@keyframes foil-demo-shine { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
#foil-background > div:nth-child(23n + 1) { --symbol:"✽"; } #foil-background > div:nth-child(23n + 2) { --symbol:"❉"; } #foil-background > div:nth-child(23n + 3) { --symbol:"✿"; } #foil-background > div:nth-child(23n + 4) { --symbol:"❈"; } #foil-background > div:nth-child(23n + 5) { --symbol:"✣"; } #foil-background > div:nth-child(23n + 6) { --symbol:"✺"; } #foil-background > div:nth-child(23n + 7) { --symbol:"❂"; } #foil-background > div:nth-child(23n + 8) { --symbol:"♦"; } #foil-background > div:nth-child(23n + 9) { --symbol:"✢"; } #foil-background > div:nth-child(23n + 10) { --symbol:"✵"; } #foil-background > div:nth-child(23n + 11) { --symbol:"✤"; } #foil-background > div:nth-child(23n + 12) { --symbol:"✦"; } #foil-background > div:nth-child(23n + 13) { --symbol:"❇"; } #foil-background > div:nth-child(23n + 14) { --symbol:"✻"; } #foil-background > div:nth-child(23n + 15) { --symbol:"✶"; } #foil-background > div:nth-child(23n + 16) { --symbol:"✳"; } #foil-background > div:nth-child(23n + 17) { --symbol:"❊"; } #foil-background > div:nth-child(23n + 18) { --symbol:"❋"; } #foil-background > div:nth-child(23n + 19) { --symbol:"✷"; } #foil-background > div:nth-child(23n + 20) { --symbol:"✴"; }
#foil-background > div:nth-child(21n + 1) { --pos-x:5vw; } #foil-background > div:nth-child(21n + 2) { --pos-x:10vw; } #foil-background > div:nth-child(21n + 3) { --pos-x:15vw; } #foil-background > div:nth-child(21n + 4) { --pos-x:20vw; } #foil-background > div:nth-child(21n + 5) { --pos-x:25vw; } #foil-background > div:nth-child(21n + 6) { --pos-x:30vw; } #foil-background > div:nth-child(21n + 7) { --pos-x:35vw; } #foil-background > div:nth-child(21n + 8) { --pos-x:40vw; } #foil-background > div:nth-child(21n + 9) { --pos-x:45vw; } #foil-background > div:nth-child(21n + 10) { --pos-x:50vw; } #foil-background > div:nth-child(21n + 11) { --pos-x:55vw; } #foil-background > div:nth-child(21n + 12) { --pos-x:60vw; } #foil-background > div:nth-child(21n + 13) { --pos-x:65vw; } #foil-background > div:nth-child(21n + 14) { --pos-x:70vw; } #foil-background > div:nth-child(21n + 15) { --pos-x:75vw; } #foil-background > div:nth-child(21n + 16) { --pos-x:80vw; } #foil-background > div:nth-child(21n + 17) { --pos-x:85vw; } #foil-background > div:nth-child(21n + 18) { --pos-x:90vw; } #foil-background > div:nth-child(21n + 19) { --pos-x:95vw; } #foil-background > div:nth-child(21n + 20) { --pos-x:100vw; }
#foil-background > div:nth-child(5n + 1) { --size:3vw; } #foil-background > div:nth-child(5n + 2) { --size:4vw; } #foil-background > div:nth-child(5n + 3) { --size:6vw; } #foil-background > div:nth-child(5n + 4) { --size:7vw; }
#foil-background > div:nth-child(9n + 1) { --move-duration:7.5s; } #foil-background > div:nth-child(9n + 2) { --move-duration:8s; } #foil-background > div:nth-child(9n + 3) { --move-duration:8.5s; } #foil-background > div:nth-child(9n + 4) { --move-duration:9s; } #foil-background > div:nth-child(9n + 5) { --move-duration:5.5s; } #foil-background > div:nth-child(9n + 6) { --move-duration:6s; } #foil-background > div:nth-child(9n + 7) { --move-duration:6.5s; } #foil-background > div:nth-child(9n + 8) { --move-duration:7.8s; }
#foil-background > div:nth-child(8n + 1) { --move-delay:-4s; } #foil-background > div:nth-child(8n + 2) { --move-delay:-5s; } #foil-background > div:nth-child(8n + 3) { --move-delay:-6s; } #foil-background > div:nth-child(8n + 4) { --move-delay:-1s; } #foil-background > div:nth-child(8n + 5) { --move-delay:-2s; } #foil-background > div:nth-child(8n + 6) { --move-delay:-3s; } #foil-background > div:nth-child(8n + 7) { --move-delay:-7s; }
#foil-background > div:nth-child(12n + 1) { --hue:30deg; } #foil-background > div:nth-child(12n + 2) { --hue:270deg; } #foil-background > div:nth-child(12n + 3) { --hue:90deg; } #foil-background > div:nth-child(12n + 4) { --hue:150deg; } #foil-background > div:nth-child(12n + 5) { --hue:330deg; } #foil-background > div:nth-child(12n + 6) { --hue:180deg; } #foil-background > div:nth-child(12n + 7) { --hue:60deg; } #foil-background > div:nth-child(12n + 8) { --hue:210deg; } #foil-background > div:nth-child(12n + 9) { --hue:120deg; } #foil-background > div:nth-child(12n + 10) { --hue:240deg; } #foil-background > div:nth-child(12n + 11) { --hue:300deg; }
#foil-background > div:nth-child(even) > span::after { animation-name: foil-demo-shine-reverse; }
@keyframes foil-demo-shine-reverse { from { background-position:100% 0%; } to { background-position:0% 100%; } }

/* The supplied demo's paper photo, integrated as a subtle surface texture.
   Dark mode keeps the same fibre/grain but tints it into charcoal. */
body {
  background-image: linear-gradient(rgba(250, 250, 246, .16), rgba(250, 250, 246, .16)), url("https://images.unsplash.com/photo-1615800098779-1be32e60cca3?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.0.3&q=85");
  background-size: auto, cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-blend-mode: normal;
}
[data-theme="dark"] body {
  /* A dark-native paper surface: subtle charcoal variation plus seamless grain. */
  background-color: #0B0C0E;
  background-image:
    radial-gradient(ellipse at 16% -12%, rgba(57, 63, 69, .26), transparent 52%),
    radial-gradient(circle at 88% 88%, rgba(11, 96, 68, .10), transparent 46%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  background-size: auto, auto, 180px 180px;
  background-repeat: no-repeat, no-repeat, repeat;
  background-blend-mode: normal;
}

/* Keep light-mode editing calm while retaining the tactile landing page. */
[data-theme="light"] body:not(.is-home-view) {
  background-image: linear-gradient(rgba(250, 250, 246, .80), rgba(250, 250, 246, .80)), url("https://images.unsplash.com/photo-1615800098779-1be32e60cca3?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.0.3&q=85");
}

/* Charcoal-paper dark theme: persistent controls use related, lifted surfaces
   rather than the old near-black panels. */
[data-theme="dark"] .nav-bar {
  background: rgba(27, 32, 32, .88);
  border-bottom-color: rgba(224, 239, 232, .09);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .025), 0 12px 36px rgba(0, 0, 0, .16);
}
[data-theme="dark"] .theme-toggle-btn {
  background: rgba(46, 52, 52, .72);
  border-color: rgba(224, 239, 232, .10);
}
[data-theme="dark"] .cut-corner {
  background: linear-gradient(145deg, rgba(31, 37, 38, .98), rgba(22, 27, 29, .98));
  border-color: rgba(224, 239, 232, .11);
  box-shadow: 0 26px 64px -26px rgba(0, 0, 0, .88), inset 0 1px 0 rgba(255, 255, 255, .08);
}
[data-theme="dark"] .dropzone-lg {
  background: rgba(7, 10, 11, .20);
  border-color: rgba(224, 239, 232, .12);
}

main#app {
  flex: 1;
  display: flex;
  flex-direction: column;
}

button, input, a {
  font-family: inherit;
}

button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--chroma);
  outline-offset: 2px;
}

input[type="range"] {
  height: 4px;
}

/* ----------------------------------------------------------------------- */
/*  Apple-styled Motion & Animations                                       */
/* ----------------------------------------------------------------------- */
@keyframes floatUp {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes scanMove {
  0% { top: 4%; }
  50% { top: 92%; }
  100% { top: 4%; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes applePopoverIn {
  0% { opacity: 0; transform: scale(0.94) translateY(-8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.hero-anim {
  animation: floatUp .75s var(--apple-ease) both;
}

.hero-anim.d2 {
  animation-delay: .09s;
}

.hero-anim.d3 {
  animation-delay: .18s;
}

.float-card {
  animation: bob 5s ease-in-out infinite;
}

.spin {
  animation: spin 0.9s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .hero-anim, .float-card, .scan-beam, .popover {
    animation: none !important;
  }
  .scan-beam {
    top: 50% !important;
  }
}

/* ----------------------------------------------------------------------- */
/*  Navigation Bar — Apple Glassmorphism                                    */
/* ----------------------------------------------------------------------- */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 36px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--apple-glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  transition: background 0.3s var(--apple-ease), border-color 0.3s var(--apple-ease);
}

.brand-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s var(--apple-ease);
}

.brand-btn:hover {
  transform: scale(1.03);
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: var(--ink);
  clip-path: polygon(0 0, 70% 0, 100% 30%, 100% 100%, 0 100%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  transition: background 0.3s var(--apple-ease), transform 0.3s var(--apple-ease-spring);
}

.brand-btn:hover .logo-icon {
  transform: rotate(-4deg) scale(1.05);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo-dot {
  width: 10px;
  height: 10px;
  background: var(--chroma);
  margin: 2px;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--ink);
  transition: color 0.3s var(--apple-ease);
}

.nav-links {
  display: flex;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink-soft);
}

.nav-links a {
  color: inherit;
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 999px;
  transition: color 0.2s var(--apple-ease), background 0.2s var(--apple-ease), transform 0.2s var(--apple-ease-spring);
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--line-soft);
  transform: translateY(-1px);
}

.auth-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Theme Toggle Control — Apple Spring Press */
.theme-toggle-btn {
  position: relative;
  width: 72px;
  height: 32px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(14, 58, 75, .24);
  border-radius: 999px;
  background: linear-gradient(160deg, #7fc4d6 0%, #5099b0 45%, #2f6f88 100%);
  cursor: pointer;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.25), inset 0 -1px 2px rgba(255,255,255,.16), 0 3px 8px rgba(0,0,0,.16);
  transition: transform .25s var(--apple-ease-spring), background .45s ease, box-shadow .25s ease;
}

.theme-toggle-btn:hover {
  transform: scale(1.05);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.25), inset 0 -1px 2px rgba(255,255,255,.16), 0 6px 15px rgba(0,0,0,.22);
}

.theme-toggle-btn:active {
  transform: scale(.95);
}

.theme-switch-knob {
  position: absolute;
  z-index: 2;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff9d6 0%, #ffe066 36%, #ffc93d 72%, #e8a51f 100%);
  box-shadow: 0 0 8px 2px rgba(255, 217, 61, .58), inset -2px -2px 4px rgba(200, 140, 0, .25), inset 2px 2px 4px rgba(255,255,255,.5);
  transition: left .48s var(--apple-ease-spring), background .45s ease, box-shadow .35s ease;
}

.theme-switch-stars,
.theme-switch-clouds {
  position: absolute;
  inset: 0;
  transition: opacity .45s ease;
}

.theme-switch-stars {
  opacity: 0;
  background:
    radial-gradient(circle at 44% 28%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 68% 57%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 85% 25%, #fff 0 .8px, transparent 1.3px),
    radial-gradient(circle at 51% 76%, #fff 0 .8px, transparent 1.3px);
}

.theme-switch-clouds { opacity: 1; }
.theme-switch-clouds i {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  transition: transform .35s ease;
}
.theme-switch-clouds i:nth-child(1) { top: 7px; left: 34px; width: 15px; height: 6px; opacity: .62; }
.theme-switch-clouds i:nth-child(2) { top: 15px; left: 45px; width: 20px; height: 7px; opacity: .84; }
.theme-switch-clouds i:nth-child(3) { top: 22px; left: 34px; width: 22px; height: 7px; }
.theme-toggle-btn:hover .theme-switch-clouds i:nth-child(odd) { transform: translateX(2px); }
.theme-toggle-btn:hover .theme-switch-clouds i:nth-child(even) { transform: translateX(-2px); }

.theme-toggle-btn.is-dark,
[data-theme="dark"] .theme-toggle-btn {
  border-color: rgba(208, 218, 244, .2);
  background: linear-gradient(160deg, #27365e 0%, #151d38 52%, #090d1a 100%);
}
.theme-toggle-btn.is-dark .theme-switch-knob { left: 45px; background: radial-gradient(circle at 32% 28%, #fdfbf0 0%, #f2ecd6 38%, #ddd4b8 72%, #c4b998 100%); box-shadow: 0 0 8px 2px rgba(220,210,180,.4), inset -2px -2px 4px rgba(150,140,110,.28), inset 2px 2px 4px rgba(255,255,255,.5); }
.theme-toggle-btn.is-dark .theme-switch-stars { opacity: 1; }
.theme-toggle-btn.is-dark .theme-switch-clouds { opacity: 0; }

/* ----------------------------------------------------------------------- */
/*  Home View — Centered & Apple Card Elevation                             */
/* ----------------------------------------------------------------------- */
.home-container {
  /* The page colour is on <body>; keeping this transparent reveals the foil layer. */
  background: transparent;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0;
  transition: background 0.3s var(--apple-ease);
}

.hero-section-fold {
  min-height: calc(100vh - 73px);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}

.hero-grid {
  width: 100%;
  max-width: 1320px;
  margin: auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}

.hero-h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(42px, 4.6vw, 72px);
  line-height: 1.03;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0;
  transition: color 0.3s var(--apple-ease);
}

.hero-h1-coral {
  color: var(--coral);
}

.hero-desc {
  font-family: var(--font-body);
  font-size: 18.5px;
  color: var(--ink-soft);
  max-width: 520px;
  margin-top: 22px;
  line-height: 1.55;
  transition: color 0.3s var(--apple-ease);
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.hero-stats strong {
  color: var(--ink);
}

.hero-card-column {
  position: relative;
  width: 100%;
}

.handdrawn-arrow-wrap {
  position: absolute;
  top: -65px;
  right: -230px;
  pointer-events: none;
  z-index: 12;
  filter: none;
  animation: floatArrow 3.5s ease-in-out infinite;
}

@keyframes floatArrow {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(-2deg);
  }
}

/* CutCorner Card Container — Apple Hover Elevation */
.cut-corner {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card), inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
  clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 0 100%);
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  transition: transform 0.35s var(--apple-ease), box-shadow 0.35s var(--apple-ease), background 0.3s var(--apple-ease), border-color 0.3s var(--apple-ease);
}

.cut-corner:hover {
  transform: translateY(-4px) scale(1.004);
  box-shadow: 0 32px 80px -18px rgba(0, 0, 0, 0.85), inset 0 1px 0 0 rgba(255, 255, 255, 0.14);
}

.cut-corner-dashed {
  position: absolute;
  top: 0;
  right: 0;
  width: 45px;
  height: 45px;
  border-top: 2px dashed var(--line);
  transform: rotate(45deg) translate(9.6px, -18px);
  pointer-events: none;
}

.card-inner {
  padding: 48px 40px;
}

/* Expanded Dropzone Hitbox — Taller & Roomier */
.dropzone-lg {
  border: 2px dashed var(--line);
  border-radius: 24px;
  padding: 72px 36px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: border-color 0.25s var(--apple-ease), background 0.25s var(--apple-ease), transform 0.25s var(--apple-ease);
  background: transparent;
}

.dropzone-lg:hover {
  border-color: rgba(18, 181, 123, 0.6);
  background: rgba(18, 181, 123, 0.03);
}

.dropzone-lg.dragover {
  border-color: var(--chroma);
  background: rgba(18, 181, 123, 0.08);
  transform: scale(1.01);
}

.btn-upload-lg {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 23px;
  color: var(--white);
  background: linear-gradient(135deg, #14c787 0%, #0d8f60 100%);
  border: none;
  border-radius: 999px;
  padding: 20px 58px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 16px 42px -6px rgba(18, 181, 123, 0.7);
  transition: transform 0.25s var(--apple-ease-spring), box-shadow 0.25s var(--apple-ease), background 0.25s var(--apple-ease);
}

.btn-upload-lg svg {
  width: 28px;
  height: 28px;
}

.btn-upload-lg:hover {
  transform: translateY(-3px) scale(1.025);
  box-shadow: 0 22px 52px -6px rgba(18, 181, 123, 0.85);
}

.btn-upload-lg:active {
  transform: scale(0.97) translateY(0);
}

.dropzone-hint {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink-soft);
  margin-top: 24px;
  margin-bottom: 20px;
}

.supported-formats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin-top: 4px;
  width: 100%;
}

.format-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.size-limit-text {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  margin-left: 6px;
  white-space: nowrap;
}

.hero-trust-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.hero-trust-line [aria-hidden="true"] { opacity: 0.5; }

.btn-url {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 18px;
  cursor: pointer;
  transition: transform 0.25s var(--apple-ease-spring), background 0.2s var(--apple-ease), border-color 0.2s var(--apple-ease), color 0.2s var(--apple-ease);
}

.btn-url:hover {
  border-color: var(--chroma);
  color: var(--chroma);
  transform: translateY(-1px);
}

.btn-url:active {
  transform: scale(0.96);
}

/* ----------------------------------------------------------------------- */
/*  Demo Showcase Section                                                   */
/* ----------------------------------------------------------------------- */
.demo-section {
  width: 100%;
  max-width: 1180px;
  min-height: calc(100vh - 73px);
  margin: 0 auto;
  padding: 60px 32px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.demo-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.demo-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--chroma);
  background: rgba(18, 181, 123, 0.1);
  border: 1px solid rgba(18, 181, 123, 0.3);
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.demo-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.demo-subtitle {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 580px;
  margin: 0 0 28px;
  line-height: 1.5;
}

/* Category Filter Tabs */
.demo-tabs {
  display: flex;
  gap: 8px;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  padding: 5px;
  border-radius: 999px;
}

.demo-tab-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 8px 24px;
  cursor: pointer;
  transition: all 0.25s var(--apple-ease);
}

.demo-tab-btn:hover {
  color: var(--ink);
}

.demo-tab-btn.active {
  color: var(--white);
  background: var(--chroma);
  box-shadow: 0 4px 14px -2px rgba(18, 181, 123, 0.5);
}

/* Before / After Comparison Card */
.demo-card-wrap {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.demo-comparison-card {
  position: relative;
  width: 100%;
  height: 480px;
  border-radius: 24px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  user-select: none;
  cursor: ew-resize;
  background: var(--card-bg);
}

.demo-image-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Make transparency obvious in the before/after demo, too. */
.demo-after.checker-bg {
  background-color: #eff1ef;
  background-image:
    linear-gradient(45deg, #d9ddda 25%, transparent 25%),
    linear-gradient(-45deg, #d9ddda 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d9ddda 75%),
    linear-gradient(-45deg, transparent 75%, #d9ddda 75%);
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  background-size: 28px 28px;
}

[data-theme="dark"] .demo-after.checker-bg {
  background-color: #202526;
  background-image:
    linear-gradient(45deg, #343b3b 25%, transparent 25%),
    linear-gradient(-45deg, #343b3b 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #343b3b 75%),
    linear-gradient(-45deg, transparent 75%, #343b3b 75%);
}

.demo-image-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.demo-before {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  border-right: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
}

.demo-before img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 860px;
  max-width: none;
  object-fit: cover;
}

.demo-label {
  position: absolute;
  top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  z-index: 5;
}

.demo-label.left {
  left: 16px;
}

.demo-label.right {
  right: 16px;
}

/* Split Handle Knob */
.demo-slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  z-index: 10;
  transform: translateX(-50%);
  pointer-events: none;
}

.demo-handle-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--apple-glass-bg);
  backdrop-filter: blur(16px);
  border: 2px solid var(--white);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s var(--apple-ease-spring);
}

.demo-comparison-card:hover .demo-handle-knob {
  transform: translate(-50%, -50%) scale(1.12);
}
.editor-wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 32px 80px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Header centered to match toolbar and stage */
.editor-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 20px;
  gap: 4px;
  width: 100%;
}

.editor-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--ink);
  margin: 0;
  text-align: center;
}

.editor-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Dynamic Fit-Content Apple Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: 92vw;
  margin: 0 auto 20px;
  background: var(--apple-glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  position: relative;
  z-index: 10;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
  transition: width 0.4s var(--apple-ease),
              max-width 0.4s var(--apple-ease),
              border-radius 0.4s var(--apple-ease),
              padding 0.4s var(--apple-ease),
              background 0.3s var(--apple-ease),
              box-shadow 0.4s var(--apple-ease);
}

.toolbar:hover, .toolbar:focus-within, .toolbar.popover-open {
  width: max-content;
  max-width: 92vw;
  border-radius: 16px;
  padding: 8px 18px;
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
}

/* The global backdrop closes popovers; keep the open toolbar above it so the
   controls inside the popover remain clickable. */
.toolbar.popover-open { z-index: 50; }

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 4px;
}

.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: padding 0.35s var(--apple-ease),
              background 0.2s var(--apple-ease),
              color 0.2s var(--apple-ease),
              border-color 0.2s var(--apple-ease),
              transform 0.2s var(--apple-ease-spring);
}

.toolbar:hover .tool-btn,
.toolbar:focus-within .tool-btn,
.toolbar.popover-open .tool-btn {
  padding: 8px 12px;
}

.tool-btn .btn-label {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  margin-left: 0;
  transition: max-width 0.4s var(--apple-ease),
              opacity 0.3s var(--apple-ease),
              margin-left 0.4s var(--apple-ease);
}

.toolbar:hover .tool-btn .btn-label,
.toolbar:focus-within .tool-btn .btn-label,
.toolbar.popover-open .tool-btn .btn-label {
  max-width: 170px;
  opacity: 1;
  margin-left: 6px;
}

.tool-btn .btn-label-always {
  margin-left: 6px;
}

.tool-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

[data-theme="light"] .tool-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.05);
}

.tool-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.tool-btn.active {
  color: var(--chroma);
  background: rgba(18, 181, 123, 0.14);
  border-color: rgba(18, 181, 123, 0.4);
}

/* Primary Download button always retains vibrant green + crisp white text in Light & Dark mode */
.tool-btn.primary,
[data-theme="light"] .tool-btn.primary {
  color: #FFFFFF !important;
  background: linear-gradient(135deg, #14c787 0%, #0d8f60 100%) !important;
  border: none;
  box-shadow: 0 6px 18px -4px rgba(18, 181, 123, 0.5);
  padding: 8px 16px;
}

.tool-btn.primary:hover:not(:disabled),
[data-theme="light"] .tool-btn.primary:hover:not(:disabled) {
  color: #FFFFFF !important;
  background: linear-gradient(135deg, #16db95 0%, #0fa670 100%) !important;
  box-shadow: 0 12px 24px -4px rgba(18, 181, 123, 0.7);
  transform: translateY(-2px) scale(1.02);
}

.tool-btn:disabled {
  color: var(--ink-soft);
  cursor: not-allowed;
  opacity: 0.45;
  background: transparent;
  border-color: transparent;
}

.tool-btn.primary:disabled {
  background: var(--line) !important;
  color: var(--ink-soft) !important;
  box-shadow: none;
}

/* Popover Element — Apple Glass Entrance */
.popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 39;
}

.popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 240px;
  background: var(--apple-glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-popover), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  padding: 16px;
  z-index: 40;
  animation: applePopoverIn 0.25s var(--apple-ease) forwards;
}

.popover.chroma-popover {
  width: 252px;
}

[data-theme="light"] .popover { background: rgba(250, 250, 246, 0.98); }
[data-theme="dark"] .popover { background: rgba(24, 29, 30, 0.98); }
[data-theme="dark"] .toolbar {
  background: rgba(24, 29, 30, 0.98);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.popover-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin: 0 0 10px;
}

.popover-desc {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0 0 12px;
  line-height: 1.5;
}

/* Swatches — Apple Squircular Tokens */
.swatch-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.swatch-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 2px solid var(--line);
  cursor: pointer;
  transition: transform 0.2s var(--apple-ease-spring), border-color 0.2s var(--apple-ease), box-shadow 0.2s var(--apple-ease);
}

.swatch-btn:hover {
  transform: scale(1.14);
  border-color: var(--chroma);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.swatch-btn:active {
  transform: scale(0.94);
}

.swatch-btn.active {
  border-color: var(--chroma);
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(18, 181, 123, 0.5);
}

.swatch-transparent {
  background-image:
    linear-gradient(45deg, #ddd 25%, transparent 25%),
    linear-gradient(-45deg, #ddd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ddd 75%),
    linear-gradient(-45deg, transparent 75%, #ddd 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
}

.custom-color-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
}

.color-input {
  width: 34px;
  height: 26px;
  border: none;
  background: none;
  cursor: pointer;
}

.hex-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}

/* Chroma Controls */
.btn-pipette {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: transform 0.2s var(--apple-ease-spring), background 0.2s var(--apple-ease), border-color 0.2s var(--apple-ease);
}

.btn-pipette:hover {
  border-color: var(--chroma);
  transform: translateY(-1px);
}

.btn-pipette.picking {
  color: var(--white);
  background: var(--chroma);
  border-color: var(--chroma);
}

.chroma-swatch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.chroma-swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.range-label {
  display: block;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--ink);
  margin-bottom: 6px;
}

.range-slider {
  width: 100%;
  accent-color: var(--chroma);
}

.btn-clear-chroma {
  margin-top: 10px;
  width: 100%;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--coral);
  background: transparent;
  border: 1px solid rgba(255, 90, 78, 0.33);
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
  transition: background 0.2s var(--apple-ease), transform 0.2s var(--apple-ease-spring);
}

.btn-clear-chroma:hover {
  background: rgba(255, 90, 78, 0.1);
  transform: translateY(-1px);
}

/* ----------------------------------------------------------------------- */
/*  Crop Panel — Segmented Controls                                         */
/* ----------------------------------------------------------------------- */
.crop-panel {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: applePopoverIn 0.25s var(--apple-ease) forwards;
}

.crop-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.ratio-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ratio-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

.ratio-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 6px 11px;
  cursor: pointer;
  transition: transform 0.2s var(--apple-ease-spring), background 0.2s var(--apple-ease), border-color 0.2s var(--apple-ease), color 0.2s var(--apple-ease);
}

.ratio-btn:hover {
  border-color: var(--chroma);
  transform: translateY(-1px);
}

.ratio-btn:active {
  transform: scale(0.95);
}

.ratio-btn.active {
  color: var(--white);
  background: var(--chroma);
  border-color: var(--chroma);
  box-shadow: 0 4px 12px -2px rgba(18, 181, 123, 0.5);
}

.selection-info {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}

.align-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--line-soft);
}

.align-btn-group {
  display: flex;
  align-items: center;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px;
  gap: 2px;
}

.align-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 99px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s var(--apple-ease), color 0.2s var(--apple-ease), transform 0.2s var(--apple-ease-spring);
}

.align-btn:hover {
  color: var(--chroma);
  background: color-mix(in srgb, var(--chroma) 15%, transparent);
  transform: scale(1.06);
}

.align-btn:active {
  transform: scale(0.95);
}

.toggle-exact-btn {
  font-size: 11.5px;
  color: var(--ink-soft);
}

.toggle-exact-btn.active {
  color: var(--white);
  background: var(--chroma);
  border-color: var(--chroma);
}

.exact-size-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px 8px;
  animation: popoverFadeIn 0.2s var(--apple-ease) both;
}

.crop-panel-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.exact-size-label {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.exact-size-input {
  width: 64px;
  font-family: var(--font-mono);
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  background: var(--card-bg);
  color: var(--ink);
  transition: border-color 0.2s var(--apple-ease);
}

.exact-size-input:focus {
  border-color: var(--chroma);
}

.btn-apply-size {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: transform 0.2s var(--apple-ease-spring), border-color 0.2s var(--apple-ease);
}

.btn-apply-size:hover {
  border-color: var(--chroma);
  transform: translateY(-1px);
}

.btn-cancel-crop {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.2s var(--apple-ease), transform 0.2s var(--apple-ease-spring);
}

.btn-cancel-crop:hover {
  background: var(--line-soft);
  transform: translateY(-1px);
}

.btn-confirm-crop {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, #14c787 0%, #0d8f60 100%);
  border: none;
  border-radius: 10px;
  padding: 7px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 6px 18px -4px rgba(18, 181, 123, 0.5);
  transition: transform 0.25s var(--apple-ease-spring), box-shadow 0.25s var(--apple-ease);
}

.btn-confirm-crop:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 24px -4px rgba(18, 181, 123, 0.7);
}

/* ----------------------------------------------------------------------- */
/*  Stage & Canvas — Tighter Drop Shadow & Clean Bounds                    */
/* ----------------------------------------------------------------------- */
.stage {
  border-radius: 20px;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 36px 20px;
  position: relative;
  overflow: visible;
  background: transparent;
  border: none;
}

.stage-wrapper {
  position: relative;
  display: inline-block;
  line-height: 0;
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s var(--apple-ease), box-shadow 0.3s var(--apple-ease);
}

/* Two candidate cutouts. Editing begins only after one is explicitly selected. */
.dual-output-view { width:min(920px,100%); display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:stretch; }
.dual-choice-prompt { grid-column:1 / -1; text-align:center; margin:-2px 0 7px; animation:dualPromptIn .35s var(--apple-ease) both; }.dual-choice-prompt span { color:var(--chroma); font:10px var(--font-mono); letter-spacing:.09em; }.dual-choice-prompt h3 { margin:7px 0 5px; color:var(--ink); font:600 clamp(24px,3vw,34px)/1 var(--font-body); letter-spacing:-.045em; }.dual-choice-prompt p { margin:0; color:var(--ink-soft); font-size:13px; }
.dual-output-card { min-width:0; padding:12px; border:1px solid var(--border); border-radius:12px; background:var(--surface); transition:opacity .42s var(--apple-ease),filter .42s var(--apple-ease),border-color .32s var(--apple-ease),box-shadow .42s var(--apple-ease),transform .42s var(--apple-ease); will-change:opacity,filter,transform; }
.dual-output-card.ready { cursor:pointer; opacity:.7; filter:grayscale(.62) brightness(.82); }.dual-output-card.ready:hover, .dual-output-card.ready:focus-visible { opacity:1; filter:grayscale(0) brightness(1); transform:translateY(-2px); border-color:rgba(255,255,255,.56); box-shadow:0 16px 30px -20px rgba(255,255,255,.26),0 18px 30px -24px rgba(0,0,0,.7); }
.dual-output-card.selected { border:2px solid var(--chroma); box-shadow:0 0 0 3px color-mix(in srgb,var(--chroma) 16%,transparent); }
.dual-output-card.selected { cursor:default; pointer-events:none; }
.dual-output-card.ready:focus-visible { outline:2px solid var(--chroma); outline-offset:3px; }
.dual-output-card.dimmed { opacity:.43; filter:grayscale(.55); }
.dual-output-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin:1px 1px 10px; font-family:var(--font-mono); font-size:10px; letter-spacing:.06em; }
.dual-output-state { color:var(--ink-soft); font-size:9px; }.dual-output-state.ready { color:var(--chroma); }
.dual-output-preview { aspect-ratio:var(--output-aspect, 1 / 1); display:grid; place-items:center; position:relative; overflow:hidden; border-radius:9px; background:repeating-conic-gradient(#20262a 0 25%,#181d20 0 50%) 0/20px 20px; }
.dual-output-preview img { width:100%; height:100%; object-fit:contain; display:block; }.dual-output-card.loading .dual-output-preview img { filter:blur(1px) saturate(.55); opacity:.46; }
.dual-output-loader { position:absolute; display:grid; place-items:center; gap:8px; text-align:center; color:var(--text-primary); font-size:12px; }.dual-output-loader .spin { width:26px; height:26px; }
.dual-output-select { width:max-content; margin:12px 0 0; min-height:38px; padding:8px 14px; border:1px solid var(--white); border-radius:999px; background:var(--white); color:#14161A; font:700 12px var(--font-body); letter-spacing:.01em; pointer-events:none; box-shadow:0 5px 15px rgba(0,0,0,.12); transition:background .2s var(--apple-ease),color .2s var(--apple-ease),border-color .2s var(--apple-ease),box-shadow .2s var(--apple-ease); }.dual-output-card.ready:hover .dual-output-select, .dual-output-card.ready:focus-visible .dual-output-select { color:#062017; background:var(--chroma); border-color:var(--chroma); box-shadow:0 6px 16px rgba(0,0,0,.24); }.dual-output-select:disabled { color:var(--ink-soft); background:transparent; border-color:var(--border); box-shadow:none; }
.dual-output-view.is-resolving .dual-output-card { opacity:0; transform:translateY(10px) scale(.98); pointer-events:none; }.dual-output-view.is-resolving .dual-output-card.is-chosen { opacity:1; border-color:var(--chroma); transform:scale(1.015); }.dual-output-view.is-resolving .dual-choice-prompt { opacity:0; transform:translateY(-8px); }
.editor-head, .toolbar, .thumbnails-strip { transition:opacity .32s var(--apple-ease), transform .36s var(--apple-ease), max-height .36s var(--apple-ease), margin .36s var(--apple-ease), padding .36s var(--apple-ease); }
.editor-wrap.is-choosing-output .editor-head, .editor-wrap.is-choosing-output .toolbar, .editor-wrap.is-choosing-output .thumbnails-strip { max-height:0; margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; opacity:0; overflow:hidden; pointer-events:none; transform:translateY(-14px); }
.toolbar.selection-locked { opacity:.42; filter:grayscale(1); pointer-events:none; transition:opacity .2s var(--apple-ease),filter .2s var(--apple-ease); }
.stage-wrapper { animation:editorStageIn .32s var(--apple-ease) both; }
@keyframes dualPromptIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes editorStageIn { from { opacity:0; transform:translateY(10px) scale(.985); } to { opacity:1; transform:none; } }
::view-transition-old(root) { animation:cutoutChooserOut .18s ease-out both; }
::view-transition-new(root) { animation:cutoutEditorIn .36s var(--apple-ease) both; }
@keyframes cutoutChooserOut { to { opacity:0; filter:blur(2px); } }
@keyframes cutoutEditorIn { from { opacity:0; transform:translateY(10px) scale(.99); } to { opacity:1; transform:none; } }
@media (max-width:680px) { .dual-output-view { grid-template-columns:1fr; } }

[data-theme="light"] .stage-wrapper {
  box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.12);
}

/* Checkerboard backdrop shrink-wrapped directly around stage-wrapper */
.stage-wrapper.checker-bg {
  background-color: var(--card-bg);
  background-image:
    linear-gradient(45deg, var(--line-soft) 25%, transparent 25%),
    linear-gradient(-45deg, var(--line-soft) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--line-soft) 75%),
    linear-gradient(-45deg, transparent 75%, var(--line-soft) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0px;
}

.stage-img {
  display: block;
  max-width: 100%;
  max-height: min(60vh, 540px);
  border-radius: 13px;
}

.stage-img.shadow {
  box-shadow: none;
}

.stage-img.crosshair {
  cursor: crosshair;
}

.chroma-pick-hint {
  position: absolute;
  z-index: 8;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(18, 181, 123, .45);
  border-radius: 999px;
  background: rgba(13, 143, 96, .94);
  color: #fff;
  font: 600 12px var(--font-body);
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(13, 143, 96, .24);
}

/* Processing Overlay, Apple Scan Beam & Glow Mesh */
@keyframes appleScan {
  0% {
    top: -10%;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    top: 110%;
    opacity: 0;
  }
}

@keyframes applePulseGlow {
  0%, 100% {
    opacity: 0.35;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.65;
    transform: scale(1.02);
  }
}

@keyframes sparkleRotate {
  0% {
    transform: rotate(0deg) scale(0.95);
  }
  50% {
    transform: rotate(180deg) scale(1.15);
  }
  100% {
    transform: rotate(360deg) scale(0.95);
  }
}

@keyframes textShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.processing-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 12, 14, 0.45);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 13px;
  z-index: 15;
  transition: opacity 0.35s var(--apple-ease);
}

.apple-scan-line {
  position: absolute;
  left: -10%;
  right: -10%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(18, 181, 123, 0.4) 20%, #12B57B 50%, rgba(18, 181, 123, 0.4) 80%, transparent 100%);
  box-shadow: 0 0 20px 4px rgba(18, 181, 123, 0.75), 0 0 40px 12px rgba(18, 181, 123, 0.35);
  animation: appleScan 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.apple-glow-mesh {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 50% 50%, rgba(18, 181, 123, 0.15) 0%, rgba(62, 123, 250, 0.08) 40%, transparent 70%);
  animation: applePulseGlow 3s ease-in-out infinite;
  pointer-events: none;
}

.processing-badge {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
}

.sparkle-icon-lg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--chroma);
  filter: drop-shadow(0 0 16px rgba(18, 181, 123, 0.9));
  animation: sparkleRotate 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.sparkle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--chroma);
  animation: sparkleRotate 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.processing-text {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, var(--ink) 0%, var(--chroma) 45%, var(--ink) 90%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 2.5s linear infinite;
}

/* Crop Overlay & Handles */
.crop-overlay-layer {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  overflow: hidden;
}

.crop-rect-box {
  position: absolute;
  border: 2px dashed var(--chroma);
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.65);
  cursor: move;
}

/* Dimension Badge inside top-left of crop box */
.crop-size-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  line-height: 1.2;
}

.crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  margin-left: -7px;
  background: var(--chroma);
  border: 2px solid var(--white);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 5;
  transition: transform 0.2s var(--apple-ease-spring), background 0.2s var(--apple-ease), box-shadow 0.2s var(--apple-ease);
}

.crop-handle:hover {
  transform: scale(1.35);
  box-shadow: 0 0 14px 2px rgba(18, 181, 123, 0.8);
}

.crop-handle.nw { top: 0%; left: 0%; cursor: nwse-resize; }
.crop-handle.ne { top: 0%; left: 100%; cursor: nesw-resize; }
.crop-handle.sw { top: 100%; left: 0%; cursor: nesw-resize; }
.crop-handle.se { top: 100%; left: 100%; cursor: nwse-resize; }

.crop-handle.n { top: 0%; left: 50%; cursor: ns-resize; }
.crop-handle.s { top: 100%; left: 50%; cursor: ns-resize; }
.crop-handle.w { top: 50%; left: 0%; cursor: ew-resize; }
.crop-handle.e { top: 50%; left: 100%; cursor: ew-resize; }

/* ----------------------------------------------------------------------- */
/*  Thumbnails Strip — Gentle Glow & Generous Vertical Breathing Room      */
/* ----------------------------------------------------------------------- */
.thumbnails-strip {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  margin: 16px auto 0;
  overflow-x: auto;
  padding: 10px 14px 14px;
  width: max-content;
  max-width: 560px;
  position: relative;
  z-index: 10;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.thumbnails-strip::-webkit-scrollbar {
  height: 5px;
}

.thumbnails-strip::-webkit-scrollbar-track {
  background: transparent;
}

.thumbnails-strip::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}

.thumbnails-strip::-webkit-scrollbar-thumb:hover {
  background: var(--chroma);
}

.thumb-add-btn {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  border-radius: 12px;
  border: 1.5px dashed var(--line);
  background: var(--paper-dim);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s var(--apple-ease-spring), border-color 0.2s var(--apple-ease), color 0.2s var(--apple-ease), background 0.2s var(--apple-ease);
}

.thumb-add-btn:hover {
  border-color: var(--chroma);
  color: var(--chroma);
  transform: translateY(-3px) scale(1.05);
  background: rgba(18, 181, 123, 0.06);
}

.thumb-add-btn:disabled,
.thumb-add-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  pointer-events: none;
  border-color: var(--line) !important;
  color: var(--ink-soft) !important;
  background: var(--paper-dim) !important;
  transform: none !important;
}

.thumb-add-btn:active {
  transform: scale(0.96);
}

.thumb-btn {
  flex: 0 0 auto;
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--line);
  padding: 0;
  cursor: pointer;
  background: var(--card-bg);
  transition: transform 0.25s var(--apple-ease-spring), border-color 0.2s var(--apple-ease), box-shadow 0.25s var(--apple-ease);
}

.thumb-btn:hover {
  transform: translateY(-3px) scale(1.05);
  border-color: rgba(18, 181, 123, 0.6);
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.4);
}

.thumb-btn:active {
  transform: scale(0.96);
}

/* Weaker, non-clipping green glow outline for active thumbnail */
.thumb-btn.active {
  border-color: var(--chroma);
  box-shadow: 0 0 6px rgba(18, 181, 123, 0.35);
  transform: scale(1.02);
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-loader-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-done-badge {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--chroma);
  display: flex;
  align-items: center;
  justify-content: center;
}

.limited-warning {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--coral);
  margin-bottom: 10px;
}

/* ----------------------------------------------------------------------- */
/*  How it works + compact legal footer                                    */
/* ----------------------------------------------------------------------- */
.content-zone { position: relative; z-index: 1; width: 100%; margin-top: 0; background: var(--paper); box-shadow: 0 -36px 70px var(--paper); }
.how-it-works-section { width: min(calc(100% - 64px), 1100px); min-height: calc(100vh - 73px); margin: 0 auto; padding: 72px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.how-it-works-head { max-width: 620px; margin: 0 auto 28px; }
.section-eyebrow { margin: 0 0 12px; color: var(--chroma); font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.11em; }
.how-it-works-head h2 { margin: 0 0 10px; color: var(--ink); font-family: var(--font-display); font-size: clamp(28px, 3vw, 40px); letter-spacing: -0.035em; }
.how-it-works-head > p:last-child { margin: 0; color: var(--ink-soft); font-size: 16px; }
.how-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1040px; margin: 0 auto; padding: 0; list-style: none; text-align: left; }
.how-step { min-height: 0; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--card-bg); box-shadow: 0 14px 30px -28px rgba(0, 0, 0, 0.55); overflow: hidden; transition: transform 0.32s var(--apple-ease-spring), border-color 0.25s var(--apple-ease), box-shadow 0.25s var(--apple-ease); }
.how-step:hover { transform: translateY(-7px); border-color: color-mix(in srgb, var(--chroma) 58%, var(--line)); box-shadow: 0 22px 42px -28px rgba(18, 181, 123, 0.52); }
.how-step-media { aspect-ratio: 1.7 / 1; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 11px; background: var(--paper-dim); }
.how-step-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; transition: transform 0.45s var(--apple-ease); }
.how-step:hover .how-step-media img { transform: scale(1.035); }
.how-step-copy { padding: 15px 12px 12px; }
.how-step-copy > span { display: block; margin-bottom: 8px; color: var(--chroma); font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }
.how-step h3 { margin: 0 0 5px; color: var(--ink); font-family: var(--font-display); font-size: 17px; }
.how-step p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.4; }
.faq-section { width: min(calc(100% - 64px), 760px); margin: 84px auto 0; padding: 0 0 96px; }
.faq-head { margin-bottom: 22px; text-align: center; }
.faq-head h2 { margin: 0; color: var(--ink); font-family: var(--font-display); font-size: clamp(26px, 2.7vw, 36px); letter-spacing: -0.035em; }
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-bg);
  padding: 4px 24px;
  transition: background-color 0.25s var(--apple-ease), border-color 0.25s var(--apple-ease), box-shadow 0.25s var(--apple-ease);
}

.faq-item:hover {
  border-color: color-mix(in srgb, var(--chroma) 50%, var(--line));
  background: var(--paper-dim);
  box-shadow: 0 4px 20px -8px rgba(0, 0, 0, 0.25);
}

.faq-item[open] {
  border-color: color-mix(in srgb, var(--chroma) 60%, var(--line));
  background: var(--card-bg);
  box-shadow: 0 8px 28px -10px rgba(0, 0, 0, 0.35);
}

.faq-item summary {
  position: relative;
  padding: 18px 36px 18px 0;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 650;
  list-style: none;
  transition: color 0.2s var(--apple-ease);
}

.faq-item summary:hover,
.faq-item[open] summary {
  color: var(--chroma);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  position: absolute;
  top: 16px;
  right: 0;
  content: "+";
  color: var(--chroma);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 400;
  transition: transform 0.25s var(--apple-ease-spring);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  max-width: 680px;
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.6;
}
.site-footer { width: 100%; padding: 30px 32px 36px; border-top: 1px solid var(--line); }
.footer-inner, .footer-disclosures { width: min(100%, 1100px); margin: 0 auto; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-brand { margin: 0; color: var(--ink); font-family: var(--font-display); font-size: 14px; font-weight: 800; letter-spacing: -0.04em; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--ink-soft); font-family: var(--font-body); font-size: 13px; text-decoration: none; transition: color 0.2s var(--apple-ease); }
.footer-links a:hover { color: var(--chroma); }
.footer-disclosures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 26px;
}

.footer-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  transition: border-color 0.25s var(--apple-ease), box-shadow 0.25s var(--apple-ease);
}

.footer-card:hover {
  border-color: color-mix(in srgb, var(--chroma) 45%, var(--line));
  box-shadow: 0 6px 22px -10px rgba(0, 0, 0, 0.3);
}

.footer-card h4 {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}

.footer-card p {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}

/* ----------------------------------------------------------------------- */
/*  Responsive Adjustments — Mobile & Tablet Perfection                     */
/* ----------------------------------------------------------------------- */
@media (max-width: 1350px) {
  .handdrawn-arrow-wrap {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .hero-section-fold {
    min-height: auto;
    padding: 32px 20px 48px;
  }
  .hero-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 32px;
    width: 100%;
    max-width: 100%;
  }
  .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }
  .hero-h1 {
    text-align: center;
    width: 100%;
    font-size: clamp(32px, 7.8vw, 54px);
  }
  .hero-desc {
    text-align: center;
    margin: 16px auto 0;
    max-width: 520px;
    font-size: 16.5px;
  }
  .hero-trust-line {
    justify-content: center;
    width: 100%;
  }
  .hero-card-column,
  .hero-card-wrap {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
  }
  .cut-corner {
    width: 100%;
  }
  .hide-mobile {
    display: none !important;
  }
  .how-steps,
  .footer-disclosures {
    grid-template-columns: 1fr;
  }
  .demo-comparison-card {
    max-height: 440px;
  }
}

@media (max-width: 768px) {
  .nav-bar {
    padding: 12px 18px;
    width: 100%;
  }
  .nav-links {
    display: none !important;
  }
}

@media (max-width: 620px) {
  .logo-text {
    font-size: 19px;
  }
  .how-it-works-section,
  .faq-section {
    width: min(calc(100% - 32px), 1100px);
  }
  .how-it-works-section {
    min-height: auto;
    padding: 48px 0;
  }
  .faq-section {
    margin-top: 48px;
    padding-bottom: 60px;
  }
  .how-step {
    min-height: auto;
  }
  .footer-inner {
    align-items: center;
    text-align: center;
    flex-direction: column;
    gap: 10px;
  }
  .site-footer {
    padding: 24px 16px 36px;
  }

.tool-panel {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 860px;
  box-shadow: var(--shadow-popover);
  animation: applePopoverIn 0.25s var(--apple-ease) forwards;
}

.tool-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.tool-panel-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.chroma-controls-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.chroma-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 6px 12px !important;
    border-radius: 999px !important;
    margin: 0 0 16px !important;
  }

  .toolbar::-webkit-scrollbar {
    display: none;
  }

  .tool-btn {
    font-size: 12px !important;
    padding: 6px 10px !important;
    flex-shrink: 0 !important;
  }

  .tool-btn .btn-label-always {
    display: inline-block !important;
    margin-left: 5px !important;
    font-size: 12px !important;
  }

  .tool-panel-body {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .btn-pipette {
    width: 100% !important;
    margin-bottom: 8px !important;
  }

  .chroma-controls-wrap {
    width: 100% !important;
    justify-content: space-between !important;
  }
}
  .demo-section {
    padding: 40px 16px 60px;
    min-height: auto;
  }
  .demo-comparison-card {
    max-height: 340px;
  }
}
