/* ETHERNA Group. One page. Drawing-sheet layout: 12-column grid, hairlines, a title block. */

:root {
  --bg: #f3f1ec;
  --ink: #151412;
  --muted: #6f6b64;
  --rule: rgba(21, 20, 18, 0.16);
  --rule-strong: rgba(21, 20, 18, 0.55);
  --accent: #b5482a;      /* one warm mark, used only for a gap in the reading */
  --ok: #2f6b3f;
  --pad: clamp(20px, 4vw, 56px);
  --gap: clamp(16px, 2vw, 32px);
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151412;
    --ink: #ebe7df;
    --muted: #9a958c;
    --rule: rgba(235, 231, 223, 0.16);
    --rule-strong: rgba(235, 231, 223, 0.55);
    --accent: #e0724f;
    --ok: #7fbf8f;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: no-preference) { html:focus-within { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
/* Underlines grow in from the left on hover, and shrink back out to the right */
a:not(.mark):not(.skip) {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-repeat: no-repeat; background-position: left calc(100% - 0.02em);
  transition: background-size 1000ms cubic-bezier(.2, .7, .1, 1);
}
a:not(.mark):not(.skip):hover, a:not(.mark):not(.skip):focus-visible { background-size: 100% 1px; }
a:not(.mark):not(.skip):not(:hover) { background-position: right calc(100% - 0.02em); }
.big-link { background-position: left calc(100% - 0.06em) !important; }
.big-link:not(:hover) { background-position: right calc(100% - 0.06em) !important; }
@media (prefers-reduced-motion: reduce) { a:not(.mark):not(.skip) { transition: none; } }

/* Text isn't selectable: this is a sheet to read, not to copy. The contact line still is. */
body { -webkit-user-select: none; user-select: none; }
.contact-lead, .contact-meta { -webkit-user-select: text; user-select: text; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
p, h1, h2, h3, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: var(--pad); top: -40px; padding: 8px 12px;
  background: var(--ink); color: var(--bg); font-size: 13px; z-index: 20;
}
.skip:focus { top: 12px; }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding-inline: var(--pad);
}

/* Header: mark, running section index, clock, nav */
.top {
  position: sticky; top: 0; z-index: 10;
  align-items: baseline;
  padding-block: 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}
.mark { grid-column: 1 / span 3; font-weight: 600; letter-spacing: 0.22em; font-size: 12px; }
.index { grid-column: 4 / span 3; color: var(--muted); display: flex; gap: 12px; }
.index-num { color: var(--ink); }
.meta { grid-column: 7 / span 3; color: var(--muted); }
.clock { margin-left: 0.6em; }
.nav { grid-column: 10 / span 3; display: flex; justify-content: flex-end; gap: clamp(14px, 2vw, 28px); }

/* Hero */
.hero {
  min-height: min(82vh, 820px);
  align-content: end;
  padding-block: clamp(80px, 14vh, 160px) clamp(40px, 7vh, 72px);
  row-gap: 36px;
}
.display {
  grid-column: 1 / span 11;
  font-size: clamp(40px, 7vw, 116px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  font-weight: 500;
  max-width: 13ch;
  text-wrap: balance;
}
.hero-note { grid-column: 1 / span 5; color: var(--muted); max-width: 36ch; }
.hero-place { grid-column: 10 / span 3; align-self: end; color: var(--muted); text-align: right; line-height: 1.6; }

/* Blocks and labels */
.block { border-top: 1px solid var(--rule); padding-block: clamp(48px, 9vh, 104px); }
.head { margin-bottom: clamp(24px, 5vh, 48px); }
.label, .small-label, .tb-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.label { grid-column: 1 / span 4; }
.label-name { margin-left: 10px; color: var(--ink); }
.small-label { display: block; margin-bottom: 6px; }

/* The reading: the product, shown on this domain */
.reading-wrap { grid-column: 1 / span 7; margin-top: 8px; }
.reading-head {
  display: flex; justify-content: space-between; gap: 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--rule-strong);
  color: var(--ink);
}
.reading-head time { color: var(--muted); }
.reading { border-bottom: 1px solid var(--rule-strong); }
.reading-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 14px; gap: 16px;
  padding-block: 12px; border-top: 1px solid var(--rule); align-items: baseline;
}
.reading-row:first-child { border-top: 0; }
.reading-row dt { color: var(--muted); }
.reading-row dd { color: var(--ink); }
.reading-row::after { content: ""; width: 8px; height: 8px; border-radius: 50%; justify-self: end; background: var(--ok); }
.reading-row[data-state="stage"]::after { background: transparent; border: 1px solid var(--ok); }
.reading-row[data-state="gap"]::after { background: var(--accent); }
.reading-row[data-state="unknown"]::after { background: transparent; border: 1px solid var(--muted); }
.reading-note { margin-top: 12px; color: var(--muted); }
.reading-aside { grid-column: 9 / span 4; align-self: end; color: var(--muted); max-width: 34ch; margin-top: 8px; }

/* Service rows */
.row { padding-block: 28px; border-top: 1px solid var(--rule); align-items: baseline; }
.num { grid-column: 1 / span 1; color: var(--muted); }
.row-title {
  grid-column: 2 / span 4;
  font-size: clamp(24px, 2.6vw, 40px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.row-body { grid-column: 7 / span 5; max-width: 46ch; }
.row:hover .num { color: var(--ink); }

/* Steps */
.steps { padding-inline: var(--pad); row-gap: 32px; }
.steps li {
  grid-column: span 4; display: grid; align-content: start; gap: 10px;
  padding-top: 18px; border-top: 1px solid var(--ink);
}
.step-num { color: var(--muted); }
.step-name { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.step-text { color: var(--muted); max-width: 34ch; }

/* Work */
.work { border-top: 1px solid var(--rule); }
.work-row { padding-block: 22px; align-items: baseline; }
.work-row + .work-row { border-top: 1px solid var(--rule); }
.work-name { grid-column: 1 / span 4; font-size: clamp(20px, 2vw, 28px); font-weight: 500; letter-spacing: -0.015em; }
.work-kind { grid-column: 5 / span 3; color: var(--muted); }
.work-scope { grid-column: 8 / span 2; color: var(--muted); align-self: center; }
.work-link { grid-column: 10 / span 3; justify-self: end; }

/* Contact */
.contact-lead { padding-inline: var(--pad); margin-bottom: clamp(32px, 6vh, 64px); }
.big-link {
  font-size: clamp(26px, 5.4vw, 88px);
  line-height: 1;
  letter-spacing: -0.035em;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.contact-meta { row-gap: 24px; }
.contact-meta p { grid-column: span 4; }

/* Title block, like the corner of a drawing sheet */
.titleblock {
  border-top: 1px solid var(--rule-strong);
  padding-block: 0 clamp(56px, 10vh, 120px);   /* room to breathe after the last row */
  row-gap: 0;
  color: var(--muted);
}
.titleblock p {
  grid-column: span 4;
  padding-block: 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}
.titleblock p:nth-child(3n+2), .titleblock p:nth-child(3n) { border-left: 1px solid var(--rule); padding-left: 16px; }
.tb-label { display: block; margin-bottom: 4px; }

/* Arrival and scroll reveals: subtle, and off for anyone who prefers less motion */
@media (prefers-reduced-motion: no-preference) {
  .display, .hero-note, .hero-place { opacity: 0; }
  .is-ready .display, .is-ready .hero-note, .is-ready .hero-place { animation: rise 900ms cubic-bezier(.2, .7, .1, 1) both; }
  .is-ready .hero-note { animation-delay: 120ms; }
  .is-ready .hero-place { animation-delay: 220ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  .reveal { opacity: 0; transform: translateY(10px); transition: opacity 700ms ease, transform 700ms cubic-bezier(.2, .7, .1, 1); }
  .reveal.is-in { opacity: 1; transform: none; }
}

/* Phones and small tablets */
@media (max-width: 820px) {
  .mark { grid-column: 1 / span 6; }
  .index, .meta { display: none; }
  .nav { grid-column: 7 / span 6; }
  .display { grid-column: 1 / -1; }
  .hero { min-height: 70vh; }
  .hero-note { grid-column: 1 / -1; }
  .hero-place { grid-column: 1 / -1; text-align: left; }
  .label { grid-column: 1 / -1; }
  .reading-wrap { grid-column: 1 / -1; }
  .reading-aside { grid-column: 1 / -1; margin-top: 24px; }
  .reading-row { grid-template-columns: minmax(0, 1fr) 14px; }
  .reading-row dd { grid-column: 1 / -1; order: 1; }
  .num { grid-column: 1 / span 2; }
  .row-title { grid-column: 3 / -1; }
  .row-body { grid-column: 3 / -1; margin-top: 12px; }
  .steps li { grid-column: 1 / -1; }
  .work-name { grid-column: 1 / -1; }
  .work-kind { grid-column: 1 / span 7; }
  .work-scope { display: none; }
  .work-link { grid-column: 8 / -1; }
  .contact-meta p { grid-column: 1 / -1; }
  .titleblock p { grid-column: span 6; }
  .titleblock p:nth-child(3n+2), .titleblock p:nth-child(3n) { border-left: 0; padding-left: 0; }
  .titleblock p:nth-child(2n) { border-left: 1px solid var(--rule); padding-left: 16px; }
}

@media (max-width: 420px) {
  .nav { gap: 12px; }
  .nav a:first-child { display: none; }
}

/* Preloader: the mark, a hairline drawn like a plotter pen, one line of reading. ~1.4s, once per visit. */
.is-loading { overflow: hidden; }
.loader {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-content: center; justify-items: start; gap: 14px;
  background: var(--bg); color: var(--ink);
  animation: loader-fallback 400ms ease 5s forwards;   /* if scripts never run, get out of the way */
}
.loader-mark {
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em;
  animation: spread 1100ms cubic-bezier(.2, .7, .1, 1) forwards;
}
.loader-line {
  width: min(340px, 64vw); height: 1px; background: var(--ink);
  transform-origin: left center; transform: scaleX(0);
  animation: draw 900ms cubic-bezier(.65, 0, .2, 1) 120ms forwards;
}
.loader-read { color: var(--muted); opacity: 0; animation: appear 300ms ease 700ms forwards; }
.caret { display: inline-block; width: 6px; height: 11px; margin-left: 4px; background: var(--muted); vertical-align: -1px; animation: blink 700ms steps(1) infinite; }
.loader.is-done { animation: lift 640ms cubic-bezier(.76, 0, .24, 1) forwards; }
@keyframes spread { to { letter-spacing: 0.32em; } }
@keyframes draw { to { transform: scaleX(1); } }
@keyframes appear { to { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes lift { to { transform: translateY(-101%); } }
@keyframes loader-fallback { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .loader { display: none; } }

/* The sheet's construction: a drafting cursor, guide lines that surface near it, the headline
   rising line by line, and the reading panel typing itself in. All mouse/motion extras switch
   off for touch screens and for people who prefer reduced motion. */

/* Drafting cursor: a fine crosshair with a live coordinate readout; a circle over links */
.has-cursor, .has-cursor a { cursor: none; }
.cursor { position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none; will-change: transform; }
.cursor::before, .cursor::after { content: ""; position: absolute; background: var(--ink); transition: width 200ms ease, height 200ms ease, opacity 200ms ease; }
.cursor::before { width: 22px; height: 1px; left: -11px; top: 0; }
.cursor::after  { width: 1px; height: 22px; left: 0; top: -11px; }
.cursor-dot { position: absolute; width: 3px; height: 3px; left: -1.5px; top: -1.5px; border-radius: 50%; background: var(--ink); }
.cursor-ring { position: absolute; width: 34px; height: 34px; left: -17px; top: -17px; border: 1px solid var(--ink); border-radius: 50%; opacity: 0; transform: scale(.6); transition: opacity 200ms ease, transform 250ms cubic-bezier(.2,.7,.1,1); }
.cursor-read { position: absolute; left: 14px; top: 10px; white-space: nowrap; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.cursor.is-link::before, .cursor.is-link::after { opacity: 0; }
.cursor.is-link .cursor-ring { opacity: 1; transform: scale(1); }
.cursor.is-link .cursor-read { opacity: 0; }
.cursor.is-out { opacity: 0; }

/* Guide lines: the 12-column grid and a dot grid, visible only near the cursor */
.guides { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 500ms ease;
  background-image: radial-gradient(var(--rule-strong) 0.6px, transparent 0.8px); background-size: 28px 28px; background-position: 14px 14px;
  -webkit-mask-image: radial-gradient(circle 200px at var(--mx, -999px) var(--my, -999px), rgba(0,0,0,.8) 0%, rgba(0,0,0,.4) 45%, transparent 100%);
          mask-image: radial-gradient(circle 200px at var(--mx, -999px) var(--my, -999px), rgba(0,0,0,.8) 0%, rgba(0,0,0,.4) 45%, transparent 100%); }
.guides.is-on { opacity: 1; }
.guides-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); padding-inline: var(--pad); }
.guides-cols span { border-left: 1px solid var(--rule-strong); border-right: 1px solid var(--rule-strong); opacity: .45; }
main, header, footer { position: relative; z-index: 1; }

/* Headline: each line rises from behind a mask */
.line { display: block; overflow: hidden; }
.line-in { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .display.is-split .line-in { transform: translateY(108%); }
  .is-ready .display.is-split .line-in { animation: line-up 1000ms cubic-bezier(.2, .7, .1, 1) forwards; }
  .is-ready .display.is-split .line:nth-child(2) .line-in { animation-delay: 80ms; }
  .is-ready .display.is-split .line:nth-child(3) .line-in { animation-delay: 160ms; }
  .is-ready .display.is-split .line:nth-child(4) .line-in { animation-delay: 240ms; }
  .is-ready .display.is-split .line:nth-child(5) .line-in { animation-delay: 320ms; }
  .is-ready .display.is-split .line:nth-child(6) .line-in { animation-delay: 400ms; }
  @keyframes line-up { to { transform: none; } }
  .is-ready .display.is-split { animation: none; opacity: 1; }
}

/* Reading panel: types itself in when it scrolls into view */
.reading-row dd.is-typing::after { content: ""; display: inline-block; width: 6px; height: 11px; margin-left: 3px; background: var(--muted); vertical-align: -1px; animation: blink 700ms steps(1) infinite; }
.reading-row.is-pending dd { color: transparent; }
.reading-row.is-pending::after { opacity: 0; }
.reading-row::after { transition: opacity 300ms ease, transform 300ms cubic-bezier(.2,.7,.1,1); }
