/* =========================================================
   RHEA — design tokens
   System: Apple-style product tiles (see DESIGN.md).
   Full-bleed sections alternate white / parchment / near-black and
   the color change is the divider. One Action Blue carries every
   interactive element and nothing else. No decorative borders or
   shadows — the single product shadow sits under the rotor render.
   ========================================================= */
:root {
  color-scheme: light;

  /* color — action */
  --color-primary: #0066cc;
  --color-primary-focus: #0071e3;
  --color-primary-on-dark: #2997ff;
  --color-on-primary: #ffffff;

  /* color — text */
  --color-ink: #1d1d1f;
  --color-ink-muted-80: #333333;
  /* DESIGN.md's ink-muted-48 (#7a7a7a) is ~4.3:1 on white — just under AA
     for body-size text, and it backs the "사양 확정 예정" markers that carry
     real meaning. #6e6e73 (Apple's own secondary label gray) clears 5:1. */
  --color-ink-secondary: #6e6e73;
  --color-on-dark: #ffffff;
  --color-body-muted: #cccccc;

  /* color — surfaces */
  --color-canvas: #ffffff;
  --color-parchment: #f5f5f7;
  --color-pearl: #fafafc;
  --color-tile-1: #272729;
  --color-tile-2: #2a2a2c;
  --color-tile-3: #252527;
  --color-black: #000000;

  /* color — lines */
  --color-divider-soft: #f0f0f0;
  --color-hairline: #e0e0e0;
  --color-field-border: #d2d2d7;
  --color-hairline-on-dark: rgba(255, 255, 255, 0.12);

  /* DESIGN.md surfaces no error state (Known Gaps); Apple's system red. */
  --color-error: #e30000;
  --color-success: #248a3d;

  /* type — system-ui resolves to SF Pro (and Apple SD Gothic Neo for
     Hangul) on Apple devices; Pretendard covers Hangul elsewhere. */
  --font-sans: -apple-system, BlinkMacSystemFont, system-ui, "Pretendard Variable", "Pretendard", "Segoe UI", "Malgun Gothic", sans-serif;

  /* shape */
  --radius-sm: 8px;    /* compact utility */
  --radius-md: 11px;   /* pearl capsule, form fields */
  --radius-lg: 18px;   /* utility cards */
  --radius-pill: 9999px; /* every action */

  /* the one shadow in the system — product renders only */
  --shadow-product: 3px 5px 30px rgba(0, 0, 0, 0.22);

  /* layout */
  --container: 1068px;
  --container-text: 980px;
  --gutter: clamp(1rem, 4vw, 1.5rem);
  --section: clamp(3rem, 8vw, 5rem); /* 80px desktop → 48px small phone */

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 160ms;
  --dur-med: 420ms;
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-canvas);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 17px;          /* Apple runs body at 17px, not 16px */
  line-height: 1.47;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all; /* Hangul wraps at word boundaries, not mid-word */
  overflow-wrap: anywhere;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure { margin: 0; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: color-mix(in srgb, var(--color-primary) 22%, transparent); }
:focus-visible {
  outline: 2px solid var(--color-primary-focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -3rem;
  background: var(--color-canvas);
  color: var(--color-primary);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-pill);
  transition: top var(--dur-fast) var(--ease-out);
  z-index: 100;
}
.skip-link:focus { top: 0.5rem; }

/* =========================================================
   Type — weights 300 / 400 / 600 / 700 only; 500 is absent
   ========================================================= */
h1, h2, h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: inherit;
}
h1 {
  font-size: clamp(1.75rem, 1.1rem + 2.9vw, 3.5rem); /* 28px → 56px */
  line-height: 1.1;
  letter-spacing: -0.02em;
}
h2 {
  font-size: clamp(1.75rem, 1.35rem + 1.7vw, 2.5rem); /* display-lg 40px */
  line-height: 1.12;
  letter-spacing: -0.015em;
}
h3 {
  font-size: 1.3125rem; /* tagline 21px */
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p { color: var(--color-ink-secondary); }

.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Section heads sit centered atop each tile, like a product tile's name + tagline. */
.section-inner > h2,
.section-inner > .section-lede { text-align: center; margin-left: auto; margin-right: auto; }
.section-lede {
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.3125rem);
  line-height: 1.38;
  max-width: 40ch;
  margin-top: 0.75rem;
}

.spec-table, .pending-value, .rotor-caption {
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   Buttons — the pill is the action signal; press = scale(0.95)
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.btn:active { transform: scale(0.95); }
.btn-accent {
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.btn-accent:hover { background: var(--color-primary-focus); }

/* button-secondary-pill: the ghost pill */
.btn-ghost {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-ghost:hover { background: var(--color-primary); color: var(--color-on-primary); }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* =========================================================
   Header — the slim black global nav (44px)
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: var(--color-on-dark);
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  min-height: 44px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 2rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--color-on-dark);
}
.wordmark-mark { width: 18px; height: 18px; }

.main-nav {
  display: none;
  gap: 2.25rem;
  margin: 0 auto;
  font-size: 12px;
  letter-spacing: -0.01em;
}
.main-nav a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  transition: color var(--dur-fast) var(--ease-out);
}
.main-nav a:hover { color: var(--color-on-dark); }

/* The sub-nav "Buy" pill, scaled to the global nav. */
.header-cta {
  display: none;
  min-height: 28px;
  padding: 4px 12px;
  font-size: 12px;
}

.nav-toggle {
  margin-left: auto;
  width: 44px; height: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 17px; height: 1.2px;
  background: var(--color-on-dark);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  padding: 0.5rem var(--gutter) 1.5rem;
  background: var(--color-black);
}
/* :not(.btn) keeps this from overriding the CTA button's own text color. */
.mobile-nav a:not(.btn) {
  text-decoration: none;
  color: var(--color-on-dark);
  font-size: 1.3125rem;
  font-weight: 600;
  padding: 0.6rem 0;
}
.mobile-nav .btn { align-self: flex-start; margin-top: 1rem; }
.mobile-nav[hidden] { display: none; }

@media (min-width: 834px) {
  .main-nav { display: flex; }
  .header-cta { display: inline-flex; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
}

/* =========================================================
   Hero — product-tile-light: centered name → tagline → two
   pills → the rotor render resting on the surface
   ========================================================= */
.hero {
  background: var(--color-canvas);
  padding: clamp(3.5rem, 8vw, 5.5rem) 0 var(--section);
}
.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(2.5rem, 6vw, 3.5rem);
}
.hero-copy { display: flex; flex-direction: column; align-items: center; }
.hero-lede {
  margin-top: 1rem;
  font-size: clamp(1.1875rem, 1rem + 0.9vw, 1.75rem); /* lead 28px */
  line-height: 1.25;
  color: var(--color-ink);
  max-width: 30ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.75rem;
}
.hero-footnote {
  margin-top: 1.5rem;
  font-size: 14px;
  line-height: 1.43;
  max-width: 44ch;
}

.hero-figure { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
/* The one product shadow: the rotor is the "render" resting on the tile. */
.rotor-diagram {
  width: min(100%, 420px);
  color: var(--color-ink);
  filter: drop-shadow(var(--shadow-product));
}
.rotor-caption {
  font-size: 14px;
  color: var(--color-ink-secondary);
}
.pending-value { color: var(--color-ink-secondary); }

.rotor-baseplate { fill: var(--color-parchment); stroke: none; }
.dim-circle { fill: none; stroke: var(--color-field-border); stroke-width: 1; stroke-dasharray: 2 4; }
.rotor-ring { fill: var(--color-canvas); stroke: var(--color-ink); stroke-width: 1.4; }
.rotor-ring-inner { fill: none; stroke: var(--color-ink-secondary); }
.rotor-slots circle { fill: var(--color-parchment); stroke: var(--color-ink); stroke-width: 1.2; }
.rotor-hub { fill: var(--color-ink); }
.dim-line line { stroke: var(--color-ink-secondary); stroke-width: 1; }

.rotor-spin {
  transform-origin: 210px 210px;
  animation: rotor-rotate 22s linear infinite;
}
@keyframes rotor-rotate {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .rotor-spin { animation: none; }
}

/* =========================================================
   Principles — parchment tile of white utility cards
   ========================================================= */
.principles { background: var(--color-parchment); padding: var(--section) 0; }
.principles h2 { margin-bottom: clamp(2rem, 5vw, 3rem); }

.spine {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  counter-reset: principle;
}
@media (min-width: 640px) {
  .spine { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1068px) {
  .spine { grid-template-columns: repeat(4, 1fr); }
}
.spine-line { display: none; }

.spine-item {
  counter-increment: principle;
  background: var(--color-canvas);
  border-radius: var(--radius-lg);
  padding: 28px 24px 32px;
}
.spine-tick {
  display: block;
  margin-bottom: 1.75rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink-secondary);
}
.spine-tick::before { content: "0" counter(principle); }
.spine-item h3 { margin-bottom: 0.6rem; }
.spine-item p { font-size: 15px; line-height: 1.47; }

/* =========================================================
   Spec table — white tile, hairline rows, centered column
   ========================================================= */
.specs { background: var(--color-canvas); padding: var(--section) 0; }

.spec-table {
  margin: clamp(2rem, 5vw, 3rem) auto 0;
  width: 100%;
  max-width: 760px;
  border-collapse: collapse;
}
.spec-table tr { border-bottom: 1px solid var(--color-hairline); }
.spec-table th, .spec-table td {
  text-align: left;
  padding: 18px 0;
  vertical-align: top;
}
.spec-table th {
  width: 40%;
  padding-right: 1.5rem;
  font-weight: 600;
  color: var(--color-ink);
}
.spec-table td { font-weight: 400; color: var(--color-ink); }

/* =========================================================
   Workflow — product-tile-dark
   ========================================================= */
.workflow { background: var(--color-tile-1); color: var(--color-on-dark); padding: var(--section) 0; }
.workflow p { color: var(--color-body-muted); }

.workflow-diagram {
  margin-top: clamp(2rem, 5vw, 3rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  counter-reset: step;
}
@media (min-width: 640px) {
  .workflow-diagram { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1068px) {
  .workflow-diagram { grid-template-columns: repeat(4, 1fr); }
}
.workflow-step {
  counter-increment: step;
  background: var(--color-tile-3);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: 28px 24px 32px;
}
.workflow-step-active {
  background: var(--color-canvas);
  color: var(--color-ink);
}
.workflow-step-active p { color: var(--color-ink-secondary); }
.workflow-dot {
  display: block;
  margin-bottom: 1.75rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-body-muted);
}
.workflow-step-active .workflow-dot { color: var(--color-ink-secondary); }
.workflow-dot::before { content: "STEP 0" counter(step); }
.workflow-step h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.workflow-tag {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--color-ink);
  background: var(--color-parchment);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.workflow-step p { font-size: 15px; }

/* =========================================================
   Certifications — dark tile, a micro-step off the one above
   ========================================================= */
.certifications {
  background: var(--color-tile-3);
  color: var(--color-on-dark);
  padding: var(--section) 0;
  border-top: 1px solid var(--color-hairline-on-dark);
}
.cert-panel {
  margin: clamp(1.5rem, 4vw, 2rem) auto 0;
  max-width: 40rem;
  text-align: center;
}
.cert-panel p { color: var(--color-body-muted); margin: 0 auto; }
.cert-panel p:first-child {
  color: var(--color-on-dark);
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.3125rem);
  line-height: 1.38;
}
.cert-note { margin-top: 1.25rem; font-size: 14px; max-width: 46ch; }

/* =========================================================
   Contact — white tile; form fields in 11px capsules
   ========================================================= */
.contact { background: var(--color-canvas); padding: var(--section) 0; }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 0.9fr 1.1fr; }
}
.contact-intro p { margin-top: 1rem; max-width: 40ch; }
.contact-detail { margin-top: 1.5rem; font-size: 14px; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--color-parchment);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2rem);
}
.form-row { display: flex; flex-direction: column; gap: 0.4rem; }
.form-row-split { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 480px) {
  .form-row-split { grid-template-columns: 1fr 1fr; }
}
.form-row-split > div { display: flex; flex-direction: column; gap: 0.4rem; }
label { font-size: 14px; font-weight: 600; color: var(--color-ink); }
input, textarea {
  min-height: 44px;
  border: 1px solid var(--color-field-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  background: var(--color-canvas);
  font-size: 17px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary-focus) 30%, transparent);
}
/* Never flag an untouched required field as an error. Only mark it once the
   visitor has interacted with it (:user-invalid, where supported) or after
   a submit attempt has run validation (.was-validated, set by main.js). */
input:user-invalid, textarea:user-invalid { border-color: var(--color-error); }
.contact-form.was-validated input:invalid,
.contact-form.was-validated textarea:invalid { border-color: var(--color-error); }
textarea { resize: vertical; min-height: 6.5rem; }
.form-submit { margin-top: 0.5rem; align-self: flex-start; }
.form-status { font-size: 14px; min-height: 1.2em; }
.form-status[data-state="success"] { color: var(--color-success); }
.form-status[data-state="error"] { color: var(--color-error); }

/* =========================================================
   Footer — parchment, dense and quiet
   ========================================================= */
.site-footer { background: var(--color-parchment); padding: 2.5rem 0 3rem; color: var(--color-ink-muted-80); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-field-border);
}
.wordmark-footer { font-weight: 600; font-size: 14px; letter-spacing: 0.06em; color: var(--color-ink); }
.footer-tagline { margin-top: 0.35rem; font-size: 12px; }
.footer-meta { font-size: 12px; color: var(--color-ink-secondary); }

/* =========================================================
   Scroll-reveal (JS adds .js-reveal, then .is-visible)
   Content is visible by default; JS opts a root into the
   hide-then-reveal treatment only once it is actually running,
   so a script failure never leaves content hidden.
   ========================================================= */
[data-reveal-root].js-reveal .spine-item,
[data-reveal-root].js-reveal .workflow-step {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}
[data-reveal-root].js-reveal.is-visible .spine-item,
[data-reveal-root].js-reveal.is-visible .workflow-step { opacity: 1; transform: none; }
[data-reveal-root] > :nth-child(2 of .spine-item, .workflow-step) { transition-delay: 60ms; }
[data-reveal-root] > :nth-child(3 of .spine-item, .workflow-step) { transition-delay: 120ms; }
[data-reveal-root] > :nth-child(4 of .spine-item, .workflow-step) { transition-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:active { transform: none; }
  .spine-item, .workflow-step {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
