/* Inner pages: case studies and contact. Loaded after styles.css. */

/* These pages scroll a long way, so the logo and email stay with the opening screen. */
.nav { position: absolute; }

.top { position: relative; height: calc(100 * var(--vh)); }
.top-short { height: calc(86 * var(--vh)); }
.top .plate { bottom: calc(8 * var(--vh)); max-width: calc(100% - 2 * var(--edge) - 104px); }
/* A little shade under the words, so they hold against the lines at night. */
.top:not(.top-short)::after {
  content: ""; position: absolute; inset: 40% 0 0 0; z-index: 4; pointer-events: none;
  background: linear-gradient(8deg, rgba(5, 8, 6, 0.78) 0%, rgba(5, 8, 6, 0.4) 30%, rgba(5, 8, 6, 0) 58%);
  transition: opacity 0.45s;
}
html.is-day .top::after { opacity: 0; }
.top .figure { font-size: min(24vw, calc(25 * var(--vh))); }
.top .who { max-width: 34em; }
.top .go { left: auto; right: var(--edge); margin-left: 0; }
.top-short .go { bottom: calc(6 * var(--vh)); }

/* Text on the opening screen comes up once the land is drawn. */
html.js .top .rise > span,
html.js .top .h-in { transform: translate3d(0, 108%, 0); transition: transform 1.25s var(--out); }
html.js.is-ready .top .rise > span,
html.js.is-ready .top .h-in { transform: none; }
html.js .top .unit > span { transition-delay: 0.08s; }
html.js .top .who > span { transition-delay: 0.16s; }
html.js .top .h-line + .h-line .h-in { transition-delay: 0.1s; }
html.js .top .go { opacity: 0; transition: opacity 0.9s 0.5s, background-color 0.4s, border-color 0.4s, color 0.4s; }
html.js.is-ready .top .go { opacity: 1; }

.top .hero-type h1 {
  font-family: var(--display); font-stretch: 62%; font-weight: 800; text-transform: uppercase;
  letter-spacing: -0.012em; line-height: 0.84;
  font-size: min(21.5vw, calc(27.5 * var(--vh))); margin-top: calc(-12 * var(--vh));
}

/* ---------- the paper sheet ---------- */
.sheet {
  position: relative; z-index: 12;
  background: #e3ddce; color: var(--ink);
  padding: calc(15 * var(--vh)) var(--edge) calc(13 * var(--vh));
  border-radius: var(--curve, 0) var(--curve, 0) 0 0 / calc(var(--curve, 0) * 0.32) calc(var(--curve, 0) * 0.32) 0 0;
}
.sheet ::selection { background: var(--ink); color: var(--paper); }
.sheet :focus-visible { outline-color: var(--ink); }

.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 3vw; margin: 0;
}
.facts div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.facts dd { margin: 0; font-size: clamp(18px, 1.6vw, 25px); font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; }
.facts dt { margin-top: 0.5em; font-size: clamp(13px, 0.95vw, 15px); opacity: 0.58; }

.block {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 3vw;
  margin-top: calc(17 * var(--vh));
}
.block h2 {
  grid-column: 1 / span 5; align-self: start;
  font-family: var(--display); font-stretch: 62%; font-weight: 800; text-transform: uppercase;
  letter-spacing: -0.012em; line-height: 0.86; font-size: clamp(46px, 6.6vw, 118px);
  overflow: hidden; padding-top: 0.05em;
}
.block h2 span { display: inline-block; }
.copy { grid-column: 7 / span 6; font-size: clamp(18px, 1.55vw, 24px); line-height: 1.42; letter-spacing: -0.008em; }
.copy p + p { margin-top: 1em; }
.copy strong { font-weight: 500; }
.steps-done { counter-reset: step; }
.steps-done li {
  counter-increment: step; position: relative; padding: 0.85em 0 0.85em 2.6em;
  border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
}
.steps-done li:last-child { border-bottom: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); }
.steps-done li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 1.05em;
  font-family: var(--mono); font-size: 0.62em; opacity: 0.55;
}

/* ---------- drawn pieces ---------- */
.piece { margin: calc(12 * var(--vh)) 0 0; }
.ridge { position: relative; }
.ridge svg { display: block; width: 100%; height: auto; overflow: visible; }
.ridge-fill { fill: #e3ddce; stroke: none; }
.ridge-line { fill: none; stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ridge svg { overflow: hidden; }
.ridge b {
  position: absolute; transform: translate(-50%, -100%); padding-bottom: 10px;
  font-family: var(--mono); font-weight: 400; font-size: clamp(11px, 0.95vw, 14px); white-space: nowrap;
}
.ridge b::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: 7px; background: currentColor; opacity: 0.5; }
.ridge b.is-kept { color: #c2413f; }
.ridge i {
  position: absolute; width: clamp(9px, 1vw, 15px); aspect-ratio: 1; border-radius: 50%;
  background: var(--coral); transform: translate(-50%, -50%);
}

.table { width: 100%; border-collapse: collapse; margin-top: 3vh; font-size: clamp(15px, 1.2vw, 19px); }
.table th, .table td { text-align: left; padding: 0.95em 1.2em 0.95em 0; vertical-align: baseline; }
.table thead th { font-weight: 400; font-size: 0.8em; opacity: 0.58; padding-bottom: 0.7em; }
.table tbody tr { border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); }
.table tbody tr:last-child { border-bottom: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); }
.table tbody th { font-weight: 500; }
.table .n { font-family: var(--mono); font-size: 0.92em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .big { font-family: var(--display); font-stretch: 62%; font-weight: 800; font-size: 1.9em; line-height: 0.9; letter-spacing: -0.01em; }
.table tr.is-kept .big { color: #c2413f; }
.table tr.is-cut th, .table tr.is-cut .big { text-decoration: line-through; text-decoration-thickness: 1px; }
.dots { display: block; height: 10px; }
.dots circle { fill: var(--ink); }
.dots .half { opacity: 0.4; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 3vw; margin-top: calc(10 * var(--vh)); }
.pair > div { border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); padding-top: 3vh; }
.pair .big { font-family: var(--display); font-stretch: 62%; font-weight: 800; line-height: 0.84; font-size: clamp(64px, 11vw, 190px); letter-spacing: -0.012em; }
.pair .big small { font-family: var(--text); font-weight: 500; font-size: max(0.16em, 15px); letter-spacing: -0.01em; margin-left: 0.5em; text-transform: none; }
.pair p { margin-top: 1.4em; font-size: clamp(16px, 1.25vw, 20px); max-width: 26em; line-height: 1.4; }

.clock { position: relative; }
.clock svg { display: block; width: 100%; height: auto; overflow: visible; }
.clock line, .clock path { stroke: var(--ink); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.clock .arc { stroke-dasharray: 2 5; }
.clock b { position: absolute; top: 100%; transform: translateX(-50%); margin-top: 10px; font-family: var(--mono); font-weight: 400; font-size: clamp(11px, 0.95vw, 14px); white-space: nowrap; }
.clock b:first-of-type { transform: none; }
.clock b:last-of-type { transform: translateX(-100%); color: #c2413f; }
.clock i { position: absolute; width: clamp(12px, 1.5vw, 22px); aspect-ratio: 1; border-radius: 50%; background: var(--coral); transform: translate(-50%, -50%); }

/* ---------- next case ---------- */
.next {
  display: block; margin-top: calc(18 * var(--vh)); padding-top: 4vh;
  border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
}
.next-title {
  display: block; font-family: var(--display); font-stretch: 62%; font-weight: 800; text-transform: uppercase;
  letter-spacing: -0.012em; line-height: 0.86; font-size: clamp(54px, 10.5vw, 190px);
  transition: font-stretch 0.7s var(--out);
}
.next-title::after { content: "→"; font-family: var(--text); font-weight: 400; font-size: 0.42em; margin-left: 0.25em; vertical-align: 0.38em; color: var(--coral); display: inline-block; transition: transform 0.6s var(--out); }
.next:hover .next-title { font-stretch: 74%; }
.next:hover .next-title::after { transform: translateX(0.2em); }
.next-label { display: block; margin-top: 1.2em; font-size: clamp(15px, 1.1vw, 18px); opacity: 0.62; }

/* ---------- contact form ---------- */
.lede { font-size: clamp(22px, 2.5vw, 40px); line-height: 1.2; letter-spacing: -0.02em; max-width: 24em; }
.brief { display: grid; grid-template-columns: 1fr 1fr; gap: 6vh 4vw; margin-top: calc(11 * var(--vh)); }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label, .field legend { display: block; padding: 0; font-size: clamp(14px, 1.05vw, 17px); opacity: 0.62; transition: opacity 0.3s; }
.field:focus-within label, .field:focus-within legend { opacity: 1; }
.field fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field input, .field textarea, .field select {
  width: 100%; margin-top: 0.25em; padding: 0.3em 0 0.42em; border: 0; border-radius: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 34%, transparent);
  background: transparent; color: var(--ink); font: inherit; font-size: clamp(21px, 2.1vw, 32px); letter-spacing: -0.02em;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.field textarea { min-height: 5.2em; resize: vertical; line-height: 1.25; }
.field select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 1.4em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d150f' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E") right 0 center / 0.9em no-repeat;
}
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--ink) 30%, transparent); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-bottom-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.field [aria-invalid="true"] { border-bottom-color: #c2413f; box-shadow: 0 1px 0 #c2413f; }
.field .hint { display: none; margin-top: 0.5em; font-size: 15px; color: #a8302e; }
.field [aria-invalid="true"] ~ .hint { display: block; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 0.8em; }
.pill {
  padding: 0.55em 1.05em; border: 1px solid color-mix(in srgb, var(--ink) 34%, transparent); border-radius: 999px;
  font-size: clamp(16px, 1.3vw, 21px); letter-spacing: -0.01em;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.pill:hover { border-color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #e3ddce; }
.send-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.send {
  display: inline-flex; align-items: center; gap: 0.32em;
  font-family: var(--display); font-stretch: 62%; font-weight: 800; text-transform: uppercase;
  letter-spacing: -0.012em; line-height: 0.86; font-size: clamp(54px, 9vw, 150px);
  transition: font-stretch 0.7s var(--out), opacity 0.3s;
}
.send span {
  display: grid; place-items: center; width: 0.62em; aspect-ratio: 1; border-radius: 50%;
  background: var(--coral); transition: transform 0.6s var(--out);
}
.send svg { width: 42%; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.send:hover { font-stretch: 74%; }
.send:hover span { transform: rotate(45deg); }
.send[disabled] { opacity: 0.45; cursor: progress; }
.send-note { font-size: clamp(15px, 1.15vw, 19px); max-width: 22em; }
.send-note a { background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; }
.sent { display: none; }
.sent h2 { font-family: var(--display); font-stretch: 62%; font-weight: 800; text-transform: uppercase; letter-spacing: -0.012em; line-height: 0.86; font-size: clamp(64px, 13vw, 230px); }
.sent p { margin-top: 3vh; font-size: clamp(20px, 2vw, 32px); letter-spacing: -0.02em; }
.is-sent .brief, .is-sent .lede { display: none; }
.is-sent .sent { display: block; }

/* ---------- footer ---------- */
.contact-slim { min-height: 0; }
.contact-slim .contact-in { padding-top: calc(7 * var(--vh)); }
.contact-slim .contact-row { margin-top: 0; }

/* ---------- arriving on scroll ---------- */
html.js .reveal { opacity: 0; transform: translate3d(0, 34px, 0); transition: opacity 0.9s var(--out), transform 1.1s var(--out); }
html.js .reveal.in { opacity: 1; transform: none; }
html.js .block h2 span { transform: translate3d(0, 108%, 0); transition: transform 1.15s var(--out); }
html.js .block h2.in span { transform: none; }

@media (max-width: 860px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .block { display: block; margin-top: calc(12 * var(--vh)); }
  .copy { margin-top: 4vh; }
  .pair, .brief { grid-template-columns: 1fr; }
  .top .figure { font-size: min(30vw, calc(20 * var(--vh))); }
  .top .hero-type h1 { font-size: min(27vw, calc(15 * var(--vh))); margin-top: calc(-12 * var(--vh)); }
  .table thead { display: none; }
  .table, .table tbody, .table tr { display: block; }
  .table tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 0.9em 0; }
  .table th, .table td { padding: 0; }
  .table td[data-l]::before { content: attr(data-l) " "; opacity: 0.58; font-family: var(--text); font-size: 0.86em; }
  .table td.wide { grid-column: 1 / -1; }
  .dots { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html.js .reveal, html.js .block h2 span, html.js .top .rise > span, html.js .top .h-in { transition: none; }
}

/* The round button on a daylight scene. */
html.is-day .top .go { border-color: color-mix(in srgb, var(--ink) 42%, transparent); background: color-mix(in srgb, #e3ddce 40%, transparent); color: var(--ink); }
html.is-day .top .go:hover, html.is-day .top .go:focus-visible { background: var(--ink); border-color: var(--ink); color: #e3ddce; }
