@import url('fonts.css');

/* ---------------------------------------------------------------
   Tilde Staff Inc. — site styles
   Plain CSS. No framework, no build step, no external requests.
   --------------------------------------------------------------- */

:root {
  --ink:        #080b0f;
  --panel:      #0e1319;
  --panel-2:    #131a22;
  --line:       #212b35;
  --line-soft:  rgba(255, 255, 255, 0.06);
  --text:       #e2e9ef;
  --text-dim:   #a9b6c2;
  --muted:      #7d8b98;
  --accent:     #6fd7c8;
  --accent-dim: #2f8d81;

  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --wide: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: #9ee9dd; }

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- type ---------- */

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.15;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.35rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.18rem; letter-spacing: -0.01em; }

p { margin: 0 0 1.15em; color: var(--text-dim); }

.lead {
  font-size: clamp(1.08rem, 1.6vw, 1.32rem);
  line-height: 1.6;
  color: var(--text);
  max-width: 62ch;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--accent-dim), transparent);
  opacity: 0.5;
  max-width: 140px;
}

.eyebrow--plain::after { display: none; }

.muted { color: var(--muted); }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 11, 15, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  color: var(--text);
}

.brand:hover { color: var(--text); }

.brand__mark {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
}

.brand__name {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand__suffix {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav { display: flex; align-items: center; gap: 2rem; }

.nav a {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
}

.nav a:hover { color: var(--text); border-bottom-color: var(--accent-dim); }
.nav a[aria-current='page'] { color: var(--accent); border-bottom-color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  padding: clamp(4.5rem, 11vw, 8.5rem) 0 clamp(3.5rem, 8vw, 6rem);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
  pointer-events: none;
}

.hero__trace {
  position: absolute;
  right: -4%;
  bottom: -8%;
  width: min(760px, 70%);
  opacity: 0.55;
  pointer-events: none;
}

.hero .wrap { position: relative; }

.hero h1 { max-width: 20ch; }

.hero__meta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.4rem;
}

/* ---------- sections ---------- */

section { padding: clamp(3.5rem, 7vw, 6rem) 0; }

.section--panel { background: var(--panel); border-block: 1px solid var(--line-soft); }
.section--deep  { background: var(--panel-2); border-block: 1px solid var(--line-soft); }

.section-head { max-width: 68ch; margin-bottom: clamp(2rem, 4vw, 3.25rem); }

/* ---------- grids and cards ---------- */

.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

.card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.022), transparent);
  padding: 1.7rem 1.6rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }

.card__index {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.9rem;
}

.card p:last-child { margin-bottom: 0; }

/* ---------- capability rows ---------- */

.rows { border-top: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0 1.5rem;
  padding: 1.7rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.row__num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding-top: 0.25rem;
}

.row__body h3 { margin-bottom: 0.45rem; }
.row__body p:last-child { margin-bottom: 0; }

/* ---------- people ---------- */

.person {
  border: 1px solid var(--line);
  padding: 1.9rem 1.75rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.022), transparent);
}

.person__role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.person h3 { font-size: 1.35rem; margin-bottom: 0.35rem; }

.person__cred { font-size: 0.92rem; color: var(--muted); margin-bottom: 1.1rem; }

.person p:last-child { margin-bottom: 0; }

/* ---------- marks strip ---------- */

.marks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.2rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.marks span { white-space: nowrap; }

/* ---------- callout ---------- */

.callout {
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  background: var(--panel);
  padding: 1.6rem 1.8rem;
  max-width: 68ch;
}

.callout p:last-child { margin-bottom: 0; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  transition: background 0.2s ease, color 0.2s ease;
}

.btn:hover { background: var(--accent); color: var(--ink); }

.btn--solid { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.btn--solid:hover { background: #9ee9dd; color: var(--ink); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.2rem; }

/* ---------- definition pairs ---------- */

.pairs { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.pair__key {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.pair__val { color: var(--text); font-size: 1.02rem; }

.pair__val--lead { font-size: clamp(1.25rem, 2.6vw, 1.7rem); letter-spacing: -0.01em; }

/* ---------- footer ---------- */

.site-footer {
  background: var(--panel-2);
  border-top: 1px solid var(--line);
  padding: clamp(3rem, 6vw, 4.5rem) 0 2rem;
}

.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1.4fr 1fr 1fr; }

.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.footer-links a { color: var(--text-dim); font-size: 0.95rem; }
.footer-links a:hover { color: var(--accent); }

.colophon {
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }

  .nav {
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    display: none;
  }

  .nav[data-open='true'] { display: flex; }
  .nav a { padding: 0.75rem 0; width: 100%; }

  .row { grid-template-columns: 1fr; gap: 0.5rem; }
  .row__num { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
}

/* ---------- flow headline ---------- */
/* The three words never wrap. The type size is derived from the space actually
   available, so the line fits at every width instead of being clamped and hoped for.
   Divisor 13 is the measured width of the line in em: 10.60 for the three words,
   minus 0.38 of letter-spacing, plus 1.40 of gaps, plus 1.24 for the two arrows,
   which is 12.86, rounded up for margin. Re-measure if the wording changes. */

.h1-flow {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35em;
  white-space: nowrap;
  max-width: 100%;
  font-size: min(4rem, calc((100vw - 2 * var(--gutter) - 8px) / 13));
}

.h1-flow__arrow {
  width: 0.62em;
  height: 0.62em;
  flex: 0 0 auto;
  color: var(--accent);
  overflow: visible;
}
