/* Ellis Three Engineering & Surveying — shared stylesheet.
   Two pages (index, about) share this; keep page-specific rules to a minimum. */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --ink:       #16191c;
  --ink-soft:  #4e565e;
  --ink-faint: #868e96;
  --paper:     #fbfaf8;
  --paper-alt: #f3f1ec;
  /* Deep green — the single accent. One hue, used sparingly. */
  --accent:    #2f6b4a;
  --rule:      rgba(22, 25, 28, 0.11);

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 5.5vw, 5rem);
  --col:    1140px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:       #e9e7e3;
    --ink-soft:  #a2a8af;
    --ink-faint: #6d757d;
    --paper:     #101315;
    --paper-alt: #171b1e;
    --accent:    #6fb089;
    --rule:      rgba(233, 231, 227, 0.14);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* One centred column; every band applies it so the full-bleed drawing strip can
   sit between them without any 100vw scrollbar arithmetic. */
.wrap {
  max-width: var(--col);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Small letterspaced mono labels — the visual language of a drawing's title
   block, which is where this firm's credibility actually lives. */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

/* ── Masthead ───────────────────────────────────────────────────────────── */
.masthead {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-block: clamp(1.75rem, 4vh, 2.75rem);
}
.masthead .brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
}
.mark { display: block; flex: none; }
.mark rect { fill: var(--accent); }
.wordmark .name {
  display: block;
  font-size: clamp(0.95rem, 1.7vw, 1.08rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.1;
}
.wordmark .qualifier {
  display: block;
  font-family: var(--mono);
  font-size: clamp(0.58rem, 1.15vw, 0.67rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.4em;
}

.masthead nav {
  margin-inline-start: auto;
  display: flex;
  gap: clamp(1rem, 2.5vw, 1.9rem);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.masthead nav a {
  text-decoration: none;
  color: var(--ink-faint);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}
.masthead nav a:hover { color: var(--ink); }
.masthead nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero { padding-block: clamp(2.5rem, 8vh, 5rem) clamp(2rem, 6vh, 3.5rem); }
.hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
  margin: 1.1rem 0 0;
  max-width: 17ch;
  text-wrap: balance;
}
.hero .sub {
  margin: 1.5rem 0 0;
  max-width: 58ch;
  font-size: clamp(1rem, 1.5vw, 1.13rem);
  font-weight: 300;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ── Drawing band ───────────────────────────────────────────────────────── */
/* drawings.png is an ALPHA STENCIL of the firm's own plan sheets, not a
   picture. Used as a mask it takes its colour from background-color, so a
   single 71 KB asset renders correctly in light and dark themes alike. */
.band {
  height: clamp(96px, 15vw, 172px);
  background-color: var(--accent);
  /* Line art needs more alpha on a dark ground than a light one to read at the
     same strength — see the dark-theme override below. */
  opacity: 0.5;
  -webkit-mask-image: url("/drawings.png");
          mask-image: url("/drawings.png");
  -webkit-mask-size: cover;       mask-size: cover;
  -webkit-mask-position: center;  mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
/* Graceful fallback: browsers without mask support would paint a solid green
   slab, which is worse than nothing. Only show the band where masks work. */
@supports not ((-webkit-mask-image: url("#x")) or (mask-image: url("#x"))) {
  .band { display: none; }
}
@media (prefers-color-scheme: dark) {
  .band { opacity: 0.62; }
}

/* ── Services / column sections ─────────────────────────────────────────── */
.services { padding-block: clamp(3rem, 9vh, 5.5rem); }
.services .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  margin-top: 2.25rem;
}
.services h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0.85rem 0 0;
}
.services .blurb {
  margin: 0.85rem 0 0;
  color: var(--ink-soft);
  font-weight: 300;
  font-size: 0.97rem;
  text-wrap: pretty;
}
.services ul {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  counter-reset: sheet;
}
.services li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
/* Sheet-index numerals, the way a plan set lists its drawings. */
.services li::before {
  content: counter(sheet, decimal-leading-zero);
  counter-increment: sheet;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  flex: none;
}

/* ── Prose (about page) ─────────────────────────────────────────────────── */
.prose { padding-block: clamp(2rem, 6vh, 3.5rem) clamp(3rem, 9vh, 5rem); }
.prose .body {
  max-width: 62ch;
  font-size: clamp(1rem, 1.4vw, 1.08rem);
  font-weight: 300;
  color: var(--ink-soft);
}
.prose .body p { margin: 0 0 1.35rem; text-wrap: pretty; }
.prose .body p:last-child { margin-bottom: 0; }
.prose .body strong { color: var(--ink); font-weight: 500; }
.prose h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin: 0.85rem 0 1.4rem;
  max-width: 22ch;
  text-wrap: balance;
}
.prose section + section { margin-top: clamp(2.75rem, 7vh, 4.25rem); }

/* Licence credentials, set like a title block. */
.credentials {
  margin: 2.25rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.credentials li {
  background: var(--paper);
  padding: 1.15rem 1.25rem;
}
.credentials .k {
  display: block;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.credentials .v {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 1.02rem;
  color: var(--ink);
}

/* ── Contact ────────────────────────────────────────────────────────────── */
.contact {
  background: var(--paper-alt);
  border-block: 1px solid var(--rule);
  padding-block: clamp(2.75rem, 8vh, 4.5rem);
}
.contact .inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
}
.contact h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0.9rem 0 0;
  max-width: 14ch;
  text-wrap: balance;
}
.contact dl { margin: 0; }
.contact dt {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.contact dd { margin: 0.35rem 0 0; font-size: 1.05rem; }
.contact dd + dt { margin-top: 1.5rem; }
.contact dd a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  /* A long address must never force a horizontal scrollbar on a phone. */
  overflow-wrap: anywhere;
  transition: color 140ms ease;
}
.contact dd a:hover { color: var(--accent); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer { padding-block: clamp(2rem, 5vh, 3rem); }
footer .inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem clamp(1.5rem, 4vw, 3rem);
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.78rem;
  color: var(--ink-faint);
}
footer p { margin: 0; }
footer .licence { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; }
footer .legal { flex-basis: 100%; max-width: 76ch; text-wrap: pretty; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
