:root {
  color-scheme: dark;
  --ink: #070806;
  --surface: #11130f;
  --paper: #f4efe5;
  --muted: #bdb5a7;
  --sage: #809277;
  --clay: #aa6854;
  --steel: #99acb1;
  --line: rgba(244, 239, 229, 0.16);
  font-family: Geist, "SF Pro Display", "Aptos", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(128, 146, 119, 0.24), transparent 24rem),
    linear-gradient(180deg, #151711, #050604);
  color: var(--paper);
}

button,
a {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid #e3c879;
  outline-offset: 3px;
}

.page-shell {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}

.phone-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: min(920px, calc(100svh - 2rem));
  overflow: hidden;
  border: 1px solid rgba(244, 239, 229, 0.18);
  border-radius: 42px;
  background:
    radial-gradient(circle at 24% 16%, rgba(170, 104, 84, 0.24), transparent 13rem),
    radial-gradient(circle at 78% 12%, rgba(153, 172, 177, 0.22), transparent 12rem),
    #080906;
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.46);
  padding: max(0.8rem, env(safe-area-inset-top)) 1rem max(7.8rem, calc(7rem + env(safe-area-inset-bottom)));
}

.phone-shell::before {
  position: absolute;
  top: 0.55rem;
  left: 50%;
  z-index: 5;
  width: 7.2rem;
  height: 1.65rem;
  border-radius: 999px;
  background: #050604;
  content: "";
  transform: translateX(-50%);
}

.status-bar,
.mobile-header {
  position: relative;
  z-index: 8;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0.55rem 1rem;
  color: var(--paper);
  font-size: 0.82rem;
  font-weight: 800;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.signal,
.wifi,
.battery {
  display: inline-block;
  border: 1px solid currentColor;
}

.signal {
  width: 1rem;
  height: 0.65rem;
  border-top: 0;
  border-left: 0;
  transform: skewX(-12deg);
}

.wifi {
  width: 0.8rem;
  height: 0.8rem;
  border-right: 0;
  border-bottom: 0;
  border-radius: 100% 0 0;
  transform: rotate(45deg);
}

.battery {
  width: 1.35rem;
  height: 0.66rem;
  border-radius: 3px;
  background: linear-gradient(90deg, currentColor 68%, transparent 68%);
}

.mobile-header {
  display: grid;
  grid-template-columns: 2.8rem 1fr 2.8rem;
  gap: 0.8rem;
  align-items: center;
}

.icon-button {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
  background: rgba(244, 239, 229, 0.1);
  color: var(--paper);
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: #e3c879;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 6.4vw, 1.82rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.home-panel {
  position: relative;
  z-index: 2;
}

.stack-section {
  margin-top: 0.9rem;
  --ambient-core: rgba(128, 146, 119, 0.56);
  --ambient-soft: rgba(128, 146, 119, 0.28);
  --ambient-line: rgba(128, 146, 119, 0.38);
  isolation: isolate;
  padding-bottom: 6.4rem;
}

.ambient-glow {
  position: absolute;
  inset: -6rem -4rem 4rem -4rem;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 48% 34%, var(--ambient-core), transparent 13rem),
    radial-gradient(circle at 54% 24%, var(--ambient-soft), transparent 20rem);
  filter: blur(34px) saturate(1.24);
  opacity: 0.92;
  transform: translateZ(0);
}

.card-stack {
  position: relative;
  height: min(96vw, 406px);
  max-height: 406px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.stack-card {
  position: absolute;
  inset: 0.2rem 1.35rem auto 0.2rem;
  height: min(91vw, 386px);
  transform-origin: 50% 100%;
  transition: transform 280ms ease, filter 280ms ease, opacity 280ms ease;
  will-change: transform;
}

.stack-card::before {
  position: absolute;
  inset: -2.4rem;
  z-index: -1;
  border-radius: 46px;
  background:
    radial-gradient(circle at 50% 36%, var(--ambient-core), transparent 58%),
    radial-gradient(circle at 42% 80%, var(--ambient-soft), transparent 68%);
  content: "";
  filter: blur(28px) saturate(1.25);
  opacity: 0.82;
  transform: translateZ(0);
  transition: opacity 320ms ease;
}

.slot-0 {
  z-index: 4;
  cursor: grab;
}

.slot-0:active {
  cursor: grabbing;
}

.slot-1 {
  z-index: 3;
}

.slot-2 {
  z-index: 2;
}

.slot-1::before {
  opacity: 0.36;
}

.slot-2::before {
  opacity: 0.22;
}

.card-face {
  position: relative;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--ambient-line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow:
    0 0 74px var(--ambient-soft),
    0 28px 70px rgba(0, 0, 0, 0.36);
}

.card-face img {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  pointer-events: none;
}

.slot-0:hover .card-face img {
  transform: none;
}

.card-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 6, 4, 0.12), rgba(5, 6, 4, 0.88)),
    radial-gradient(circle at 24% 18%, rgba(244, 239, 229, 0.28), transparent 12rem);
}

.card-face.sage .card-scrim {
  background:
    linear-gradient(180deg, rgba(5, 6, 4, 0.08), rgba(5, 6, 4, 0.88)),
    radial-gradient(circle at 24% 18%, rgba(128, 146, 119, 0.56), transparent 12rem);
}

.card-face.clay .card-scrim {
  background:
    linear-gradient(180deg, rgba(5, 6, 4, 0.08), rgba(5, 6, 4, 0.9)),
    radial-gradient(circle at 30% 16%, rgba(170, 104, 84, 0.62), transparent 12rem);
}

.card-face.steel .card-scrim {
  background:
    linear-gradient(180deg, rgba(5, 6, 4, 0.1), rgba(5, 6, 4, 0.88)),
    radial-gradient(circle at 28% 18%, rgba(153, 172, 177, 0.52), transparent 12rem);
}

.card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 1.25rem;
}

.card-face .card-scrim {
  background: linear-gradient(180deg, rgba(0,0,0,.65) 0%, transparent 28%, transparent 46%, rgba(0,0,0,.76) 68%, rgba(0,0,0,.88) 100%);
}
.card-face .painting-guides { opacity: .75; }
.card-face.blue img { width: 120%; height: 120%; inset: -10%; }
.card-content .card-metric { font-size: 38px; line-height: 1; color: #fff; margin: 0 0 8px; }
.card-content .card-detail { font-size: 13px; line-height: 1.35; color: #fff; margin: 0; }
.card-content .painting-date { font-size: 12px; color: #ddd; margin: 4px 0 0; }
.painting-copy { position: absolute; top: 57%; left: 1.25rem; right: 1.25rem; }
.card-content .painting-copy h2 { max-width: 100%; font-size: 30px; line-height: 1.06; color: #fff; margin: 0 0 12px; }
.card-content .painting-copy p { font-size: 13px; line-height: 1.65; color: #f4f4f4; max-width: 100%; margin: 0; }
.painting-difficulty { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #eee; }
.difficulty-stars { display: flex; gap: 4px; }
.earned-star { color: #e9c778; }
.empty-star { color: #b7b7b7; }
@media (max-height: 730px) {
  .card-content { padding: 16px; }
  .card-content .painting-copy h2 { font-size: 24px; }
  .card-content .painting-copy p { font-size: 12px; line-height: 1.45; }
  .painting-copy { top: 49%; left: 16px; right: 16px; }
}

.card-metric {
  margin-bottom: 0.15rem;
  font-size: clamp(2.1rem, 11vw, 3.4rem);
  font-weight: 950;
  line-height: 0.86;
}

.card-detail {
  margin: 0;
  color: rgba(244, 239, 229, 0.75);
  font-size: 0.82rem;
  font-weight: 850;
}

.card-content h2 {
  max-width: 10ch;
  margin-bottom: 0.6rem;
  font-size: clamp(1.65rem, 8.7vw, 2.55rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.card-content p {
  max-width: 18rem;
  color: rgba(244, 239, 229, 0.78);
  line-height: 1.36;
}

.card-action {
  align-self: flex-start;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
}

.painter {
  margin: 0;
  color: rgba(244, 239, 229, 0.66);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.composition-lines {
  position: absolute;
  inset: 1.2rem;
  z-index: 1;
  pointer-events: none;
  opacity: 0.52;
}

.line {
  position: absolute;
  display: block;
  background: rgba(244, 239, 229, 0.55);
}

.line-v {
  top: 0;
  left: 52%;
  width: 1px;
  height: 100%;
}

.line-h {
  top: 42%;
  left: 0;
  width: 100%;
  height: 1px;
}

.line-arc {
  right: 5%;
  bottom: 12%;
  width: 58%;
  aspect-ratio: 1;
  border: 1px solid rgba(227, 200, 121, 0.55);
  border-left-color: transparent;
  border-radius: 50%;
  background: transparent;
}

.progress-rail {
  position: absolute;
  top: 43%;
  right: 0.1rem;
  z-index: 7;
  display: grid;
  gap: 0.45rem;
}

.progress-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(244, 239, 229, 0.42);
  box-shadow: 0 0 0 1px rgba(5, 6, 4, 0.35);
  transition: height 220ms ease, background 220ms ease;
}

.progress-dot.active {
  height: 1.35rem;
  background: var(--paper);
}

.stack-caption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.18rem 0.2rem 0.45rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.composition-lens {
  --lens-accent: #b9f4a8;
  --slot-alpha: 0.22;
  --load-progress: 0;
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-columns: 3.35rem minmax(0, 1fr) 4.3rem;
  align-items: center;
  width: 100%;
  min-height: 4.9rem;
  padding: 0.86rem 0.78rem 0.56rem 0.62rem;
  overflow: visible;
  border: 1px solid rgba(244, 239, 229, 0.14);
  border-radius: 1.28rem;
  background:
    radial-gradient(circle at 74% 48%, color-mix(in srgb, var(--lens-accent) 12%, transparent), transparent 9rem),
    linear-gradient(180deg, rgba(244, 239, 229, 0.08), rgba(244, 239, 229, 0.025)),
    #11130f;
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  isolation: isolate;
}

.stack-section > .composition-lens {
  position: absolute;
  right: 0;
  bottom: max(-12rem, calc(-11.65rem - env(safe-area-inset-bottom)));
  left: 0;
  width: 100%;
}

.lens-sensing {
  --lens-accent: #5dbdff;
  --slot-alpha: 0.56;
}

.lens-armed,
.lens-loaded {
  --lens-accent: #e3b95f;
  --slot-alpha: 0.7;
}

.lens-slot-back,
.lens-slot-front,
.slot-glow {
  position: absolute;
  left: 4.4rem;
  right: 3.9rem;
  top: -0.22rem;
  height: 0.82rem;
  border-radius: 999px;
  pointer-events: none;
}

.lens-slot-back {
  z-index: 1;
  background: #030403;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(244, 239, 229, 0.2);
}

.lens-slot-front {
  z-index: 4;
  border: 1px solid rgba(244, 239, 229, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(5, 6, 4, 0.68));
  box-shadow: 0 0 20px color-mix(in srgb, var(--lens-accent) calc(var(--slot-alpha) * 100%), transparent);
}

.slot-glow {
  z-index: 3;
  background: var(--lens-accent);
  filter: blur(12px);
  opacity: var(--slot-alpha);
}

.loaded-template-strip {
  position: absolute;
  left: 4.72rem;
  right: 4.22rem;
  top: -1.45rem;
  z-index: 2;
  height: 1.68rem;
  overflow: hidden;
  border: 1px solid rgba(244, 239, 229, 0.34);
  border-radius: 0.42rem;
  box-shadow: 0 0 18px rgba(227, 185, 95, 0.35);
  transform: translateY(calc(var(--load-progress) * 0.25rem));
}

.loaded-template-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.35) contrast(1.08) brightness(0.9);
}

.lever-system {
  position: relative;
  z-index: 5;
  width: 2.1rem;
  height: 3.8rem;
  justify-self: start;
  cursor: grab;
  touch-action: none;
}

.lever-system:active {
  cursor: grabbing;
}

.lever-track,
.lever-knob {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.lever-track {
  inset-block: 0;
  width: 1rem;
  border: 1px solid rgba(244, 239, 229, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(180deg, transparent calc((1 - var(--load-progress)) * 100%), color-mix(in srgb, var(--lens-accent) 82%, transparent) calc((1 - var(--load-progress)) * 100%)),
    #030403;
  box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.86),
    0 0 18px color-mix(in srgb, var(--lens-accent) calc(var(--load-progress) * 48%), transparent);
}

.lever-knob {
  top: calc(var(--load-progress) * 2.28rem);
  z-index: 2;
  width: 1.55rem;
  height: 1.55rem;
  border: 1px solid rgba(244, 239, 229, 0.32);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 28%, #fff1d0, transparent 22%),
    linear-gradient(135deg, #8d806d, #1b1b18 62%, #b8ab91);
  box-shadow:
    0 5px 12px rgba(0, 0, 0, 0.5),
    0 0 14px color-mix(in srgb, var(--lens-accent) calc(var(--load-progress) * 50%), transparent);
  transition: top 120ms ease;
}

.lens-copy {
  position: relative;
  z-index: 5;
  min-width: 0;
}

.lens-copy strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--paper);
  font-size: clamp(1rem, 4.8vw, 1.35rem);
  font-weight: 760;
  letter-spacing: 0;
}

.lens-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--lens-accent);
  font-size: 0.8rem;
  font-weight: 820;
}

.lens-status i {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 13px currentColor;
}

.lens-guides {
  position: absolute;
  right: 4.8rem;
  bottom: 0.86rem;
  width: 4rem;
  height: 1.9rem;
  opacity: 0.34;
  pointer-events: none;
}

.lens-guides::before,
.lens-guides::after,
.lens-guides span {
  position: absolute;
  content: "";
  background: rgba(244, 239, 229, 0.4);
}

.lens-guides::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
}

.lens-guides::after {
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
}

.lens-guides span {
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid rgba(244, 239, 229, 0.55);
  background: transparent;
}

.lens-guides span:first-child {
  top: 0.2rem;
  left: 1.7rem;
}

.lens-guides span:last-child {
  display: none;
}

.aperture {
  position: relative;
  z-index: 5;
  justify-self: end;
  width: 2.86rem;
  height: 2.86rem;
  overflow: hidden;
  border: 1px solid rgba(244, 239, 229, 0.16);
  border-radius: 50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--lens-accent) calc(var(--load-progress) * 80%), transparent) 0 10%, transparent 24%),
    #070806;
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.8),
    0 0 22px color-mix(in srgb, var(--lens-accent) calc(var(--load-progress) * 55%), transparent);
}

.aperture span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58%;
  height: 40%;
  border-radius: 0.25rem 70% 0.25rem 70%;
  background: linear-gradient(135deg, rgba(244, 239, 229, 0.28), rgba(10, 11, 9, 0.86));
  transform-origin: 0 50%;
  transform: rotate(calc(var(--i) * 51.4deg + var(--iris-open))) translate(0, -50%);
  transition: transform 220ms ease;
}

.aperture b {
  position: absolute;
  inset: 36%;
  border-radius: 50%;
  background: var(--lens-accent);
  box-shadow: 0 0 22px var(--lens-accent);
  opacity: calc(var(--load-progress) * 0.95);
}

.stack-caption p {
  max-width: 13rem;
  margin-bottom: 0;
}

.gesture-help {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.18rem;
  color: rgba(244, 239, 229, 0.82);
  font-weight: 800;
}

@media (max-width: 420px) {
  .page-shell {
    padding: 0;
  }

  .phone-shell {
    width: 100%;
    min-height: 100svh;
    border: 0;
    border-radius: 0;
  }

  .stack-card {
    inset-right: 1.1rem;
  }

  .stack-section > .composition-lens {
    right: 0.15rem;
    left: 0.15rem;
    width: auto;
  }
}

.composition-lens {
  display: block;
  container-type: normal;
  aspect-ratio: 1005 / 245;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.lens-asset-layers { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.lens-asset { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 240ms ease; }
.lens-asset.is-visible { opacity: 1; }
.composition-lens .lens-copy,
.composition-lens .lens-guides,
.composition-lens .aperture,
.composition-lens .lens-slot-front,
.composition-lens .slot-glow,
.composition-lens .lens-slot-back { display: none; }
.composition-lens .lever-system {
  position: absolute; left: 5.9%; top: 9%; width: 5.3%; height: 81%; z-index: 6;
}
.composition-lens .lever-system::before { content: ''; position: absolute; inset: -8px; }
.composition-lens .lever-track {
  inset-block: calc(5.724cqw / 2);
  width: 27%;
  border-color: #566060;
  background: linear-gradient(180deg,
    var(--lens-accent) 0%,
    var(--lens-accent) calc(var(--load-progress) * 100%),
    #030403 calc(var(--load-progress) * 100%),
    #030403 100%);
}
.composition-lens .lever-knob {
  top: calc(var(--load-progress) * (100% - 5.724cqw)); width: 5.724cqw; height: 5.724cqw; aspect-ratio: 1;
  background: url('./assets/lens-lever.png') center / contain no-repeat;
  border: 0; box-shadow: none;
}
.composition-lens .loaded-template-strip {
  left: 17%; right: 19%; top: -16%; height: 30%; z-index: 2;
}

.phone-shell {
  display: flex;
  flex-direction: column;
  height: min(1100px, calc(100svh - 2rem));
  min-height: 620px;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}
.status-bar, .mobile-header { flex-shrink: 0; }
.mobile-header { display: flex; align-items: center; gap: .65rem; min-height: 52px; }
.category-nav { display: flex; flex: 0 1 auto; gap: .65rem; min-width: 0; }
.category-link { position: relative; min-height: 44px; padding: 0 .45rem; background: transparent; color: #a6aaa6; font-size: 16px; font-weight: 500; letter-spacing: 0; cursor: pointer; }
.category-link.is-active { color: #f4efe5; }
.category-link.is-active::after { position: absolute; right: .45rem; bottom: 2px; left: .45rem; height: 2px; background: #e3c879; content: ''; }
.portfolio-button { display: grid; margin-left: auto; flex-shrink: 0; width: 44px; height: 44px; padding: 0; place-items: center; background: transparent; color: #f4efe5; cursor: pointer; }
.portfolio-button:hover { color: #e3c879; }
.stack-section {
  flex: 1;
  container-type: inline-size;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(24.4% + .8rem);
}
.card-stack { flex: 1; min-height: 0; height: auto; max-height: none; }
.stack-card { height: calc(100% - 1.4rem); right: 1.35rem; }
.stack-caption { flex-shrink: 0; margin-top: .35rem; }
.stack-section > .composition-lens { bottom: 0; }
.composition-lens { z-index: auto; isolation: auto; }
.lens-asset-layers { z-index: 10; }
.lens-asset-front { position: absolute; inset: 0; z-index: 14; clip-path: inset(22% 0 0 0); pointer-events: none; }
.composition-lens .lever-system { z-index: 16; }
.capture-hit {
  position: absolute; right: 1.5%; top: 56%; width: 19%; height: auto; aspect-ratio: 1;
  transform: translateY(-50%); z-index: 16; border-radius: 50%; padding: 0;
  background: #111413; cursor: pointer;
  border: 1px solid #4e5553;
  box-shadow: 0 2px 5px #000a, inset 0 1px 1px #b0b9b866, inset 0 -2px 3px #000;
}
.aperture-detail { position: absolute; inset: 3%; overflow: hidden; border-radius: 50%; }
.aperture-detail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 240ms ease; }
.lens-sensing .aperture-detail img { transition: none; }
.capture-hit:not(:disabled):hover { box-shadow: 0 0 10px #e3b95f55, inset 0 1px 1px #b0b9b866; }
.capture-hit:not(:disabled):active { transform: translateY(-50%) scale(.97); }
.capture-hit:disabled { cursor: default; }
.card-stack { z-index: auto; clip-path: none; }
.deck-moving .slot-0 { z-index: 13; }
.card-stack.deck-loaded { filter: blur(7px); opacity: .45; pointer-events: none; transition: filter 350ms ease, opacity 350ms ease; }
.deck-loaded .progress-rail { visibility: hidden; }
.deck-loaded.deck-moving { transition: none; }
.lens-sensing .lens-asset { transition: none; }
.card-stack:active .slot-0 { transition: none; }
.deck-moving .slot-0 .card-face img { transform: none; transition: none; }
.composition-lens .lever-knob { transition: none; }
.insert-viewport { position: absolute; inset: 0; z-index: 13; pointer-events: none; clip-path: polygon(-100% -100%, 200% -100%, 200% var(--slot-y), -100% var(--slot-y)); }
.insert-card { position: absolute; transform-origin: 50% 100%; }
.insert-card .card-face {
  width: calc(100% / var(--insert-scale));
  height: calc(100% / var(--insert-scale));
  transform: scale(var(--insert-scale));
  transform-origin: top left;
}
.slot-0 { transition: none; }
.lens-state-overlay {
  mask-image: linear-gradient(#000, #000);
  mask-size: 67% 20%;
  mask-position: 49% 12%;
  mask-repeat: no-repeat;
}
.reader-status {
  position: absolute; left: 20%; top: 66%; width: 48%; height: 21%; z-index: 15;
  display: flex; align-items: center; gap: 1.8cqw; background: #1b1e1c;
  color: #b9f4a8; font-family: Georgia, serif; font-size: 2.7cqw;
}
.reader-status i { width: 1.8cqw; height: 1.8cqw; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.reader-status-sensing { color: #5dbdff; }
.reader-status-sensing i, .reader-status-sensing span { animation: sensing-pulse 1.4s ease-in-out infinite; }
.reader-status-loaded { color: #e3b95f; }
.reader-title {
  position: absolute; left: 20%; top: 43%; width: 58%; height: 23%; z-index: 15;
  display: flex; align-items: center; background: #1b1e1c; color: #f4efe5;
  font-family: 'Monotype Corsiva', 'Segoe Script', 'Brush Script MT', cursive;
  font-size: 4.1cqw; font-weight: 400; white-space: nowrap;
}
.reader-title, .reader-status { background: transparent; }
.reader-title { left: 19%; width: 57%; }
.reader-status { left: 19%; }
.composition-lens .lever-system { left: 5.6%; top: 13%; width: 4.8%; height: 74%; }
.composition-lens .lever-track { inset-block: 0; width: 100%; border: 0; background: none; box-shadow: none; }
.lever-track img { position: absolute; inset: 0; width: 100%; height: 100%; }
.lever-track .track-light {
  clip-path: inset(0 0 calc(100% - 3.2cqw - var(--load-progress) * (100% - 6.4cqw)) 0);
}
.composition-lens .lever-knob {
  width: 6.4cqw; height: 6.4cqw; top: calc(var(--load-progress) * (100% - 6.4cqw));
  background-image: url('./assets/reader-knob.png');
}
.capture-hit { right: 1.2%; width: 18.5%; }
.aperture-detail { inset: 2%; }

.card-stack.coverflow-deck { width: 100%; overflow: visible; z-index: 1; touch-action: none; }
.coverflow-deck .swiper-wrapper { height: calc(100% - 24px); align-items: center; }
.coverflow-deck .swiper-slide { width: 76%; height: 94%; }
.cover-card { width: 100%; height: 100%; transform-origin: 50% 80%; transform: var(--arc-transform, none); transition: transform var(--cover-duration, 0ms) ease; }
.coverflow-deck .card-face { filter: var(--cover-filter, none); opacity: var(--cover-opacity, 1); transition: filter var(--cover-duration, 0ms) ease, opacity var(--cover-duration, 0ms) ease; }
.coverflow-deck .swiper-slide.is-settled-center { transform: none !important; }
.is-settled-center .cover-card { transform: none; }
.is-settled-center .card-face { filter: none; opacity: 1; }
.coverflow-deck .progress-rail { top: auto; bottom: -4px; left: 0; right: 0; height: 32px; display: flex; flex-direction: row; justify-content: center; align-items: center; gap: 0; transform: none; }
.coverflow-deck .progress-dot { position: relative; padding: 0; width: 36px; height: 32px; border-radius: 0; cursor: pointer; background: transparent; box-shadow: none; }
.coverflow-deck .progress-dot::before { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 6px; height: 6px; border-radius: 3px; background: #aaa; }
.coverflow-deck .progress-dot.active { width: 36px; height: 32px; background: transparent; }
.coverflow-deck .progress-dot.active::before { width: 20px; background: var(--paper); }
.drag-viewport { position: absolute; inset: 0; z-index: 13; pointer-events: none; clip-path: polygon(-100% -100%, 200% -100%, 200% var(--slot-y), -100% var(--slot-y)); }
.drag-card { position: absolute; transform-origin: 50% 100%; will-change: transform; }
@media (prefers-reduced-motion: reduce) {
  .coverflow-deck *, .drag-card, .insert-card { transition-duration: 0s !important; }
}
.reader-slot-light {
  position: absolute; left: 14.8%; right: 16.8%; top: 12%; height: 19%; z-index: 11;
  border: 2px solid #61caff; border-radius: 999px; pointer-events: none;
  box-shadow: 0 0 7px #61caff, inset 0 0 4px #61caff;
}
.port-rear { z-index: 11; clip-path: inset(-12px -12px 50% -12px); }
.port-front { z-index: 15; clip-path: inset(50% -12px -12px -12px); }
.reader-slot-loaded { border-color: #edc06b; box-shadow: 0 0 9px #edc06b, inset 0 0 6px #edc06b; }
.reader-slot-sensing { animation: slot-breathe 1.8s ease-in-out infinite; }
@keyframes slot-breathe { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(.5); } }
@keyframes sensing-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes sensing-travel { from { transform: translateX(-100%); } to { transform: translateX(430%); } }
.caption-hidden { visibility: hidden; }
@media (max-width: 420px) {
  .phone-shell { height: 100svh; min-height: 620px; }
}

@media (prefers-reduced-motion: reduce) {
  .reader-status-sensing i, .reader-status-sensing span, .reader-slot-sensing { animation: none; }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Real browser viewport: no simulated device chrome or fixed phone dimensions. */
.page-shell { min-height: 100svh; height: 100dvh; padding: 0; overflow: hidden; background: #080906; }
.phone-shell.app-viewport {
  width: 100%; max-width: 560px; height: 100%; min-height: 0;
  border: 0; border-radius: 0; box-shadow: none;
  padding: calc(12px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.app-viewport::before { display: none; }

/* Gallery reader: one shared coordinate system, with immutable shell and bezel. */
.composition-lens .lens-asset { transition: none; }
.composition-lens .lens-asset-front { clip-path: inset(calc(100% * 135 / 452) 0 0 0); }
.composition-lens .reader-wordmark {
  left: 15%; top: 39%; width: 33%; height: 28%; object-fit: contain;
}
.reader-golden-ratio {
  position: absolute; left: 54%; top: 41%; width: 14%; height: 35.8%; object-fit: contain;
  z-index: 16; pointer-events: none; opacity: 1; filter: none; transition: none;
  transform: translateZ(0); backface-visibility: hidden; isolation: isolate;
}
.composition-lens .reader-status { left: 16%; top: 70%; width: 33%; height: 16%; font-family: system-ui, sans-serif; font-size: 12px; z-index: 16; }
.composition-lens .reader-slot-light {
  inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none;
}
.composition-lens .reader-slot-light img { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 240ms ease; }
.composition-lens .reader-slot-sensing { animation: none; }
.composition-lens .reader-slot-light img:first-child { animation: slot-breathe 1.8s ease-in-out infinite; }
.composition-lens .port-rear, .composition-lens .port-front { clip-path: none; }
.composition-lens .capture-hit {
  right: 4.5%; top: 50%; width: 18.1%; background: none; border: 0; box-shadow: none;
}
.composition-lens .aperture-detail { inset: 0; }
.composition-lens .aperture-detail img { transition: opacity 240ms ease; }
.composition-lens .aperture-detail .iris-fixed-bezel { opacity: 1; transition: none; }
.composition-lens .lever-system { left: 6.1%; top: 12%; width: 3.4%; height: 72%; touch-action: none; }
.composition-lens .lever-system::before { inset: -4px auto; left: 50%; width: 44px; transform: translateX(-50%); }
.composition-lens .lever-knob {
  width: 5.6cqw; height: 5.6cqw; top: calc(var(--load-progress) * (100% - 5.6cqw));
  background-image: url('./assets/reader04/lever-knob.webp');
}
.composition-lens .lever-track { left: 0; transform: none; }
.composition-lens .lever-track .track-light {
  position: absolute; left: 32%; top: 9%; width: 36%;
  height: calc(2.8cqw + var(--load-progress) * (100% - 5.6cqw) - 9%); border-radius: 999px;
  background: linear-gradient(180deg, transparent, var(--track-color) 18%, var(--track-color) 75%, transparent);
  box-shadow: 0 0 3px var(--track-color);
  clip-path: none;
}
@media (prefers-reduced-motion: reduce) {
  .composition-lens .reader-slot-light img:first-child { animation: none; }
}
.app-viewport .mobile-header { margin-top: 0; margin-bottom: 14px; min-height: 48px; }
.app-viewport .stack-section { overflow: visible; }
.shoot-back { margin-left: 0; font-size: 32px; }
.shoot-heading { flex: 1; min-width: 0; font-size: 12px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shoot-mode .coverflow-deck { visibility: hidden; pointer-events: none; }
.shooting-experience { position: absolute; inset: 0 0 calc(24.4cqw + 16px); z-index: 5; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.camera-square { width: min(100%, calc(100dvh - 340px)); aspect-ratio: 1; flex: 0 0 auto; perspective: 1100px; }
.frame-flipper { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.frame-front, .frame-back { position: absolute; inset: 0; border: 6px solid #181917; border-radius: 4px; background: repeating-linear-gradient(135deg,#111210 0 1px,#151613 1px 3px); box-shadow: inset 0 0 0 1px #35352e, 0 8px 22px #0006; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.frame-back { transform: rotateX(180deg); display: grid; place-items: center; background: #161715; }
.frame-back::before, .frame-back::after { content: ''; position: absolute; top: 12px; width: 24px; height: 5px; background: #39382f; }
.frame-back::before { left: 16px; }.frame-back::after { right: 16px; }
.frame-signature { color: #c8a96a; font-family: 'Segoe Script', cursive; font-style: italic; font-size: 20px; transform: rotate(-8deg); }
.frame-front { display: flex; align-items: center; justify-content: center; }
.camera-crop { position: relative; flex: none; background: #030403; }
.crop-reveal { position: absolute; inset: 0; overflow: hidden; }
.center-seed { position: absolute; left: calc(50% - 3px); top: calc(50% - 3px); width: 6px; height: 6px; border-radius: 50%; background: #d8b774; z-index: 5; }
.camera-crop video, .camera-guides, .reference-overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera-guides { object-fit: fill; pointer-events: none; }.reference-overlay { opacity: .2; pointer-events: none; }
.demo-camera { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.demo-label { position: absolute; bottom: 8px; left: 8px; z-index: 4; background: #0b0d0ce0; color: #ddd6be; font-size: 10px; padding: 6px; border-radius: 3px; }
.crop-corner { position: absolute; width: 14px; height: 14px; border-color: #cfad68; border-style: solid; z-index: 3; }
.corner-tl { left: -6px; top: -6px; border-width: 2px 0 0 2px; }.corner-tr { right: -6px; top: -6px; border-width: 2px 2px 0 0; }.corner-bl { left: -6px; bottom: -6px; border-width: 0 0 2px 2px; }.corner-br { right: -6px; bottom: -6px; border-width: 0 2px 2px 0; }
.guide-toggle { position: absolute; right: 0; bottom: 0; width: 40px; height: 40px; background: transparent; color: #d9c38e; display: grid; place-items: center; z-index: 4; }
.camera-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 12px; text-align: center; font-size: 12px; background: #080a08; }
.camera-empty button { background: #dfc58a; color: #171811; padding: 10px 16px; border-radius: 4px; }
.shoot-lessons { width: 100%; flex: 1; min-height: 0; display: grid; grid-template-columns: 36% minmax(0,1fr); gap: 14px; }
.art-flight { min-height: 0; height: 100%; position: relative; }.art-tilt { height: 100%; }
.art-reference { width: 100%; height: 100%; padding: 6px; border: 1px solid #33352e; border-radius: 4px; background: #0c0e0b; cursor: pointer; }
.art-reference.selected { border-color: #d9b568; }.art-reference img { width: 100%; height: 100%; object-fit: contain; }
.lesson-content { min-width: 0; min-height: 0; position: relative; display: flex; flex-direction: column; }
.lesson-swiper { width: 100%; flex: 1; min-height: 0; }.lesson-swiper .swiper-slide { overflow-y: auto; padding-right: 8px; }
.lesson-swiper h2 { color: #ddc28b; font-size: 16px; margin: 0 0 10px; }
.lesson-swiper p { font-size: 13px; line-height: 1.7; color: #d3d4cb; margin: 8px 0; }
.lesson-metadata strong { display: block; font-size: 13px; line-height: 1.4; }.lesson-metadata small { display: block; color: #91968c; font-size: 11px; line-height: 1.5; margin-top: 4px; }
.lesson-palette { display: flex; gap: 8px; margin-top: 12px; }.lesson-palette i { width: 20px; height: 20px; border-radius: 50%; border: 1px solid #ffffff25; }
.lesson-pagination { display: flex; justify-content: center; padding-right: 30px; }.lesson-pagination button { width: 32px; height: 32px; background: transparent; display: grid; place-items: center; }.lesson-pagination i { width: 5px; height: 5px; border-radius: 50%; background: #656960; }.lesson-pagination [aria-pressed=true] i { background: #d7ba79; }
.motion-toggle { position: absolute; right: 0; bottom: 0; width: 32px; height: 32px; background: transparent; color: #a9ad9e; display: grid; place-items: center; }.motion-toggle[aria-pressed=true] { color: #d7ba79; }
.shooting-experience.is-waiting .shoot-lessons, .shooting-experience.is-waiting .guide-toggle { visibility: hidden; }
.shooting-experience.is-waiting .frame-front { visibility: hidden; }
.shoot-error { position: absolute; left: 0; right: 0; bottom: -14px; font-size: 11px; text-align: center; color: #f3ba9e; background: #171712; z-index: 6; }
.has-photo .camera-square, .has-photo .shoot-lessons { filter: blur(8px); opacity: .4; pointer-events: none; }
.has-photo .camera-crop video { visibility: hidden; }
.has-photo .crop-reveal > * { visibility: hidden; }
.has-photo .crop-reveal { background: #000; }
.print-modal { position: fixed; inset: 0; z-index: 13; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 20px; background: transparent; }
.polaroid { width: min(64vw,260px,calc((100dvh - 300px) * var(--photo-ratio))); padding: 12px 12px 20px; background: #141513; color: #eee9dd; border-radius: 2px; box-shadow: none; }
.phase-confirm .polaroid { box-shadow: 0 16px 40px #0005; }
.polaroid-image { background: #040504; overflow: hidden; }.polaroid img { width: 100%; height: 100%; object-fit: cover; }
.polaroid-caption { display: grid; grid-template-columns: minmax(0,1fr) 30%; align-items: center; gap: 8px; margin-top: 16px; }
.polaroid .polaroid-wordmark { width: 100%; height: auto; object-fit: contain; }
.polaroid strong { display: block; font-size: 10px; line-height: 1.4; margin: 0; }.polaroid p { font-size: 10px; line-height: 1.4; margin: 5px 0; }.polaroid small { display: block; font-size: 9px; line-height: 1.4; color: #b6b4a8; }
.print-actions { display: flex; gap: 12px; }.print-actions button,.print-actions a { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; color: #eceadf; background: #292b23; border-radius: 4px; }.print-actions button:last-of-type { background: #d6bc7e; color: #1c2117; }
.gallery-view { position: fixed; inset: 0; z-index: 100; background: #11130f; padding: max(20px,env(safe-area-inset-top)) 20px; overflow-y: auto; }.gallery-view header { display: flex; align-items: center; justify-content: space-between; }.gallery-view h2 { font-size: 22px; }.gallery-view button { width: 44px; height: 44px; background: transparent; color: #e6dfc8; }.gallery-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }.gallery-grid img { width: 100%; }.gallery-grid p { margin: 8px 0; font-size: 13px; }.gallery-grid small { color: #a8ae9e; font-size: 10px; }.gallery-grid a { display: block; padding: 8px; color: #d7ba79; }
@media (prefers-reduced-motion: reduce) { .frame-flipper { transition: none; } }
.composition-lens .lens-body,
.composition-lens .lever-knob,
.composition-lens .iris-fixed-bezel { filter: none !important; }
.composition-lens .lens-asset-front::after { display: none !important; }
.composition-lens .reader-fixed-port { display: none; }
.composition-lens:not(.reader-skin-default) .lever-system { left: 6.3%; top: 17%; height: 57%; }
.composition-lens:not(.reader-skin-default) .aperture-detail { clip-path: circle(50% at 50% 50%); }
.composition-lens:not(.reader-skin-default) .iris-state-ready { clip-path: circle(38% at 50% 50%); }
.composition-lens:not(.reader-skin-default) .iris-fixed-bezel { display: none; }
.composition-lens:not(.reader-skin-default) .iris-state-sensing,
.composition-lens:not(.reader-skin-default) .iris-state-armed { clip-path: circle(38% at 50% 50%); }
.iris-material-ring { position: absolute; inset: 3%; container-type: size; border-radius: 50%; border: 5px solid #bba16b; box-shadow: inset 0 0 0 1px #33281b, 0 0 0 1px #d4c39c, 0 2px 3px #0007; pointer-events: none; }
.reader-skin-canvas .iris-material-ring { border-color: #e5e4df; box-shadow: inset 0 0 0 1px #7b7c76, 0 0 0 1px #faf9f1, 0 2px 3px #0007; }
.reader-skin-brick .iris-material-ring { border-width: 7px; border-color: #ffce09; box-shadow: inset 0 0 0 1px #ba8d00, 0 0 0 1px #ffe978, 0 2px 3px #0007; }
.iris-material-ring i { position: absolute; width: 4px; height: 4px; left: calc(50% - 2px); top: calc(50% - 2px); border-radius: 50%; background: #ffdf39; box-shadow: 0 1px 1px #ad8300, inset 0 1px #fff2a8; transform: rotate(calc(var(--stud-index) * 30deg)) translateY(calc(-50cqw - 3.5px)); }
.reader-skin-brick .reader-wordmark,
.reader-skin-brick .reader-golden-ratio { filter: grayscale(1) brightness(.25); }
.reader-skin-brick .reader-status-ready { color: #24602d; text-shadow: none; }
.reader-skin-canvas .reader-status-loaded,
.reader-skin-brick .reader-status-loaded { color: #795400; text-shadow: none; }
.reader-skin-canvas .reader-status-sensing,
.reader-skin-brick .reader-status-sensing { color: #075482; text-shadow: none; }
.header-tools { display: flex; align-items: center; gap: 2px; margin-left: auto; flex: 0 0 auto; }
.header-tools .portfolio-button { margin-left: 0; width: 40px; height: 44px; }
.composition-lens .lever-track > img { filter: grayscale(1); }
.composition-lens .reader-fixed-port { clip-path: inset(13% 24% 68% 15.5%); opacity: 1; }
.reader-skin-canvas .reader-status-ready,
.reader-skin-silver .reader-status-ready { color: #24602d; text-shadow: none; }
.composition-lens.lens-ready .track-light { opacity: 0 !important; box-shadow: none; }
.reader-skin-canvas .lens-body { filter: grayscale(1) invert(.84) brightness(1.15); }
.reader-skin-silver .lens-body { filter: grayscale(1) invert(.65) contrast(1.25); }
.reader-skin-leather .lens-body { filter: sepia(1) saturate(5) hue-rotate(310deg) brightness(1.2); }
.reader-skin-toy .lens-body { filter: sepia(1) saturate(7) hue-rotate(150deg) brightness(1.65); }
.reader-skin-canvas .reader-wordmark,
.reader-skin-canvas .reader-golden-ratio,
.reader-skin-silver .reader-wordmark,
.reader-skin-silver .reader-golden-ratio { filter: grayscale(1) brightness(.25); }
.reader-skin-canvas .lever-knob,
.reader-skin-silver .lever-knob,
.reader-skin-canvas .iris-fixed-bezel,
.reader-skin-silver .iris-fixed-bezel { filter: grayscale(1) brightness(1.2); }
.reader-skin-leather .lens-asset-front::after,
.reader-skin-canvas .lens-asset-front::after,
.reader-skin-silver .lens-asset-front::after,
.reader-skin-toy .lens-asset-front::after {
  content: ''; position: absolute; left: 12%; right: 24%; top: 34%; bottom: 9%;
  pointer-events: none; border-radius: 3px;
}
.reader-skin-canvas .lens-asset-front::after {
  background: repeating-linear-gradient(0deg, #8882 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, #8882 0 1px, transparent 1px 3px);
}
.reader-skin-silver .lens-asset-front::after { background: repeating-linear-gradient(0deg, #fff2 0 1px, transparent 1px 3px); }
.reader-skin-leather .lens-asset-front::after { background: repeating-radial-gradient(ellipse at 20% 30%, #3002 0 1px, transparent 1px 3px); border-bottom: 1px dashed #eab07988; }
.reader-skin-toy .lens-asset-front::after { background: linear-gradient(135deg, #ff6262, #bf2424); box-shadow: inset 0 1px 2px #ffffff70; }
@media (max-width: 360px) {
  .app-viewport .category-nav { gap: 4px; }
  .app-viewport .category-link { padding-left: 3px; padding-right: 3px; font-size: 15px; }
  .header-tools .portfolio-button { width: 36px; }
}
@media (max-height: 600px) {
  .app-viewport .mobile-header { margin-bottom: 6px; }
  .app-viewport .card-content { padding: 12px; }
  .app-viewport .card-metric { font-size: 26px; margin-bottom: 4px; }
  .app-viewport .painting-copy { top: 44%; left: 12px; right: 12px; }
  .app-viewport .painting-copy h2 { font-size: 20px; margin-bottom: 6px; }
  .app-viewport .painting-copy p { font-size: 11px; line-height: 1.4; }
}
