/* Paper Airplane MFG — site stylesheet.
   Built on the "Industry" design system from the Claude Design project:
   signal orange on charcoal and off-white, Barlow Condensed over Barlow,
   square hairline frames with "+" registration marks.
   To retune the look, edit the tokens in the two blocks below. */

/* ── Tokens: light (default) ─────────────────────────────────────────────
   Palette: #1A1C1F  #3A3F45  #6E7781  #FF6A2A  #F2F2F0
   The orange is too faint for small text on the off-white, so small accent
   text in light mode uses a deepened orange (--accent-text). Orange buttons
   carry dark text for the same reason. */
:root {
  color-scheme: light;
  --bg: #F2F2F0;
  --surface: #E6E6E3;
  --text: #1A1C1F;
  --text-2: color-mix(in srgb, var(--text) 78%, transparent);
  --text-3: color-mix(in srgb, var(--text) 58%, transparent);
  --divider: color-mix(in srgb, var(--text) 16%, transparent);
  --divider-soft: color-mix(in srgb, var(--text) 9%, transparent);
  --accent: #FF6A2A;          /* lines, marks, focus ring */
  --accent-text: #C2410C;     /* accent used as small text */
  --accent-fill: #FF6A2A;     /* primary button */
  --accent-fill-hover: #F0561A;
  --accent-fill-active: #D9480F;
  --on-accent: #1A1C1F;
  --grid-line: color-mix(in srgb, #6E7781 16%, transparent);
  --nav-bg: color-mix(in srgb, var(--bg) 82%, transparent);

  /* milling animation */
  --stock: #E1E2E2;
  --stock-edge: #B4B9BF;
  --slot: #FF6A2A;
  --slot-edge: #FAFAF8;
  --engrave: #1A1C1F;
  --tool: #6E7781;
  --tool-dark: #3A3F45;

  --font-heading: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --page-max: 1120px;
  --gutter: clamp(20px, 5vw, 64px);
  --header-h: 68px;
}

/* ── Tokens: dark ────────────────────────────────────────────────────── */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1A1C1F;
  --surface: #272A2F;
  --text: #F2F2F0;
  --accent: #FF6A2A;
  --accent-text: #FF6A2A;
  --accent-fill: #FF6A2A;
  --accent-fill-hover: #FF7F47;
  --accent-fill-active: #FF9466;
  --on-accent: #1A1C1F;
  --grid-line: color-mix(in srgb, #6E7781 20%, transparent);
  --nav-bg: color-mix(in srgb, var(--bg) 86%, transparent);

  --stock: #3A3F45;
  --stock-edge: #6E7781;
  --slot: #FF6A2A;
  --slot-edge: #1A1C1F;
  --engrave: #F2F2F0;
  --tool: #C9CDD2;
  --tool-dark: #6E7781;
}

/* ── Base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--text); }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); }

.wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent-fill); color: var(--on-accent);
  padding: 10px 16px; text-decoration: none; transition: top .15s;
}
.skip:focus { top: 12px; color: var(--on-accent); }

/* ── Blueprint frame ─────────────────────────────────────────────────── */
.blueprint { position: relative; border: 1px solid var(--divider); }
.blueprint > .corner {
  position: absolute; width: 11px; height: 11px; pointer-events: none;
  color: color-mix(in srgb, var(--text) 55%, transparent);
}
.blueprint > .corner::before, .blueprint > .corner::after {
  content: ""; position: absolute; background: currentColor;
}
.blueprint > .corner::before { left: 5px; top: 0; width: 1px; height: 100%; }
.blueprint > .corner::after  { top: 5px; left: 0; width: 100%; height: 1px; }
.blueprint > .corner.tl { top: -6px; left: -6px; }
.blueprint > .corner.tr { top: -6px; right: -6px; }
.blueprint > .corner.bl { bottom: -6px; left: -6px; }
.blueprint > .corner.br { bottom: -6px; right: -6px; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  font-family: var(--font-heading); font-weight: 600; font-size: 16px;
  letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  color: var(--text); background: transparent;
  border: 1px solid var(--divider); border-radius: 0;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.btn:hover { color: var(--text); border-color: color-mix(in srgb, var(--text) 45%, transparent); background: color-mix(in srgb, var(--text) 6%, transparent); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); color: var(--on-accent); }
.btn-primary:active { background: var(--accent-fill-active); }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ── Header ──────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--divider);
}
.nav { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }
.brand {
  display: inline-flex; align-items: center; gap: 10px; margin-right: auto;
  font-family: var(--font-heading); font-weight: 600; font-size: 20px;
  letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none;
  color: var(--text); white-space: nowrap;
}
.brand svg { width: 24px; height: 24px; color: var(--accent-text); flex: none; }
.brand:hover { color: var(--text); }
.nav .btn { gap: .3em; }
.nav-link { padding: 10px 12px; font-size: 15px; font-weight: 500; text-decoration: none; color: var(--text); }
.nav-link:hover { color: var(--accent-text); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  background: transparent; color: var(--text); cursor: pointer;
  border: 1px solid var(--divider); border-radius: 0;
  transition: background-color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: color-mix(in srgb, var(--text) 6%, transparent); border-color: color-mix(in srgb, var(--text) 45%, transparent); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
.nav-link[aria-current="page"] { color: var(--accent-text); box-shadow: inset 0 -1px 0 var(--accent); }
@media (max-width: 760px) {
  .nav { gap: 8px; }
  .nav-wide { display: none; }
  .nav-link { padding: 10px 6px; }
  .brand { font-size: 17px; gap: 8px; }
  .brand svg { width: 20px; height: 20px; }
  .nav .btn { padding: 10px 12px; }
  .nav .btn .long { display: none; }
}
@media (max-width: 420px) { .theme-toggle { display: none; } }

/* ── Sections ────────────────────────────────────────────────────────── */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.eyebrow {
  display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
  font-family: var(--font-heading); font-weight: 600; font-size: 14px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text);
  white-space: nowrap;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--divider); }
.section-title { font-size: clamp(32px, 4.4vw, 52px); }
.lede { font-size: 18px; line-height: 1.65; max-width: 58ch; color: var(--text-2); margin-top: 16px; }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--divider); background: var(--bg); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 90% 90% at 75% 45%, #000 20%, transparent 78%);
          mask-image: radial-gradient(ellipse 90% 90% at 75% 45%, #000 20%, transparent 78%);
}
.hero-inner {
  position: relative; display: grid; align-items: center;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(24px, 4vw, 64px);
  padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(40px, 6vw, 80px);
}
.hero h1 { font-size: clamp(38px, 4.5vw, 60px); line-height: 1.04; letter-spacing: 0.01em; }
.hero h1 span { display: block; }
.hero h1 .accent { color: var(--accent-text); }
.hero p { font-size: 18px; line-height: 1.65; max-width: 46ch; margin-top: 24px; color: var(--text-2); }
.hero .btn-row { margin-top: 32px; }
.hero-kicker {
  display: block; margin-bottom: 20px;
  font-family: var(--font-heading); font-weight: 600; font-size: 14px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text);
}

@media (min-width: 861px) {
  .hero { min-height: min(720px, calc(100vh - var(--header-h))); display: grid; align-items: center; }
  .hero-inner { width: 100%; }
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .mill { max-width: 460px; margin: 8px auto 0; width: 100%; }
}

/* ── Milling animation ───────────────────────────────────────────────── */
.mill-stage { position: relative; }
.mill.live .mill-stage { cursor: pointer; }
.mill svg { width: 100%; height: auto; overflow: visible; }
.mill canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mill .stock { fill: var(--stock); stroke: var(--stock-edge); stroke-width: 1.5; }
.mill .bolt { fill: var(--bg); stroke: var(--stock-edge); stroke-width: 1.5; }
.mill .bolt-hex { fill: none; stroke: var(--stock-edge); stroke-width: 1.2; }
.mill .slot-edge, .mill .slot { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mill .slot-edge { stroke: var(--slot-edge); stroke-width: 15; opacity: .9; }
.mill .slot { stroke: var(--slot); stroke-width: 11; }
.mill .engrave {
  font-family: var(--font-heading); font-weight: 600; font-size: 21px; letter-spacing: 0.22em;
  fill: var(--engrave); text-anchor: middle;
}
.mill .tool { display: none; }
.mill .tool-shadow { fill: #000; opacity: .18; }
.mill .tool-holder { fill: var(--tool); stroke: var(--tool-dark); stroke-width: 1.5; stroke-linejoin: round; }
.mill .tool-shank { fill: color-mix(in srgb, var(--tool) 55%, var(--bg)); stroke: var(--tool-dark); stroke-width: 1.5; stroke-linejoin: round; }
.mill .tool-tip { fill: var(--tool-dark); }
/* Sliding the diagonal flute lines along the tool reads as the cutter spinning. */
.mill .tool-helix { fill: none; stroke: var(--tool-dark); stroke-width: 2.6; animation: helix .16s linear infinite; }
@keyframes helix { to { transform: translateY(9px); } }

/* Animated states (main.js adds .live, then .done when the cut finishes) */
/* Only opacity may transition here: a transition on transform would make the
   cutter trail behind the position the script gives it. */
.mill.live .tool { display: block; transition: opacity .4s ease; }
.mill.live .engrave { opacity: 0; transition: opacity .7s ease .15s; }
.mill.live.done .engrave { opacity: 1; }
.mill.live.done .tool { opacity: 0; }
.mill.live.done .tool-helix { animation-play-state: paused; }

.dro {
  display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; margin-top: 14px;
  font-family: var(--font-heading); font-weight: 600; font-size: 14px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.dro .bar { flex: 1; min-width: 60px; height: 2px; background: var(--divider); position: relative; }
.dro .bar i { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.dro #dro-x, .dro #dro-y { min-width: 6ch; }
.dro .hint { color: var(--accent-text); text-align: right; }
.dro .replay {
  font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer;
  min-height: 32px; padding: 4px 12px; color: var(--accent-text); background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 0;
  transition: background-color .15s ease, color .15s ease;
}
.dro .replay:hover { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.dro .bar { min-width: 40px; }
.mill:not(.live) .dro { display: none; }

/* ── Capabilities ────────────────────────────────────────────────────── */
.cap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px); margin-top: clamp(32px, 4vw, 48px); }
.cap { padding: 28px; transition: border-color .2s ease; }
.cap:hover { border-color: var(--accent); }
.cap:hover > .corner { color: var(--accent); }
.cap-wide { grid-column: 1 / -1; }
.cap-head { display: flex; align-items: center; gap: 14px; }
.cap-head svg { width: 28px; height: 28px; color: var(--accent-text); flex: none; }
.cap-head h3 { font-size: 26px; }
.cap-list { list-style: none; margin: 20px 0 0; padding: 0; }
.cap-list li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 14px 0; border-top: 1px solid var(--divider-soft); }
.cap-list li:last-child { padding-bottom: 0; }
.cap-list strong { font-family: var(--font-heading); font-weight: 600; font-size: 19px; letter-spacing: 0.03em; text-transform: uppercase; }
.cap-list span { color: var(--text-2); font-size: 15px; }
.cap-wide .cap-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 28px; }
.cap-wide .cap-list li { border-top: 1px solid var(--divider-soft); padding-bottom: 0; }
@media (max-width: 900px) { .cap-wide .cap-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .cap-grid { grid-template-columns: 1fr; }
  .cap-wide .cap-list { grid-template-columns: 1fr; }
  .cap { padding: 22px; }
}

.cap-text { margin-top: 18px; color: var(--text-2); max-width: 70ch; }
.tags { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tags li {
  padding: 6px 14px; font-family: var(--font-heading); font-weight: 600; font-size: 16px;
  letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
}

/* ── Parts gallery ───────────────────────────────────────────────────── */
.page-head { padding: clamp(48px, 6vw, 80px) 0 clamp(8px, 2vw, 24px); }
.page-head h1 { font-size: clamp(40px, 5.4vw, 68px); line-height: 1.04; }
.parts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: clamp(28px, 3.4vw, 48px); }
.figure {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1; overflow: visible; margin: 0; padding: 0;
  background: transparent; color: inherit; font: inherit;
  transition: border-color .2s ease;
}
button.figure { cursor: zoom-in; }
.figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.figure .clip { position: absolute; inset: 0; overflow: hidden; }
.part:hover .figure img, a.figure:hover img { transform: scale(1.04); }
.figure .ph { width: 34%; height: auto; color: var(--accent); opacity: .45; }
.figure .fig-tag {
  position: absolute; left: 12px; bottom: 10px;
  font-family: var(--font-heading); font-weight: 600; font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3);
}
.part:hover .figure { border-color: var(--accent); }
.part:hover .figure > .corner { color: var(--accent); }
.part h2 { font-size: 22px; margin-top: 20px; }
/* an entry with two photos takes two columns, the photos side by side */
.part-wide { grid-column: span 2; }
.part-wide h2, .part-wide .part-note { text-align: center; }
.part-wide .part-note { margin-left: auto; margin-right: auto; }
.part-photos { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 3.4vw, 48px); }
@media (max-width: 700px) { .part-wide { grid-column: auto; } .part-photos { gap: 16px; } }
.spec { display: grid; grid-template-columns: max-content 1fr; gap: 2px 18px; margin: 10px 0 0; font-size: 15px; line-height: 1.7; }
.spec dt { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); padding-top: 3px; }
.spec dd { margin: 0; }
.part-note { margin-top: 8px; font-size: 16px; line-height: 1.55; color: var(--text-2); max-width: 46ch; }
.cta { padding: clamp(28px, 4vw, 44px); display: flex; flex-wrap: wrap; gap: 20px 48px; align-items: center; justify-content: space-between; }
.cta h2 { font-size: clamp(28px, 3.6vw, 40px); }
.cta p { margin-top: 8px; color: var(--text-2); }
.more { margin-top: clamp(28px, 4vw, 44px); }
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); margin-top: clamp(32px, 4vw, 48px); }
.work-grid .figure { aspect-ratio: 4 / 3; }
a.figure:hover { border-color: var(--accent); }
a.figure:hover > .corner { color: var(--accent); }
@media (max-width: 620px) { .work-grid { grid-template-columns: 1fr 1fr; } .work-grid .figure:nth-child(3) { display: none; } }

.viewer { padding: 0; border: 1px solid var(--divider); background: var(--bg); color: var(--text); max-width: min(1100px, 94vw); }
.viewer::backdrop { background: rgba(8, 11, 14, .78); }
.viewer figure { margin: 0; }
.viewer img { max-width: 100%; max-height: 80vh; margin: 0 auto; }
.viewer figcaption { padding: 14px 64px 14px 18px; font-family: var(--font-heading); font-weight: 600; font-size: 18px; letter-spacing: 0.04em; text-transform: uppercase; }
.viewer-close { position: absolute; right: 8px; bottom: 6px; background: var(--bg); }

/* ── Quote email builder ─────────────────────────────────────────────── */
.quote { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.attach { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.attach li { display: flex; align-items: center; gap: 14px; font-size: 16px; }
.attach .ext {
  flex: none; min-width: 64px; padding: 5px 8px; text-align: center;
  font-family: var(--font-heading); font-weight: 600; font-size: 15px; letter-spacing: 0.08em;
  color: var(--accent-text); border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
}
.form { display: grid; gap: 20px; padding: 28px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field > label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 7px; color: var(--text-2); }
.input {
  width: 100%; min-height: 46px; padding: 10px 12px;
  font: inherit; font-size: 16px; color: var(--text); caret-color: var(--accent);
  background: var(--surface); border: 1px solid var(--divider); border-radius: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: color-mix(in srgb, var(--text) 42%, transparent); }
.input:hover { border-color: color-mix(in srgb, var(--text) 45%, transparent); }
.input:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
textarea.input { min-height: 132px; resize: vertical; }
.form-note { font-size: 14px; color: var(--text-3); }
.form-status { font-size: 15px; color: var(--text-2); border-left: 2px solid var(--accent); padding: 4px 0 4px 12px; }
@media (max-width: 860px) { .quote { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } .form { padding: 22px; } }

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--divider); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: center; justify-content: space-between; padding-top: 28px; padding-bottom: 28px; font-size: 14px; color: var(--text-3); }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }

/* ── Scroll reveal ───────────────────────────────────────────────────── */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1), border-color .2s ease; transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
