/* Showcase-only additions. Core homepage layout and typography live in frontend-home.css. */
.home-site {
  position: relative;
  isolation: isolate;
}
.home-site > .home-main,
.home-site > .home-footer {
  position: relative;
  z-index: 1;
}
.home-site > .home-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #1b1d19;
}
.home-main {
  overflow-anchor: none;
}
.formula-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}
.formula-fragment {
  position: absolute;
  left: var(--formula-x);
  top: var(--formula-y);
  opacity: .065;
  transform: rotate(var(--formula-angle)) scale(var(--formula-scale, 1));
  transform-origin: left center;
}
.formula-field math {
  color: #b8f78c;
  font-size: clamp(25px, 4vw, 58px);
  white-space: nowrap;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 102px;
}
img {
  max-width: 100%;
}
.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 12px;
  background: var(--home-accent);
  color: #20251c;
  z-index: 20;
}
.skip:focus {
  top: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.home-wordmark {
  display: inline-block;
  white-space: nowrap;
}
.home-heading-ink {
  background-image: var(--art-image);
}
.home-hero-action a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid #ffffff24;
  border-radius: 8px;
  background: rgb(32 37 30 / 75%);
  color: var(--home-accent);
  font-size: 13px;
}
.home-hero-action a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.filters {
  display: flex;
  gap: 24px;
  overflow: auto;
  border-bottom: 1px solid #ffffff20;
  margin: 28px 0;
}
.filters button {
  white-space: nowrap;
  padding: 12px 0;
  color: var(--home-muted);
  font-size: 13px;
  border-bottom: 2px solid transparent;
}
.filters button[aria-pressed="true"] {
  color: var(--home-accent);
  border-color: var(--home-accent);
}
.concept-section {
  overflow: clip;
  --terminal: #b8f78c;
  background-image: linear-gradient(#b8f78c05 1px, transparent 1px),
    linear-gradient(90deg, #b8f78c05 1px, transparent 1px);
  background-size: 36px 36px;
}
.collection-grid {
  display: grid;
  gap: clamp(64px, 9vw, 140px);
  padding: 80px 0 30px;
}
.study-story-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
}
.study-story-row:nth-child(even) > .collection-card {
  grid-column: 2;
  grid-row: 1;
}
.study-story-row:nth-child(even) > .study-story {
  grid-column: 1;
  grid-row: 1;
}
.study-story {
  padding: clamp(12px, 3vw, 44px);
  max-width: 560px;
  min-width: 0;
  scroll-margin-top: 110px;
}
.study-story h3 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
}
.study-story > p {
  color: var(--home-muted);
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.8;
}
.collection-card {
  position: relative;
  min-width: 0;
  padding: 16px;
  border: 1px solid #b8f78c26;
  background: #111710e8;
}
.collection-card .art-button {
  border-radius: 0;
  outline: 1px solid #b8f78c30;
}
.collection-card .image-label {
  border: 1px solid #b8f78c60;
  border-radius: 0;
  font: 11px ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--terminal);
  background: #091009e8;
}
.study-readout,
.study-parameters,
.math-notes,
.math-disclaimer,
#art-note,
#art-title {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.study-readout {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 12px;
  color: var(--terminal);
  font-size: 11px;
  letter-spacing: .06em;
}
.study-parameters {
  font-size: 9px;
  line-height: 1.8;
  color: #97ab91;
  margin-top: 18px;
}
.equation-stack {
  border-top: 1px solid #b8f78c26;
}
.art-frame {
  position: relative;
}
.equation-overlay {
  position: absolute;
  inset: 12% 6% 10%;
  overflow: hidden;
  border: 0;
  pointer-events: none;
  user-select: none;
  transform: rotate(-8deg);
  mix-blend-mode: soft-light;
}
.equation-overlay .layer-index {
  display: none;
}
.equation-overlay .layer-equation {
  display: block;
  border: 0;
  min-height: 0;
  margin-bottom: clamp(12px, 3vw, 42px);
}
.equation-overlay .equation-scroll {
  overflow: hidden;
  padding: 0;
}
.equation-overlay math {
  color: #fff;
  opacity: .3;
  font-size: clamp(20px, 2.6vw, 38px);
}
.collection-card:nth-child(even) .equation-overlay {
  transform: rotate(6deg);
}
.motion .collection-card .equation-stack {
  opacity: 0;
  transition: opacity .85s ease .12s;
}
.motion .collection-card .equation-stack.is-revealed,
.collection-card:focus-within .equation-stack {
  opacity: 1;
}
.layer-equation {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 70px;
  border-bottom: 1px solid #b8f78c1a;
}
.layer-index {
  color: #82947c;
  font: 10px ui-monospace, SFMono-Regular, Consolas, monospace;
}
.equation-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #7eaf69 #152013;
  padding: 12px 2px;
}
math {
  color: #d5fac4;
  font-size: clamp(15px, 1.6vw, 20px);
  text-align: left;
  margin: 0;
  width: max-content;
}
.math-disclaimer {
  max-width: 640px;
  color: #97ab91;
  font-size: 11px;
  line-height: 1.8;
  margin-top: 28px;
}
.math-notes {
  font-size: 11px;
  line-height: 1.8;
  margin: 24px 0;
}
.math-notes summary {
  cursor: pointer;
  color: #b8f78c;
}
.math-notes code {
  display: block;
  color: #b8f78c;
}
.dialog-copy {
  min-width: 0;
}
.motion .collection-card .art-frame {
  transition: transform .18s cubic-bezier(.2, .75, .25, 1);
  transform: translate3d(var(--drift-x, 0px), var(--drift-y, 0px), 0)
    rotate(var(--drift-angle, 0deg)) skewX(var(--drift-skew-x, 0deg))
    skewY(var(--drift-skew-y, 0deg)) scale(var(--drift-scale, 1));
  transform-origin: var(--drift-origin, center);
}
.collection-card:focus-within .art-frame {
  transform: none;
}
.collection-card .card-meta {
  align-items: start;
  flex-direction: column;
}
.collection-card .card-meta h3 {
  font-size: clamp(26px, 3vw, 44px);
  letter-spacing: -.04em;
}
.collection-card .palette {
  margin-top: 8px;
  gap: 3px;
}
.collection-card .palette > span {
  flex: 1;
  width: auto;
  height: 16px;
}
.collection-card[hidden] {
  display: none;
}
.art-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.pattern-canvas {
  display: block;
  overflow: hidden;
  opacity: 1;
  transition: transform .6s, opacity 1.2s ease;
}
.home-hero-art,
.home-thumbnails button {
  background-size: cover;
  background-position: center;
}
.home-hero-art > img.is-active {
  animation: none;
}
.home-thumbnails img {
  transition: opacity 1.2s ease;
}
.is-loading-art {
  opacity: 0 !important;
  transition: none !important;
  animation: none !important;
}
.art-button img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}
.art-button:hover .pattern-canvas {
  transform: scale(1.025);
}
.image-label {
  position: absolute;
  left: 16px;
  bottom: 16px;
  background: #20251cd9;
  color: var(--home-accent);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}
.card-meta h3 {
  font-size: 23px;
  margin: 0;
}
.card-meta > span {
  color: var(--home-muted);
  font-size: 11px;
}
.collection-card > p {
  font-size: 13px;
  line-height: 1.75;
  color: var(--home-muted);
  max-width: 520px;
}
.palette {
  display: flex;
  gap: 4px;
}
.palette span {
  width: 22px;
  height: 7px;
  background: var(--swatch);
}
.wear-section {
  border-top: 1px solid #ffffff1a;
  padding: 70px 0;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 35px;
}
.section-heading h2 {
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.15;
  margin: 0 0 16px;
}
.section-heading p {
  font-size: 14px;
  color: var(--home-muted);
  line-height: 1.7;
}
.eyebrow {
  color: var(--home-accent) !important;
  text-transform: uppercase;
  font-size: 11px !important;
  letter-spacing: 0.15em;
}
.select-label {
  display: block;
  color: var(--home-muted);
  font-size: 11px;
  margin-bottom: 8px;
}
select {
  border: 1px solid #ffffff30;
  border-radius: 6px;
  background: #262a23;
  color: inherit;
  padding: 10px;
  max-width: 100%;
}
.wear-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.wear-grid figure {
  margin: 0;
}
.garment-stage {
  background: #deded0;
  border-radius: 12px;
  overflow: hidden;
}
.garment-stage > img,
.garment-stage > svg {
  display: block;
  width: 100%;
  height: auto;
}
figcaption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
  font-size: 11px;
  color: var(--home-muted);
}
.wear-caption {
  font-size: 11px;
  color: var(--home-muted);
  margin-top: 24px;
}
.wear-caption a {
  color: var(--home-accent);
  text-decoration: underline;
}
.home-document li {
  color: var(--home-muted);
  line-height: 1.85;
  margin-bottom: 12px;
}
dialog {
  width: min(1100px, 94vw);
  padding: 0;
  max-height: 90svh;
  overflow: auto;
  border: 1px solid #ffffff24;
  border-radius: 12px;
  background: #1b1d19;
  color: #f0f0e7;
}
dialog::backdrop {
  background: #090c0ade;
}
body:has(dialog[open]) {
  overflow: hidden;
}
.dialog-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.dialog-grid > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dialog-copy {
  padding: 50px 30px 30px;
}
.dialog-copy h2 {
  font-size: 36px;
  margin: 0 0 20px;
}
.dialog-copy p {
  line-height: 1.75;
  color: var(--home-muted);
}
.dialog-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 36px;
  height: 36px;
  background: #c8ed9c;
  color: #20251c;
  border-radius: 50%;
  font-size: 24px;
}
.variant-buttons {
  display: flex;
  gap: 8px;
}
.variant-buttons button {
  padding: 10px;
  border: 1px solid #ffffff30;
  border-radius: 5px;
  font-size: 12px;
}
.variant-buttons button[aria-pressed="true"] {
  background: var(--home-accent);
  color: #20251c;
}
.small {
  font-size: 11px;
}
.switching {
  animation: home-reveal 0.4s;
}
@media (max-width: 720px) {
  .home-header nav > a:not(.home-nav-create) {
    display: inline;
  }
  .home-header nav > a[href="/#field-notes"] {
    display: none;
  }
  .home-header nav {
    font-size: 12px;
  }
  .collection-grid {
    grid-template-columns: 1fr;
    padding-top: 45px;
    gap: 80px;
  }
  .study-story-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .study-story-row:nth-child(n) > .collection-card,
  .study-story-row:nth-child(n) > .study-story {
    grid-column: auto;
    grid-row: auto;
  }
  .study-story {
    padding: 16px 8px 0;
  }
  .card-meta {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }
  .section-heading {
    display: block;
  }
  .wear-grid {
    grid-template-columns: 1fr;
  }
  .wear-grid figure {
    max-width: 420px;
    margin: auto;
    width: 100%;
  }
  .wear-section {
    padding: 45px 0;
  }
  .dialog-grid {
    grid-template-columns: 1fr;
  }
  .dialog-grid > img {
    max-height: 45svh;
  }
  .home-document h1 {
    overflow-wrap: anywhere;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pattern-canvas,
  .home-thumbnails img {
    transition: none !important;
  }
  .collection-card .equation-stack {
    opacity: 1 !important;
    transition: none !important;
  }
  .collection-card .art-frame,
  .art-button:hover .pattern-canvas {
    transform: none !important;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* Opening wordmark, followed by the complete homepage reveal. */
.home-opening {
  display: none;
}
html.intro-pending {
  overflow: hidden;
}
.intro-pending .home-site > :not(.home-opening) {
  opacity: 0;
  visibility: hidden;
}
.intro-pending .home-opening {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #1b1d19;
}
.home-opening .home-wordmark {
  font-size: clamp(44px, 10vw, 120px);
  font-weight: 750;
  letter-spacing: -0.06em;
  line-height: 1.2;
  opacity: 0;
}
.intro-playing .home-opening .home-wordmark {
  animation: home-opening-fade 2400ms ease-in-out both;
}
.intro-revealing .home-site > :not(.home-opening) {
  animation: home-opening-content 900ms ease-out both;
}
@keyframes home-opening-zoom {
  0% { opacity: 0; transform: scale(.9); }
  30% { opacity: 1; transform: scale(.95); }
  62% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.06); }
}
/* Every effect shares the intro controller's 2.4-second duration. */
.intro-playing[data-intro-effect="zoom"] .home-opening .home-wordmark {
  animation-name: home-opening-zoom;
}
.intro-playing[data-intro-effect="blur"] .home-opening .home-wordmark {
  animation-name: home-opening-blur;
}
.intro-playing[data-intro-effect="curtain"] .home-opening .home-wordmark {
  animation-name: home-opening-curtain;
}
@keyframes home-opening-fade {
  0%, 100% { opacity: 0; }
  30%, 64% { opacity: 1; }
}
@keyframes home-opening-blur {
  0%, 100% { opacity: 0; filter: blur(14px); }
  32%, 64% { opacity: 1; filter: blur(0); }
}
@keyframes home-opening-curtain {
  0%, 100% { opacity: 0; clip-path: inset(0 50%); }
  34%, 64% { opacity: 1; clip-path: inset(0 0); }
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .intro-playing[data-intro-effect="sweep"] .home-opening .home-wordmark::after {
    content: "camonova";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    color: transparent;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(110deg, transparent 38%, rgb(255 255 255 / 90%) 50%, transparent 62%);
    background-size: 300% 100%;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    animation: home-opening-sweep 2400ms ease-in-out both;
  }
}
@keyframes home-opening-sweep {
  0%, 16% { background-position: 100% 0; opacity: 0; }
  30%, 65% { opacity: 1; }
  84%, 100% { background-position: 0% 0; opacity: 0; }
}
@property --opening-pixel-fill {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}
@supports (mask-composite: intersect) or (-webkit-mask-composite: source-in) {
  .intro-playing[data-intro-effect="pixels"] .home-opening .home-wordmark {
    --opening-pixel-size: clamp(8px, 1.2vw, 16px);
    -webkit-mask-image:
      linear-gradient(to right, #000 var(--opening-pixel-fill), transparent 0),
      linear-gradient(to bottom, #000 var(--opening-pixel-fill), transparent 0);
    mask-image:
      linear-gradient(to right, #000 var(--opening-pixel-fill), transparent 0),
      linear-gradient(to bottom, #000 var(--opening-pixel-fill), transparent 0);
    -webkit-mask-size: var(--opening-pixel-size) var(--opening-pixel-size);
    mask-size: var(--opening-pixel-size) var(--opening-pixel-size);
    -webkit-mask-repeat: repeat;
    mask-repeat: repeat;
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
    animation: home-opening-pixels 2400ms steps(6, end) both;
  }
}
@keyframes home-opening-pixels {
  0% { --opening-pixel-fill: 0%; opacity: 0; }
  12% { opacity: 1; }
  34%, 64% { --opening-pixel-fill: 100%; opacity: 1; }
  90% { opacity: 1; }
  100% { --opening-pixel-fill: 0%; opacity: 0; }
}
@keyframes home-opening-content {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-pending .home-site > :not(.home-opening) {
    opacity: 1;
    visibility: visible;
  }
  .intro-pending .home-opening {
    display: none;
  }
}

/* The wordmark is also a native keyboard/touch language disclosure. */
.home-header > .language-switch {
  position: relative;
  justify-self: center;
}
.language-switch > summary {
  list-style: none;
  cursor: pointer;
  border-radius: 4px;
}
.language-switch > summary::-webkit-details-marker { display: none; }
.language-switch > summary:focus-visible,
.language-options a:focus-visible {
  outline: 2px solid var(--home-accent);
  outline-offset: 5px;
}
.home-header .language-options {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 160px;
  height: auto;
  padding: 12px;
  margin: 0;
  background: #1b1d19;
  border: 1px solid #ffffff26;
  border-radius: 8px;
  box-shadow: 0 12px 32px #0006;
}
.home-header .language-options > a {
  display: block;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 14px;
}
.language-options a[aria-current="true"] { color: var(--home-accent); }
.language-options a:hover { background: #ffffff0a; }
html:lang(ja) body {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-break: strict;
  overflow-wrap: anywhere;
}
html:lang(ja) .home-intro h1 {
  font-size: clamp(34px, 4.7vw, 68px);
  line-height: 1.45;
  letter-spacing: 0;
}
html:lang(ja) .home-section-heading h2,
html:lang(ja) .home-document h1 {
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.5;
  letter-spacing: 0;
}
html:lang(ja) .study-story h3 { line-height: 1.6; letter-spacing: 0; }
html:lang(ja) .study-story > p { line-height: 2; }

/* Preserve the previous rendered pixels while the next variation fades in. */
.pattern-canvas, .home-thumbnails button { position: relative; }
.artwork-previous { position: absolute; inset: 0; z-index: 2; pointer-events: none; background-size: cover; background-position: center; }
@media (prefers-reduced-motion: reduce) { .artwork-previous { display: none; } }

/* Decorative copies paint the heading; only its original text is selectable. */
.home-heading-layer, .home-heading-outline { user-select: none; -webkit-user-select: none; pointer-events: none; }

/* About: the evolving artwork is the hero surface, with quiet, legible copy. */
.about-page .home-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  width: 100vw;
  min-height: calc(100vh - var(--about-header-height, 68px));
  min-height: calc(100dvh - var(--about-header-height, 68px));
  margin-inline: calc(50% - 50vw);
  padding: clamp(48px, 7vw, 112px) max(4vw, calc((100vw - 1440px) / 2));
  box-sizing: border-box;
  overflow: hidden;
}
.about-page .home-hero > .about-hero-background {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}
.about-page .home-hero-art {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
}
.about-page .home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 12% 82%, rgb(10 16 15 / 66%), rgb(10 16 15 / 24%) 40%, transparent 72%);
  pointer-events: none;
}
.about-page .about-hero-background { filter: saturate(1.12) brightness(1.04); }
.about-page .home-hero > .home-intro { width: 100%; text-shadow: 0 2px 16px rgb(0 0 0 / 35%); }
/* Static pearl-white lettering; the artwork moves only behind the slogan. */
.about-page .home-hero .home-pattern-heading,
.about-page .home-hero .home-pattern-heading > em {
  color: #fff;
  -webkit-text-fill-color: #fff;
  -webkit-text-stroke: .5px rgb(255 255 255 / 80%);
  text-shadow: none;
  animation: none;
}
.about-page .home-hero .home-heading-layer,
.about-page .home-hero .home-heading-outline { display: none; }
.about-page .home-hero .home-heading-ink { animation: none; }
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .about-page .home-hero .home-pattern-heading {
    background: linear-gradient(120deg, #f3f4f4 15%, #fff 40%, #e4e8ea 52%, #fff 65%, #f4f5f5 90%);
    background-clip: text;
    -webkit-background-clip: text;
  }
  .about-page .home-hero .home-pattern-heading,
  .about-page .home-hero .home-pattern-heading > em {
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}
@media (forced-colors: active) {
  .about-page .home-hero .home-pattern-heading,
  .about-page .home-hero .home-pattern-heading > em {
    background: none;
    color: CanvasText;
    -webkit-text-fill-color: CanvasText;
    -webkit-text-stroke: 0;
  }
}
.about-page .home-hero .home-lead { max-width: none; font-size: clamp(16px, 1.4vw, 20px); color: #fffaf0; }
@media (max-width: 720px) {
  .about-page .home-hero { padding: clamp(32px, 7dvh, 64px) 6vw; }
  .about-page .home-hero::after { background: linear-gradient(0deg, rgb(10 16 15 / 64%), rgb(10 16 15 / 36%) 32%, transparent 72%); }
}
@media (prefers-reduced-motion: reduce) {
  .about-page .home-hero-art > img { transition: none; }
}

.about-page .home-hero .home-intro h1 { font-size: clamp(36px, 5.1vw, 82px); line-height: 1.08; }
@media (max-width: 720px) {
  .about-page .home-hero .home-intro h1 { font-size: clamp(26px, 7.8vw, 42px); }
}
