/* ==========================================================================
   Jig — stylesheet
   Palette is "Kraft & Pine". Every other tone is mixed from these five.
   ========================================================================== */

:root {
  /* Kraft & Pine */
  --paper:  #EBE4D6;
  --ink:    #1B1714;
  --ink-2:  #625950;
  --rule:   #D4C8B4;
  --accent: #27694A;

  /* Derived — mixes of the above, no new hues */
  --ink-soft:   var(--ink-2);
  --ink-mute:   color-mix(in srgb, var(--ink-2) 78%, var(--paper));
  --panel-mute: color-mix(in srgb, var(--paper) 58%, var(--ink));
  --panel-rule: color-mix(in srgb, var(--paper) 16%, var(--ink));
  --panel-field:color-mix(in srgb, var(--paper) 5%, var(--ink));

  /* Type */
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body:    "Barlow", "Helvetica Neue", sans-serif;
  --font-mono:    "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  /* Rhythm */
  --wrap:        1080px;
  --gutter:      clamp(1.5rem, 5vw, 3rem);
  --section-pad: 3.5rem;   /* 56px each side → 112px between sections */
  --measure:     36em;

  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --dur: .7s;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, p, ul, dl, dd, figure, address { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Type
   -------------------------------------------------------------------------- */
h1, h2, dt {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.015em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);   /* 40–60px */
  line-height: .95;
  max-width: 14em;
}

.lead {
  font-size: 1.0625rem;   /* 17px, same as body */
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: var(--measure);
  text-wrap: pretty;
}

.section-index {
  font-family: var(--font-mono);
  font-size: .8125rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.section-index span { color: var(--accent); font-weight: 600; }
.section-index::after {
  content: "";
  width: 2.5rem;
  height: 1px;
  background: var(--rule);
}

.closing {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.375rem, 2.4vw, 1.875rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  max-width: 22em;
  margin-top: 3rem;
  text-wrap: balance;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  transition: transform 200ms var(--ease-out);
}
.site-header.is-hidden { transform: translateY(-100%); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3.75rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -.02em;
  line-height: 1;
  text-decoration: none;
}
/* Logo mark — one of the three places the accent is allowed */
.wordmark-mark {
  width: 1rem; height: 1rem;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 60%, 60% 60%, 60% 100%, 0 100%);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-width: 0;
}
.header-nav { display: flex; gap: 1.25rem; }
.header-nav a {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  transition: color .2s;
}
.header-nav a:hover { color: var(--ink); }
.header-contact {
  display: flex;
  gap: 1.25rem;
  padding-left: 1.5rem;
  border-left: 1px solid var(--rule);
}
.header-contact a {
  font-family: var(--font-mono);
  font-size: .8125rem;
  letter-spacing: .02em;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color .2s;
  white-space: nowrap;
}
.header-contact a:hover { border-color: var(--ink); }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding-block: var(--section-pad); }
.section-rule { border-top: 1px solid var(--rule); }

.section-head {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.section-dark {
  background: var(--ink);
  color: var(--paper);
}
.section-dark .lead,
.section-dark .section-index { color: var(--panel-mute); }
.section-dark .section-index::after { background: var(--panel-rule); }

/* --------------------------------------------------------------------------
   1 — Hero
   -------------------------------------------------------------------------- */
.hero {
  padding-block: 4rem var(--section-pad);   /* 64px below the header */
}
.hero .wrap { display: grid; gap: 1.5rem; }
.hero .section-index::after { display: none; }
.hero-headline {
  font-size: clamp(3rem, 9vw, 8.25rem);   /* stays just above the 8rem calculator figure */
  line-height: .9;
  letter-spacing: -.025em;
  max-width: 9.5em;
}
.hero-sub {
  font-size: clamp(1.125rem, 1.4vw, 1.25rem);
  line-height: 1.35;
  color: var(--ink-soft);
  max-width: 26em;
}
.hero-link {
  justify-self: start;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  text-decoration: none;
  padding-bottom: .2rem;
  border-bottom: 1.5px solid var(--ink);
  transition: opacity .2s;
}
.hero-link:hover { opacity: .6; }

.hero .wrap > * { animation: rise var(--dur) var(--ease-out) both; }
.hero .wrap > :nth-child(2) { animation-delay: .08s; }
.hero .wrap > :nth-child(3) { animation-delay: .18s; }
.hero .wrap > :nth-child(4) { animation-delay: .28s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   2 — What we build
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .8125rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 1rem;
}
.examples-note {
  margin-top: 1.5rem;
  color: var(--ink-soft);
  max-width: var(--measure);
  text-wrap: pretty;
}
.examples {
  display: grid;
  border-top: 1px solid var(--ink);
}
.example {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1rem 3rem;
  padding-block: clamp(1.75rem, 3.5vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
}
.example dt {
  font-size: 1.6875rem;   /* 27px */
  line-height: 1.05;
  font-weight: 600;
}
.example dd {
  color: var(--ink-soft);
  max-width: var(--measure);
}

/* --------------------------------------------------------------------------
   3 — Who it's for
   -------------------------------------------------------------------------- */
.who {
  display: grid;
  gap: 1.25rem;
  max-width: 30em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.375rem, 2.4vw, 1.875rem);
  line-height: 1.15;
  letter-spacing: -.01em;
  text-wrap: pretty;
}
.who p + p { color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   4 — Calculator
   -------------------------------------------------------------------------- */
.calc { display: grid; gap: 2.5rem; }

.calc-inputs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.field { display: grid; grid-template-rows: 1fr auto; gap: .6rem; }
.field label { align-self: end; }
.field label {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--panel-mute);
  line-height: 1.4;
}
.field label small {
  display: block;
  text-transform: none;
  letter-spacing: 0;
  font-size: .75rem;
  opacity: .75;
  margin-top: .2rem;
}
.field-input {
  display: flex;
  align-items: stretch;
  background: var(--panel-field);
  border: 1px solid var(--panel-rule);
  transition: border-color .2s;
}
.field-input:focus-within { border-color: var(--paper); }
.field-input input,
.field-input select {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: .9rem 1rem;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.field-input select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23EBE4D6' stroke-opacity='.6' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
.field-input select option { background: var(--ink); }
.unit {
  display: flex;
  align-items: center;
  padding-inline: .9rem;
  font-family: var(--font-mono);
  font-size: .8125rem;
  color: var(--panel-mute);
  border-left: 1px solid var(--panel-rule);
}
.unit-lead { border-left: 0; border-right: 1px solid var(--panel-rule); }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.calc-output {
  display: grid;
  gap: .5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--panel-rule);
}
/* The result — second-largest thing on the page, and the accent's main job */
.calc-figure {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(3.25rem, 10vw, 8rem);
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.calc-unit {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1;
}
.calc-note {
  margin-top: 1rem;
  font-size: .9375rem;
  color: var(--panel-mute);
  max-width: 34em;
}
.calc-after {
  margin-top: 3rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.375rem, 2.4vw, 1.875rem);
  line-height: 1.15;
  max-width: 24em;
  text-wrap: balance;
}

/* --------------------------------------------------------------------------
   5 — What we don't do
   -------------------------------------------------------------------------- */
.not-list {
  list-style: none;
  padding: 0;
  display: grid;
  border-top: 1px solid var(--ink);
  max-width: 34em;
}
.not-list li {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  line-height: 1.1;
}
.not-list li::before {
  content: "—";
  font-family: var(--font-mono);
  font-size: .9rem;
  color: var(--ink-mute);
  flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   6 — Contact
   -------------------------------------------------------------------------- */
.contact {
  font-style: normal;
  display: grid;
  gap: 1.25rem;
}
.contact-links { display: grid; gap: .75rem; justify-items: start; }
.contact a {
  font-family: var(--font-mono);
  font-size: clamp(1.125rem, 2.4vw, 1.875rem);
  letter-spacing: -.02em;
  text-decoration: none;
  padding-bottom: .15rem;
  border-bottom: 1.5px solid var(--ink);
  overflow-wrap: anywhere;
  transition: opacity .2s;
}
.contact a:hover { opacity: .6; }
.contact p { color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 3rem;
  font-size: .9375rem;
  color: var(--ink-soft);
}
.footer-mark strong { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }
.footer-line { max-width: 32em; }

/* --------------------------------------------------------------------------
   Reveal
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }
.examples .reveal:nth-child(2) { transition-delay: .08s; }
.examples .reveal:nth-child(3) { transition-delay: .16s; }
.no-js .reveal { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .header-nav { display: none; }
  .header-contact { padding-left: 0; border-left: 0; }
  .header-contact .header-email { display: none; }
  .calc-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .example { grid-template-columns: 1fr; gap: .75rem; }
}

@media (max-width: 560px) {
  :root { --section-pad: 2.25rem; }   /* 36px each side → 72px between sections */
  .hero { padding-block: 2.5rem var(--section-pad); }   /* 40px below the header */
  .section-head { margin-bottom: 2rem; }
  .closing { margin-top: 2.5rem; }
  .hero-headline { font-size: clamp(3.5rem, 14.5vw, 4.25rem); }   /* just above the mobile figure */
  .calc-inputs { grid-template-columns: 1fr; gap: 1.25rem; }
  .calc-figure { font-size: clamp(2.75rem, 14vw, 4rem); }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero .wrap > * { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .site-header { transition: none; }
}
