/* Enwove site. Colors and type follow enwove-brand.md. */
@font-face { font-family: 'Instrument Sans'; src: url('/assets/fonts/InstrumentSans-400.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/assets/fonts/InstrumentSans-700.woff') format('woff'); font-weight: 700; font-display: swap; }

:root {
  /* Cream ground, racing green type, mist weave with a slate thread. */
  --bg: #F3EFE3; --text: #12352A; --muted: #4D5B54; --line: #D9D2BF;
  --heading: var(--text);
  --action: #12352A; --action-label: #F3EFE3;
  --focus: #12352A;
  /* hero weave: g1 under strands, g2 over strands, g3 thread */
  --g1: #D9E2DD; --g2: #B5C4BC; --g3: #4D6B63;

  --display: 'Jura', 'Instrument Sans', system-ui, sans-serif;
  --sans: 'Instrument Sans', 'PingFang SC', 'Noto Sans SC', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --pad: clamp(1.25rem, 5vw, 4rem);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
main { flex: 1; display: flex; flex-direction: column; justify-content: center; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100%, 78rem); margin-inline: auto; padding-inline: var(--pad); }
.skip { position: absolute; left: -999px; top: 0; background: var(--text); color: var(--bg); padding: .6rem 1rem; }
.skip:focus { left: 0; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1rem; padding-block: 1.5rem; }   /* nav drops to its own row if it cannot fit */
.brand { display: block; padding: 7px 0; }               /* clear space around the lockup */
.logo { display: block; height: 28px; width: auto; }      /* small lockup: 24 to 40px, never below 24 */
.nav { display: flex; gap: 2rem; }
.link[aria-current] { color: var(--text); }
.link { color: var(--muted); text-decoration: none; font-size: .9375rem; }
.link:hover { color: var(--text); }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; padding-block: clamp(2.5rem, 7vw, 6rem); }
h1 { font: 500 clamp(2.875rem, 7vw, 6rem)/1.02 var(--display); letter-spacing: -0.01em; text-wrap: balance; }
.lede { margin-top: 1.75rem; max-width: 30ch; font-size: clamp(1.1875rem, 1.8vw, 1.5rem); line-height: 1.4; color: var(--muted); text-wrap: pretty; }
.btn { display: inline-flex; align-items: center; min-height: 3rem; margin-top: 2.25rem; padding: 0 1.5rem; border-radius: 10px; background: var(--action); color: var(--action-label); font-weight: 700; text-decoration: none; }
.btn:hover { opacity: .85; }
.hero-art { justify-self: end; width: 100%; max-width: 28rem; }
.art .g1 { fill: var(--g1); }
.art .g2 { fill: var(--g2); }
.art .g3 { fill: var(--g3); }
.art { display: block; width: 100%; height: auto; }

/* what we do */
.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 3rem; border-top: 1px solid var(--line); padding-block: 2rem clamp(2.5rem, 6vw, 5rem); }
.points h2 { font-size: 1.0625rem; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
.points h2 { color: var(--heading); }
.points p { margin-top: .5rem; font-size: 1rem; color: var(--muted); max-width: 36ch; }

/* research page */
.page { padding-block: clamp(3rem, 8vw, 7rem); }
.page .lede { color: var(--text); }

/* footer */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 2rem; padding-block: 1.5rem; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.foot .link { margin-left: auto; font-size: inherit; }

/* ---------- Responsive ----------
   Wide (above 64rem): two-column hero, three points in a row.
   Tablet and unfolded foldables (40rem to 64rem, often nearly square): same layout, tighter.
   Phone and folded cover screens (below 40rem, down to 280px): one column; headline first,
   no weave, points stacked.
   Nothing here depends on device names: folding or unfolding just moves between these ranges. */
.nav .link { display: inline-flex; align-items: center; min-height: 2.75rem; }   /* 44px tap target */

@media (max-width: 64rem) {
  .hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 2rem; }
  h1 { font-size: clamp(2.5rem, 6.6vw, 4rem); }
  .lede { font-size: 1.125rem; }
  .points { gap: 0 1.75rem; }
  .points p { font-size: .9375rem; }
}

@media (max-width: 40rem) {
  main { justify-content: flex-start; }
  .top { padding-block: .75rem; }
  .nav { gap: 1.5rem; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 2rem 2.5rem; }
  h1 { font-size: clamp(2rem, 11.5vw, 3.5rem); line-height: 1.04; }
  .lede { margin-top: 1.25rem; max-width: 26rem; }
  .btn { margin-top: 1.75rem; }
  .hero-art { display: none; }   /* no weave on narrow screens: everything fits on the first screen */
  .points { grid-template-columns: minmax(0, 1fr); gap: 0; padding-block: 0 2rem; }
  .points li { padding-block: 1.25rem; border-top: 1px solid var(--line); }
  .points li:first-child { border-top: 0; }
  .points p { font-size: 1rem; max-width: none; }
  .page { padding-block: 2.5rem; }
  .foot { padding-block: 1.25rem; }
}

/* Narrow phones and folded cover screens. */
@media (max-width: 23rem) {
  .logo { height: 24px; }
  .nav { gap: 1rem; }
}
@media (max-width: 20rem) {
  :root { --pad: 1rem; }
  .lede { font-size: 1.0625rem; }
  .btn { width: 100%; justify-content: center; }
}

/* Short, wide screens (a phone held sideways): keep two columns, shrink the weave. */
@media (max-height: 30rem) and (min-width: 30rem) {
  main { justify-content: flex-start; }
  .hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 2rem; padding-block: 1.5rem 2rem; }
  h1 { font-size: clamp(2rem, 6vw, 3rem); }
  .hero-art { justify-self: end; max-width: 13rem; }
}

/* Dual-screen devices and foldables that report two side-by-side viewport segments
   (a hinge or fold down the middle): headline on the left screen, weave on the right,
   nothing across the fold. Browsers without viewport segments ignore this block. */
@media (horizontal-viewport-segments: 2) {
  .wrap { width: 100%; }
  .hero, .points {
    grid-template-columns: calc(env(viewport-segment-width 0 0) - 2 * var(--pad)) minmax(0, 1fr);
    column-gap: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0) + 2 * var(--pad));
  }
  .hero-art { justify-self: start; max-width: min(100%, 24rem); }
  .points { row-gap: 1.5rem; }
}
