/* Lefthand Studio. Every style for bylefthand.com lives here.
   Tokens come from the Lefthand Studio design system (tokens.json, v1).
   Single look on purpose: the brand runs light, on truss. Dark is a slab, never a theme. */

:root {
  color-scheme: light;

  /* Color: from the load-in */
  --truss: #C4CBD1;
  --truss-100: #E1E5E9; /* truss lightened for the web ground. Not in the system yet */
  --selvedge: #1C2B4B;
  --gaffer: #141414;
  --spike: #FF5B1F;
  --spike-hover: #FF7442;
  --steel-500: #97A0A8;
  --steel-600: #7D868E;
  --steel-800: #3A3F45;
  --error: #8A1414; /* not in the system yet. 5.85:1 on truss */

  /* Roles */
  --ground: var(--truss-100);
  --ink: var(--gaffer);
  --heading: var(--selvedge);
  --muted: var(--steel-800);
  --rule: var(--gaffer);
  --hairline: var(--steel-500);
  --field: var(--selvedge);
  --on-field: var(--truss);
  --on-spike: var(--gaffer);

  /* Type */
  --display: Archivo, "Arial Black", sans-serif;
  --read: Newsreader, Georgia, serif;
  --spec: "IBM Plex Mono", ui-monospace, monospace;

  /* Space */
  --s10: 10px; --s14: 14px; --s16: 16px; --s24: 24px; --s28: 28px;
  --s40: 40px; --s56: 56px; --s64: 64px;

  --side: max(64px, env(safe-area-inset-left, 0px));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--read);
  font-size: 17px;
  line-height: 1.35;
  font-variant-numeric: lining-nums;
}
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
p, h1, h2, h3, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: var(--heading); text-underline-offset: 4px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--selvedge); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Type styles */
h1, h2, h3, .d { font-family: var(--display); font-stretch: 125%; font-weight: 800; color: var(--heading); text-wrap: balance; }
h1, h2 { font-size: 40px; line-height: 1.02; }
h3 { font-size: 24px; line-height: 1.05; }
.display-xl { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 112px; line-height: 0.9; }
.subhead { font-family: var(--display); font-stretch: 125%; font-weight: 500; font-size: 40px; line-height: 1.1; }
.line { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 24px; line-height: 1.05; color: var(--heading); }
.deck { font-size: 30px; line-height: 1.25; }
.lead { font-size: 22px; line-height: 1.3; }
.body-lg { font-size: 19px; line-height: 1.38; }
.body-sm { font-size: 16px; line-height: 1.32; }
.caption { font-size: 15px; line-height: 1.35; font-style: italic; color: var(--muted); }
.spec { font-family: var(--spec); font-size: 14px; line-height: 1.3; }
.label { font-family: var(--spec); font-size: 12px; line-height: 1.3; color: var(--muted); }
.wordmark { font-family: var(--display); font-stretch: 125%; font-weight: 800; letter-spacing: -0.01em; line-height: 0.82; color: var(--heading); }

/* Layout */
.wrap { max-width: 1280px; margin: 0 auto; padding-left: var(--side); padding-right: max(64px, env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: 16px; top: -60px; background: var(--gaffer); color: var(--truss); padding: 12px 16px; font-family: var(--spec); font-size: 14px; z-index: 10; }
.skip:focus { top: 16px; color: var(--truss); }

/* Header and nav. One component, every page. */
/* Header: a selvedge band like the Etsy shop banner. Spike mark, truss wordmark and nav */
.top-band { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--field); color: var(--on-field); }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s40); padding-top: var(--s24); padding-bottom: var(--s24); }
.home { display: flex; align-items: flex-end; gap: var(--s14); text-decoration: none; color: var(--on-field); }
.home .mark { color: var(--spike); }
.home .wordmark { color: var(--on-field); }
.top-band :focus-visible { outline-color: var(--on-field); }
.home .wordmark { font-size: 18px; line-height: 1; }
.mark rect { fill: currentColor; }
.nav { display: flex; flex-wrap: wrap; gap: var(--s24); font-family: var(--spec); font-size: 14px; }
.nav a { color: var(--on-field); text-decoration: none; padding-block: 12px; }
.nav a:hover { color: var(--on-field); }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; }

/* Hero: selvedge field, content pinned lower left, top right empty */
.hero { background: var(--field); color: var(--on-field); }
.hero a:not(.btn) { color: var(--on-field); }
.hero .wrap { min-height: 560px; padding-top: 120px; padding-bottom: var(--s56); display: flex; flex-direction: column; justify-content: flex-end; }
.hero-in { display: flex; align-items: flex-end; gap: var(--s40); }
.hero-in > .mark { color: var(--spike); flex-shrink: 0; }
.hero-copy { display: flex; flex-direction: column; gap: var(--s24); max-width: 820px; min-width: 0; }
.hero h1, .hero .display-xl { color: var(--on-field); }
.hero .hero-h { font-size: clamp(40px, 5.6vw, 72px); line-height: 0.96; max-width: 15ch; }

/* Sections: a 2px rule opens each, 4fr heading and 8fr content */
.sec-outer { padding-top: var(--s56); }
[id] { scroll-margin-top: 72px; }
.sec { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: var(--s56); row-gap: var(--s24); border-top: 2px solid var(--rule); padding-top: var(--s24); }
.sec > * { min-width: 0; }
.sec.full { grid-template-columns: minmax(0, 1fr); }
.sec-head { display: flex; flex-direction: column; gap: var(--s14); }
.col { display: flex; flex-direction: column; gap: var(--s24); }
.prose { display: flex; flex-direction: column; gap: var(--s14); max-width: 680px; }

/* Spec rows: 200px label column, hairline under every row but the last */
.row { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: var(--s16); padding: var(--s14) 0; border-bottom: 1px solid var(--hairline); }
.row:last-child { border-bottom: 0; }
.row > dt, .row > .n { font-family: var(--spec); font-size: 12px; line-height: 1.3; color: var(--muted); padding-top: 4px; }
.row > .n.spec { font-size: 14px; padding-top: 2px; }

/* Booth studies: two square drawings side by side, caption under each */
.studies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s40); }
.studies figure { display: flex; flex-direction: column; gap: var(--s10); min-width: 0; }
.studies img { width: 100%; height: auto; aspect-ratio: 1 / 1; border: 1px solid var(--gaffer); background: var(--truss); }
.studies figcaption { display: flex; flex-wrap: wrap; gap: 4px var(--s14); align-items: baseline; }
.studies figcaption .spec { color: var(--muted); }

/* Questions: question over answer, hairline between */
.qa > div { display: flex; flex-direction: column; gap: 4px; padding: var(--s14) 0; border-bottom: 1px solid var(--hairline); }
.qa > div:last-child { border-bottom: 0; }
.qa dt { font-size: 19px; line-height: 1.38; font-weight: 500; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; padding: 0 var(--s16) var(--s10) 0; border-bottom: 1px solid var(--rule); font-family: var(--spec); font-size: 12px; font-weight: 400; color: var(--muted); vertical-align: bottom; }
td { padding: var(--s14) var(--s16) var(--s14) 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th:last-child, td:last-child { padding-right: 0; }
.num { text-align: right; font-family: var(--spec); font-size: 14px; white-space: nowrap; }

/* Kit table: piece, what it covers, file name in mono */
.kit td:first-child { font-weight: 500; white-space: nowrap; }
.kit .file { font-family: var(--spec); font-size: 14px; color: var(--muted); white-space: nowrap; }

/* Says table: what the category says, what Lefthand says */
.says td:first-child { color: var(--muted); font-style: italic; width: 46%; }
.says td:last-child { font-family: var(--display); font-stretch: 125%; font-weight: 500; font-size: 19px; line-height: 1.2; color: var(--heading); }

/* Index: the work list. A row per offer, the whole row is the link */
.index { border-top: 1px solid var(--rule); }
.index li { border-bottom: 1px solid var(--hairline); }
.index li:last-child { border-bottom: 0; }
.ix { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 5fr) minmax(0, 3fr); column-gap: var(--s24); align-items: baseline; padding: var(--s24) 0; color: var(--ink); text-decoration: none; }
a.ix:hover .ix-t { text-decoration: underline; text-decoration-thickness: 2px; }
a.ix:hover .ix-go { transform: translateX(4px); }
.ix-t { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 32px; line-height: 1.02; color: var(--heading); text-underline-offset: 6px; }
.ix-d { font-size: 17px; line-height: 1.35; }
.ix-p { font-family: var(--spec); font-size: 14px; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ix-s { font-size: 12px; color: var(--muted); }
.ix-go { display: inline-block; transition: transform 120ms ease-out; }
@media (prefers-reduced-motion: reduce) { .ix-go { transition: none; } }

/* Run of show: a horizontal band, one column per stage */
/* Each stage spans 3 shared rows (label, heading, text), so headings line up even when a label wraps */
.run { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: auto auto auto; border-top: 1px solid var(--rule); }
.run li { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: var(--s10); align-content: start; padding: var(--s14) var(--s16) 0 0; border-left: 0; }
.run li + li { padding-left: var(--s16); border-left: 1px solid var(--hairline); }
.run .t { font-family: var(--spec); font-size: 14px; color: var(--muted); }
.run h3 { font-size: 20px; }

/* Buttons */
.btn { display: inline-block; background: var(--spike); color: var(--on-spike); text-decoration: none; font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 18px; line-height: 1; padding: 17px 24px; border: 0; border-radius: 0; cursor: pointer; }
.btn:hover { background: var(--spike-hover); color: var(--on-spike); }
.hero .btn:focus-visible { outline-color: var(--truss); outline-offset: 3px; }
.btn[disabled] { cursor: progress; opacity: 0.75; }
/* Form send buttons run inverted: spike text on gaffer, spike fill on hover */
.send .btn { background: var(--gaffer); color: var(--spike); }
.send .btn:hover { background: var(--spike); color: var(--on-spike); }

/* Contact: the address set as a headline link */
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s14) var(--s16); }
.btn-line { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 14px; line-height: 1; padding: 12px 14px; min-height: 44px; background: transparent; color: var(--heading); border: 2px solid var(--heading); border-radius: 0; cursor: pointer; }
.btn-line:hover { background: var(--heading); color: var(--on-field); }
.mailto { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 24px; line-height: 1.02; color: var(--heading); text-decoration: underline; text-decoration-thickness: 2px; overflow-wrap: anywhere; }

/* Forms */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s40); row-gap: var(--s24); }
.f { display: flex; flex-direction: column; gap: var(--s10); min-width: 0; }
.f.full, .form .full { grid-column: 1 / -1; }
.f label { font-family: var(--spec); font-size: 12px; line-height: 1.3; color: var(--muted); }
.fi { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--gaffer); border-radius: 0; background: var(--ground); color: var(--ink); font-family: var(--read); font-size: 17px; line-height: 1.35; -webkit-appearance: none; appearance: none; }
select.fi { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23141414' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
textarea.fi { resize: vertical; min-height: 140px; }
.fi:focus { outline: 2px solid var(--selvedge); outline-offset: 2px; }
.fi[aria-invalid="true"] { border: 2px solid var(--error); padding: 11px 13px; }
.err { font-family: var(--spec); font-size: 12px; line-height: 1.3; color: var(--error); }
.err:empty { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.send { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s24); }
.status { font-size: 15px; line-height: 1.35; font-style: italic; color: var(--muted); }
.status.bad { color: var(--error); font-style: normal; font-family: var(--spec); font-size: 14px; }
.sent { display: flex; flex-direction: column; gap: var(--s14); border-top: 2px solid var(--rule); padding-top: var(--s24); }
.sent:focus { outline: none; }

/* Footer: the wordmark at full width, the line beneath it */
/* Footer: the Etsy banner. Selvedge field, spike mark, truss wordmark, the line beneath, mono spec at right */
.end { margin-top: 120px; background: var(--field); color: var(--on-field); }
.end-in { padding-top: var(--s64); padding-bottom: var(--s56); display: flex; flex-direction: column; gap: var(--s28); }
.end-mark { display: flex; align-items: flex-end; gap: var(--s28); }
.end-mark .mark { color: var(--spike); }
.end-mark .wordmark { color: var(--on-field); }
.end .line { color: var(--on-field); }
.end a { color: var(--on-field); }
.end a:hover { color: var(--on-field); text-decoration-thickness: 2px; }
.end :focus-visible { outline-color: var(--on-field); }
.end-mark .wordmark { font-size: clamp(56px, 14.5vw, 196px); }
.end-mark .mark { width: clamp(30px, 6vw, 80px); height: auto; flex-shrink: 0; }
.end-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--s24); }
.end-meta .spec { color: var(--on-field); }

/* The no-JS reply page from the function */
.reply { min-height: 70vh; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--s24); padding-bottom: var(--s56); }

/* One breakpoint */
@media (max-width: 760px) {
  :root { --side: max(16px, env(safe-area-inset-left, 0px)); }
  .wrap { padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .top-band { position: static; }
  .top { gap: var(--s10) var(--s24); }
  .nav { width: 100%; gap: 0 var(--s24); }
  .nav a { padding-block: 10px; }
  .hero .wrap { min-height: 0; padding-top: 64px; }
  .hero-in { flex-direction: column; align-items: flex-start; gap: var(--s24); }
  .hero-in > .mark { width: 30px; height: 60px; }
  .display-xl { font-size: clamp(44px, 13vw, 72px); }
  .deck { font-size: 24px; }
  h2 { font-size: 32px; }
  .sec { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
  .ix { grid-template-columns: minmax(0, 1fr); row-gap: var(--s10); }
  .ix-t { font-size: 26px; }
  .ix-p { align-items: flex-start; text-align: left; }
  .run { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .run li, .run li + li { padding: var(--s14) 0; border-left: 0; border-bottom: 1px solid var(--hairline); display: grid; grid-row: auto; grid-template-rows: none; grid-template-columns: 96px minmax(0, 1fr); column-gap: var(--s16); row-gap: var(--s10); }
  .run li:last-child { border-bottom: 0; }
  .run li > :not(.t) { grid-column: 2; }
  .run .t { grid-row: span 2; }
  .says td:first-child { width: 42%; }
  .kit thead { position: absolute; left: -10000px; }
  .kit tr { display: flex; flex-direction: column; gap: 4px; padding: var(--s14) 0; border-bottom: 1px solid var(--hairline); }
  .kit tr:last-child { border-bottom: 0; }
  .kit td, .kit tr:last-child td { display: block; padding: 0; border: 0; }
  .kit .file { white-space: normal; }
  .copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s14) var(--s16); }
.mailto { font-size: 22px; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .studies { grid-template-columns: minmax(0, 1fr); gap: var(--s28); }
}
