/* Hallmark · macrostructure: Long Document · tone: modern-minimal · anchor hue: jade
 * design-system: design.md · designed-as-app · pre-emit critique: P5 H5 E5 S5 R5 V4
 * contrast: pass (40–41) · nav: N1b · footer: Ft8 · slop: pass (42–45)
 * honest: pass (46) · chrome: pass (47) · tokens: pass (48) · responsive: pass (49) · icons: pass (30)
 * mobile: pass (34, 49, 50–57)
 */
@import url("./tokens.css");

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  overflow-x: clip;
  min-width: 0;
  margin: 0;
  background: var(--color-ink);
  color: var(--color-paper);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

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

button,
summary {
  font: inherit;
}

button {
  color: inherit;
}

img,
video {
  max-width: 100%;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  min-width: 0;
  font-style: normal;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: var(--space-3);
  left: var(--space-3);
  min-height: var(--size-touch);
  padding: var(--space-3) var(--space-4);
  transform: translateY(-160%);
  border-radius: var(--radius-pill);
  background: var(--color-paper);
  color: var(--color-ink);
  font-weight: var(--weight-semibold);
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-inline: clamp(var(--space-4), 4vw, var(--space-10));
  background: var(--color-header-surface);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  min-height: var(--size-touch);
  min-width: 0;
  flex: 0 1 auto;
  align-items: baseline;
  color: var(--color-paper);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  letter-spacing: .02em;
  line-height: 28px;
  white-space: nowrap;
}

html[lang="en"] .brand-mark,
html[lang="en"] .brand-sub {
  display: none;
}

.brand-sub {
  margin-inline-start: var(--space-2);
  color: var(--color-mist);
  font-family: var(--font-latin);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: .08em;
}

.header-nav {
  display: flex;
  min-width: 0;
  flex: 0 1 auto;
  align-items: center;
  gap: var(--space-2);
}

.nav-links {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-1);
}

.nav-links a,
.menu a {
  display: inline-flex;
  min-height: var(--size-touch);
  align-items: center;
  justify-content: center;
  padding-inline: var(--space-3);
  border-radius: var(--radius-pill);
  color: var(--color-paper-soft);
  font-family: var(--font-latin);
  font-size: var(--text-sm);
  line-height: 20px;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.nav-links a:hover,
.menu a:hover,
.nav-links a[aria-current="page"] {
  background: var(--color-card-surface);
  color: var(--color-paper);
}

.button {
  display: inline-flex;
  min-height: var(--size-touch);
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: var(--rule) solid transparent;
  padding-inline: var(--space-4);
  border-radius: var(--radius-pill);
  font-family: var(--font-latin);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 20px;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}

.button.primary {
  background: var(--color-paper);
  color: var(--color-ink);
}

.button.secondary,
.language-toggle {
  border-color: var(--color-card-border);
  background: var(--color-card-surface);
  color: var(--color-paper);
}

.button.round {
  min-height: var(--size-touch);
}

.button:hover {
  background: var(--color-mist);
  color: var(--color-ink);
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(1px);
}

.button[aria-disabled="true"],
.language-toggle:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.language-toggle:active,
.menu summary:active {
  transform: translateY(1px);
}

.nav-links a:active,
.menu a:active,
footer a:active {
  color: var(--color-paper);
}

.arrow {
  font-family: var(--font-latin);
  font-size: var(--text-lg);
  line-height: 1;
}

.language-toggle {
  display: inline-flex;
  min-width: 64px;
  min-height: var(--size-touch);
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-1);
  border: var(--rule) solid var(--color-card-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.language-option {
  display: inline-grid;
  min-width: 26px;
  min-height: 32px;
  place-items: center;
  border-radius: var(--radius-pill);
  color: var(--color-footer-text);
  font-family: var(--font-latin);
  font-size: var(--text-xs);
  line-height: 16px;
}

.language-option.is-active {
  background: var(--color-paper);
  color: var(--color-ink);
}

.menu {
  position: relative;
  display: none;
}

.menu summary {
  display: inline-flex;
  min-height: var(--size-touch);
  align-items: center;
  justify-content: center;
  padding-inline: var(--space-3);
  border: var(--rule) solid var(--color-card-border);
  border-radius: var(--radius-pill);
  background: var(--color-card-surface);
  color: var(--color-paper);
  cursor: pointer;
  font-family: var(--font-latin);
  font-size: var(--text-sm);
  line-height: 20px;
  list-style: none;
  white-space: nowrap;
}

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

.menu-panel,
.menu > .nav-links {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  display: grid;
  min-width: 220px;
  gap: var(--space-1);
  padding: var(--space-2);
  border: var(--rule) solid var(--color-card-border);
  border-radius: var(--radius-md);
  background: var(--color-ink-deep);
  box-shadow: var(--shadow-media);
}

.menu-panel .nav-links,
.menu > .nav-links {
  display: grid;
  align-items: stretch;
  gap: var(--space-1);
}

.menu-panel a,
.menu > .nav-links a {
  justify-content: flex-start;
}

.menu-panel .button,
.menu > .button {
  width: 100%;
}

.button:focus-visible,
.language-toggle:focus-visible,
.menu summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

.hero {
  position: relative;
  overflow: clip;
  padding-block-end: calc(var(--space-32) + var(--space-8));
}

.hero-media {
  position: absolute;
  inset: 0 0 auto;
  height: min(100svh, 760px);
  overflow: clip;
  pointer-events: none;
  background-color: var(--color-ink-deep);
  background-image:
    linear-gradient(180deg, var(--color-hero-glow), transparent 68%),
    linear-gradient(90deg, var(--color-grid) var(--rule), transparent var(--rule)),
    linear-gradient(0deg, var(--color-grid) var(--rule), transparent var(--rule));
  background-position: center, center, center;
  background-size: auto, 64px 64px, 64px 64px;
}

.hero-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--color-hero-glow), transparent 70%);
}

.hero-fade {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--space-32);
  background: linear-gradient(180deg, transparent, var(--color-ink));
}

.hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  max-width: var(--content-max);
  min-width: 0;
  margin-inline: auto;
  flex-direction: column;
  align-items: stretch;
  padding: calc(var(--space-24) + var(--space-4)) var(--space-4) 0;
  text-align: left;
}

.eyebrow {
  margin: 0;
  color: var(--color-mist);
  font-family: var(--font-latin);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: .12em;
  line-height: 1.4;
}

.hero h1 {
  max-width: 900px;
  min-width: 0;
  margin: var(--space-4) 0 0;
  color: var(--color-paper);
  font-family: var(--font-display);
  font-size: clamp(38px, 4.5vw, var(--text-display-s));
  font-weight: var(--weight-semibold);
  line-height: var(--leading-display);
  letter-spacing: -.01em;
}

.hero-content > p:not(.eyebrow) {
  max-width: 576px;
  margin: var(--space-6) 0 0;
  color: var(--color-paper-soft);
  font-size: var(--text-lg);
  line-height: var(--leading-body);
}

.hero-action {
  align-self: flex-start;
  margin-top: var(--space-8);
}

.demo-placeholder {
  position: relative;
  width: 100%;
  max-width: var(--media-max);
  margin-top: var(--space-8);
}

.demo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: var(--rule) solid var(--color-card-border);
  border-radius: var(--radius-lg);
  background: var(--color-accent-deep);
  box-shadow: var(--shadow-media);
  object-fit: cover;
}

.features {
  display: flex;
  max-width: var(--content-max);
  min-width: 0;
  margin-inline: auto;
  flex-direction: column;
  gap: var(--space-24);
  padding: var(--space-24) var(--space-4);
}

.feature {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--space-10);
  scroll-margin-block-start: calc(var(--header-height) + var(--space-4));
}

.feature-copy {
  min-width: 0;
}

.section-heading {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding-top: calc(var(--space-6) + var(--space-1));
  padding-bottom: var(--space-3);
  isolation: isolate;
}

.ghost {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  margin: 0;
  color: var(--color-heading-shadow);
  font-family: var(--font-latin);
  font-size: var(--text-section-shadow-mobile);
  font-weight: var(--weight-medium);
  letter-spacing: .01em;
  line-height: 1;
  user-select: none;
  white-space: nowrap;
}

.feature h2 {
  position: relative;
  z-index: 1;
  min-width: 0;
  margin: 0;
  color: var(--color-paper);
  font-family: var(--font-display);
  font-size: var(--text-section-mobile);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-section-mobile);
  letter-spacing: -.01em;
}

html[lang="en"] .ghost {
  display: none;
}

html[lang="en"] .section-heading {
  padding-top: 0;
  padding-bottom: 0;
}

html[lang="en"] .hero h1,
html[lang="en"] .feature h2,
html[lang="en"] .lead,
html[lang="en"] .details {
  font-family: var(--font-latin);
}

.lead {
  max-width: 42em;
  margin: var(--space-5) 0 0;
  color: var(--color-paper-soft);
  font-size: var(--text-base);
  line-height: var(--leading-lead-mobile);
}

.details {
  display: grid;
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.details > div {
  padding-top: var(--space-4);
  border-top: var(--rule) solid var(--color-card-border);
}

h3 {
  margin: 0;
  color: var(--color-paper);
  font-size: var(--text-detail);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-caption);
}

.details p {
  margin: var(--space-2) 0 0;
  color: var(--color-muted);
  font-size: var(--text-detail);
  line-height: var(--leading-detail-mobile);
}

.product-shot {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-width: 0;
  overflow: hidden;
  border: var(--rule) solid var(--color-card-border);
  border-radius: var(--radius-lg);
  background: var(--color-card-surface);
  color: var(--color-paper);
  box-shadow: var(--shadow-media);
}

.product-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-shot img[alt=""] {
  object-fit: contain;
}

.reverse .product-shot {
  order: 0;
}

.cta {
  display: flex;
  justify-content: center;
  padding: var(--space-24) var(--space-4);
  text-align: center;
}

.cta h2 {
  max-width: 600px;
  margin: var(--space-6) auto 0;
  color: var(--color-paper);
  font-family: var(--font-display);
  font-size: clamp(32px, 3.2vw, var(--text-3xl));
  font-weight: var(--weight-semibold);
  line-height: var(--leading-heading);
}

.cta .button {
  margin-top: var(--space-8);
}

footer {
  border-top: var(--rule) solid var(--color-card-border);
}

footer > div {
  display: flex;
  max-width: var(--content-max);
  min-width: 0;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-10) var(--space-4);
}

footer p,
footer a {
  min-width: 0;
  margin: 0;
  color: var(--color-footer-text);
  font-family: var(--font-latin);
  font-size: var(--text-sm);
  line-height: var(--leading-caption);
}

footer nav {
  display: flex;
  gap: var(--space-2);
}

footer a {
  display: inline-flex;
  min-height: var(--size-touch);
  min-width: var(--size-touch);
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

footer a:hover {
  color: var(--color-footer-link);
}

.simple-page {
  min-height: 100svh;
  padding: calc(var(--header-height) + var(--space-16)) var(--space-4) var(--space-24);
}

.simple-page .copy {
  max-width: 720px;
  margin-inline: auto;
}

.simple-page h1 {
  color: var(--color-paper);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-heading);
}

.empty {
  display: flex;
  min-height: 280px;
  align-items: center;
  justify-content: center;
  border: var(--rule) dashed var(--color-line);
  border-radius: var(--radius-md);
  color: var(--color-muted);
  text-align: center;
}

@media (min-width: 40rem) {
  .hero-content,
  .features {
    padding-inline: var(--space-6);
  }

  .hero-content {
    padding-top: calc(var(--space-24) + var(--space-6));
  }

  .features {
    gap: var(--space-32);
  }

  .feature h2 {
    font-size: var(--text-section);
    line-height: var(--leading-section);
  }

  .lead {
    font-size: var(--text-lead);
    line-height: var(--leading-lead);
  }

  .details p {
    line-height: var(--leading-detail);
  }

  footer > div {
    padding-inline: var(--space-6);
  }
}

@media (min-width: 60rem) {
  .header-nav > .nav-links {
    display: flex;
  }

  .menu {
    display: none;
  }

  .feature {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-16);
  }

  .reverse .product-shot {
    order: -1;
  }

  .section-heading {
    padding-top: calc(var(--space-8) + var(--space-1));
  }

  .ghost {
    font-size: var(--text-section-shadow);
  }
}

@media (max-width: 21.25rem) {
  #china .ghost {
    font-size: 30px;
  }
}

@media (max-width: 59.999rem) {
  .site-header {
    min-height: 64px;
  }

  .header-nav > .nav-links,
  .header-nav > .button {
    display: none;
  }

  .menu {
    display: block;
  }
}

@media (max-width: 39.999rem) {
  .site-header {
    gap: var(--space-2);
    padding-inline: var(--space-4);
  }

  .brand {
    font-size: clamp(16px, 5vw, var(--text-xl));
  }

  .brand-sub {
    margin-inline-start: var(--space-1);
    font-size: 10px;
    letter-spacing: .06em;
  }

  .language-toggle {
    min-width: 60px;
  }

  .hero-content > p:not(.eyebrow) {
    font-size: var(--text-base);
  }

  .demo-placeholder {
    margin-top: var(--space-12);
  }

  .features {
    gap: var(--space-20);
    padding-block: var(--space-24);
  }

  footer > div {
    align-items: flex-start;
    flex-direction: column;
    padding-block: var(--space-10);
  }

  footer nav {
    flex-wrap: wrap;
  }
}

@media (hover: hover) and (pointer: fine) {
  .product-shot {
    transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  }

  .product-shot:hover {
    border-color: var(--color-line);
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 50ms !important;
    scroll-behavior: auto !important;
    transition-duration: 50ms !important;
  }
}
