/* ────────────────────────────────────────────────────────────────────
   Revaler Tech — site stylesheet
   Single file. No framework. Plain CSS with custom properties.
   Source-of-truth design tokens live in docs/brand-identity.md.
   ──────────────────────────────────────────────────────────────────── */

/* ─── Tokens ───────────────────────────────────────────────────────── */

:root {
  /* Palette — core */
  --ink:    #1F1B3A;
  --paper:  #FAF4EC;
  --ember:  #E26A4A;
  --mist:   #C9C3CB;

  /* Palette — derived */
  --rule:    color-mix(in oklab, var(--ink), transparent 85%);
  --muted:   color-mix(in oklab, var(--ink), transparent 40%);
  --whisper: color-mix(in oklab, var(--ink), transparent 60%);

  /* Layout */
  --measure: 38rem;
  --gutter:  clamp(1.5rem, 5vw, 4rem);
  --page-max: 64rem;

  /* Typography — system serif, no font files served.
     Iowan Old Style on macOS/iOS, Charter on older macOS,
     Georgia everywhere else, Times as last resort. */
  --font-serif: "Iowan Old Style", Charter, "Sitka Text", Cambria, Georgia, "Times New Roman", Times, serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ember);
  text-decoration-thickness: from-font;
  text-underline-offset: 4px;
}
a:hover { color: var(--ember); }
a:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: color-mix(in oklab, var(--ember), transparent 70%);
  color: var(--ink);
}

/* ─── Accessibility: skip link ────────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -3rem;
  left: 0;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus-visible {
  top: 0;
  color: var(--paper);
}

/* ─── Layout shell ────────────────────────────────────────────────── */

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) 4rem;
}

/* ─── Header ──────────────────────────────────────────────────────── */

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
  flex-wrap: wrap;
}

.brand {
  display: inline-block;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { opacity: 0.85; }
.brand .logo {
  display: block;
  height: clamp(180px, 22vw, 248px);
  width: auto;
  /* The PNG already lives on a warm off-white field that matches
     --paper, so it sits flush on the page background. */
}

nav.primary {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  font-size: 0.95rem;
}
nav.primary a {
  text-decoration: none;
  color: var(--muted);
}
nav.primary a:hover,
nav.primary a:focus-visible { color: var(--ember); }

/* ─── Hero ────────────────────────────────────────────────────────── */

.hero {
  max-width: 44rem;
  margin-bottom: clamp(4rem, 8vw, 6.5rem);
}
.hero h1 {
  font-weight: 300;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.012em;
  text-wrap: balance;
  margin: 0 0 1.6rem;
}
.hero h1 em {
  font-style: italic;
  font-weight: 300;
}
.hero .lede {
  font-size: clamp(1.1rem, 1.6vw, 1.2rem);
  line-height: 1.6;
  max-width: var(--measure);
  margin: 0;
  color: color-mix(in oklab, var(--ink), transparent 15%);
}
.hero .lede strong {
  font-weight: 500;
  color: var(--ink);
}

/* ─── Section scaffolding ─────────────────────────────────────────── */

main section {
  max-width: var(--measure);
  margin-bottom: clamp(4rem, 8vw, 7rem);
  scroll-margin-top: 2rem;
}

.section-num {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
  font-weight: 400;
  font-style: normal;
}
.section-num .num {
  color: var(--ember);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-right: 0.5em;
}

main section > h2 {
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.2;
  margin: 0 0 2rem;
}

main section p { margin: 0 0 1.1em; }
main section p:last-child { margin-bottom: 0; }

/* ─── Services ────────────────────────────────────────────────────── */

.service-group { margin-top: 2.8rem; }

.group-label {
  font-style: normal;
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ember);
  margin: 0 0 0.5rem;
}
.group-blurb {
  margin: 0;
  color: color-mix(in oklab, var(--ink), transparent 15%);
}

.offerings {
  list-style: none;
  padding: 0;
  margin: 1.6rem 0 0;
  display: grid;
  gap: 2.4rem;
}
.offerings li {
  border-top: 1px solid var(--rule);
  padding-top: 1.6rem;
}
.offerings h4 {
  font-style: italic;
  font-weight: 400;
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
  letter-spacing: 0;
}
.offerings p {
  margin: 0;
  color: color-mix(in oklab, var(--ink), transparent 10%);
}

/* ─── Showcase ────────────────────────────────────────────────────── */

.highlights {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2rem;
}
.highlights li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1.2rem;
  align-items: baseline;
}
.highlights .years {
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
}
.highlights .headline {
  font-size: 1.02rem;
  line-height: 1.5;
  margin: 0 0 0.3rem;
  color: color-mix(in oklab, var(--ink), transparent 5%);
}
.highlights .context {
  display: block;
  font-style: italic;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9rem;
  margin: 0;
}

/* ─── Products ────────────────────────────────────────────────────── */

.products {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 1.8rem;
}
.products li {
  border-top: 1px solid var(--rule);
  padding-top: 1.2rem;
}
.products h3 {
  font-style: italic;
  font-weight: 400;
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.products .status {
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 400;
  white-space: nowrap;
}
.products p {
  margin: 0;
  color: color-mix(in oklab, var(--ink), transparent 15%);
  font-size: 0.98rem;
}

/* ─── About / epigraph ────────────────────────────────────────────── */

#about > p:first-of-type::first-letter {
  float: left;
  font-size: 3.8rem;
  line-height: 0.85;
  font-style: italic;
  font-weight: 400;
  color: var(--ember);
  padding: 0.35rem 0.55rem 0 0;
}

.epigraph {
  border-left: 2px solid var(--ember);
  padding: 0.2rem 0 0.2rem 1.4rem;
  margin: 2rem 0;
  font-size: 1.05rem;
  font-style: italic;
  color: color-mix(in oklab, var(--ink), transparent 10%);
  max-width: 32rem;
}
.epigraph p { margin: 0; }
.epigraph cite {
  display: block;
  margin-top: 0.6rem;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ─── Footer / contact ────────────────────────────────────────────── */

footer.site {
  max-width: var(--measure);
  margin-top: clamp(5rem, 10vw, 8rem);
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}
footer.site h2 {
  font-style: italic;
  font-weight: 300;
  font-size: 1.7rem;
  margin: 0 0 1.4rem;
}
footer.site .contact {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 2.5rem;
  list-style: none;
  padding: 0;
}
footer.site .contact a { display: inline-block; }

footer.site .colophon {
  font-size: 0.82rem;
  color: var(--whisper);
  line-height: 1.6;
}
footer.site .colophon p { margin: 0 0 0.4em; }
footer.site .colophon a { color: var(--whisper); }
footer.site .colophon a:hover { color: var(--ember); }

/* ─── 404 page ────────────────────────────────────────────────────── */

.notfound {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.notfound h1 {
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  margin: 0 0 1rem;
}
.notfound p { max-width: var(--measure); margin: 0; }

/* ─── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 640px) {
  header.site {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.4rem;
    margin-bottom: 4rem;
  }
  .brand .logo { height: 160px; }
  nav.primary {
    gap: 1rem;
    font-size: 0.88rem;
    flex-wrap: wrap;
  }
  .highlights li {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .highlights .years { font-size: 0.85rem; }
}
