/* ==========================================================================
   Trellum — Colours & Type
   Built Environment Advisory. Editorial, restrained, precise.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  /* ----- Brand colours ----- */
  --teal:        #0F4C4C;  /* primary brand; hero, nav, footer */
  --paper:       #F5F5F3;  /* canvas / page background */
  --canton:      #5D8983;  /* action accent — CTAs, eyebrows, accent bars */
  --slate:       #2E3B3B;  /* primary headings, major UI containers */
  --charcoal:    #202828;  /* body copy */
  --stone:       #BFC8C6;  /* borders, dividers, inactive */
  --stone-light: #E4ECEA;  /* subtle section backgrounds, rules */
  --white:       #FFFFFF;

  /* ----- Semantic colour roles ----- */
  --fg-1: var(--charcoal);        /* body copy */
  --fg-2: var(--slate);           /* headings */
  --fg-3: var(--canton);          /* eyebrows, accents, links */
  --fg-muted: var(--stone);       /* captions, metadata */
  --fg-on-teal: var(--paper);     /* type on Deep Teal */
  --fg-on-teal-muted: rgba(245,245,243,0.75);

  --bg-page: var(--paper);
  --bg-surface: var(--white);
  --bg-brand: var(--teal);
  --bg-subtle: var(--stone-light);

  --border: rgba(191,200,198,0.7);  /* hairline — stone at ~0.5px feel */
  --border-subtle: var(--stone-light);
  --border-inverse: rgba(245,245,243,0.35);

  /* ----- Type families ----- */
  --ff-display: 'DM Serif Display', 'Source Serif Pro', 'Iowan Old Style', Georgia, serif;
  --ff-body: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ff-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ----- Type scale (display) ----- */
  --fs-display-xl: clamp(2.75rem, 6vw, 5.5rem);   /* hero headline — editorial scale */
  --fs-display-lg: clamp(1.75rem, 3.5vw, 2.75rem); /* section heading */
  --fs-display-md: clamp(1.25rem, 2vw, 1.625rem);  /* card heading */
  --fs-display-sm: 18px;

  /* ----- Type scale (body / ui) ----- */
  --fs-lead:  18px;
  --fs-body:  16px;
  --fs-ui:    14px;
  --fs-small: 13px;
  --fs-micro: 11px;        /* eyebrow / uppercase tracked */

  /* ----- Line heights ----- */
  --lh-display: 1.1;
  --lh-heading: 1.2;
  --lh-body:    1.7;
  --lh-ui:      1.4;

  /* ----- Tracking ----- */
  --ls-display: -0.01em;
  --ls-eyebrow: 0.12em;
  --ls-descriptor: 0.18em;

  /* ----- Spacing (8pt-ish, with 4 & 12 for finesse) ----- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 48px;
  --sp-9: 64px;
  --sp-10: 96px;

  /* ----- Radii ----- */
  --r-xs: 2px;   /* tags */
  --r-sm: 4px;   /* buttons */
  --r-md: 6px;   /* swatches, nav */
  --r-lg: 8px;   /* cards, heroes */

  /* ----- Elevation (used sparingly — brand favours hairline borders) ----- */
  --shadow-0: none;
  --shadow-1: 0 1px 0 rgba(32,40,40,0.04);
  --shadow-2: 0 6px 24px -12px rgba(32,40,40,0.18);

  /* ----- Layout ----- */
  --content-max: 1100px;
  --section-py: 96px;
  --hit-target: 44px;

  /* ----- Motion ----- */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.6, 0.0, 0.2, 1);
  --dur-fast: 140ms;
  --dur-base: 240ms;
  --dur-slow: 520ms;
}

/* ==========================================================================
   Base semantic styles — elements inherit brand defaults automatically.
   ========================================================================== */

html, body {
  background: var(--bg-page);
  color: var(--fg-1);
  font-family: var(--ff-body);
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  color: var(--fg-2);
  font-weight: 400;
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
}

h1 { font-size: var(--fs-display-xl); }
h2 { font-size: var(--fs-display-lg); }
h3 { font-size: var(--fs-display-md); line-height: var(--lh-heading); }
h4 { font-size: var(--fs-display-sm); line-height: var(--lh-heading); }

p  { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--fg-1); font-weight: 300; }

small, .caption {
  font-size: var(--fs-small);
  color: var(--fg-muted);
  font-weight: 400;
}

a {
  color: var(--fg-3);
  text-decoration: none;
  border-bottom: 0.5px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
a:hover { border-bottom-color: currentColor; }

code, pre, kbd {
  font-family: var(--ff-mono);
  font-size: 0.92em;
  color: var(--slate);
}

hr {
  border: none;
  border-top: 0.5px solid var(--border-subtle);
  margin: var(--sp-8) 0;
}

/* ==========================================================================
   Utility classes — the signature brand moves.
   ========================================================================== */

/* Eyebrow — small uppercase tracked, Canton */
.eyebrow {
  font-family: var(--ff-body);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-3);
}

/* Descriptor — brand lockup tagline */
.descriptor {
  font-family: var(--ff-body);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: var(--ls-descriptor);
  text-transform: uppercase;
  color: var(--fg-3);
}

/* Canton italic emphasis in display headlines — THE brand signature */
.display em,
h1 em, h2 em {
  font-style: italic;
  color: var(--canton);
}

/* 32 × 2 Canton accent bar — precedes card headings, section openers */
.accent-bar {
  width: 32px;
  height: 2px;
  background: var(--canton);
  margin-bottom: var(--sp-5);
}

/* Hairline section label — "01 — Colour" style */
.section-label {
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-3);
  padding-bottom: var(--sp-2);
  border-bottom: 0.5px solid var(--border);
}

/* Horizontal ruled row — services list pattern */
.ruled-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: 0 1.5rem;
  padding: 1.375rem 0;
  border-bottom: 0.5px solid var(--border);
  align-items: baseline;
  cursor: default;
  transition: padding-left var(--dur-base) var(--ease-out),
              border-left-color var(--dur-base) var(--ease-out);
  border-left: 2px solid transparent;
}
.ruled-row:first-of-type { border-top: 0.5px solid var(--border); }
.ruled-row:hover {
  padding-left: 0.75rem;
  border-left-color: var(--canton);
}
.ruled-row__n {
  font-family: var(--ff-display);
  font-size: var(--fs-display-sm);
  color: var(--stone);
  line-height: var(--lh-display);
}
.ruled-row__title {
  font-family: var(--ff-display);
  font-size: var(--fs-display-md);
  color: var(--slate);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-display);
}
.ruled-row__body {
  font-size: var(--fs-small);
  font-weight: 300;
  color: var(--fg-1);
  line-height: var(--lh-body);
  max-width: 48ch;
}

/* Credential strip — fine inline mid-dot separated items below hero CTA */
.credential-strip {
  display: flex;
  align-items: center;
  gap: 0;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 0.5px solid var(--border-inverse);
  flex-wrap: wrap;
}
.credential-strip__item {
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-on-teal-muted);
}
.credential-strip__item + .credential-strip__item::before {
  content: '·';
  margin: 0 0.75rem;
  color: var(--canton);
  opacity: 0.6;
}

/* ==========================================================================
   App-level utilities — moved out of index.html so per-route HTML files
   can share the same stylesheet.
   ========================================================================== */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { overflow-x: hidden; }
:focus-visible { outline: 2px solid var(--canton); outline-offset: 2px; border-radius: 2px; }
button { font-family: inherit; }

/* In-view fade for sections */
.in-view-target { opacity: 0; transform: translateY(16px); transition: opacity 520ms cubic-bezier(.2,.7,.2,1), transform 520ms cubic-bezier(.2,.7,.2,1); }
.in-view-target.in-view { opacity: 1; transform: none; }

/* Ruled row */
.tr-ruled {
  display: grid;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  border-top: 1px solid transparent;
  border-left: 2px solid transparent;
  transition: padding-left 240ms var(--ease-out), border-left-color 240ms var(--ease-out), background 240ms var(--ease-out);
  cursor: pointer;
  align-items: start;
}
.tr-ruled.first { border-top-color: var(--border); }
.tr-ruled:hover { padding-left: 12px; border-left-color: var(--canton); }
.tr-ruled--dark { border-color: rgba(191,200,198,0.18); }
.tr-ruled--dark.first { border-top-color: rgba(191,200,198,0.18); }

/* Link hover underline */
.tr-link { position: relative; cursor: pointer; transition: color 140ms var(--ease-out); }
.tr-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 140ms var(--ease-out);
}
.tr-link:hover::after { transform: scaleX(1); }

/* Nav link opacity */
.nav-link { opacity: 0.6; transition: opacity 140ms var(--ease-out); cursor: pointer; }
.nav-link:hover, .nav-link.active { opacity: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--ff-body); font-weight: 500; cursor: pointer; border: 1px solid transparent;
  border-radius: 4px; transition: background 140ms var(--ease-out), color 140ms var(--ease-out), border-color 140ms var(--ease-out), opacity 140ms var(--ease-out);
  text-decoration: none; letter-spacing: 0.01em;
}
.btn:active { opacity: 0.85; }
.btn-primary { background: var(--canton); color: var(--paper); }
.btn-primary:hover { background: #4F7771; }
.btn-ghost-dark { background: transparent; color: var(--paper); border-color: rgba(245,245,243,0.35); }
.btn-ghost-dark:hover { border-color: rgba(245,245,243,0.75); }
.btn-ghost-light { background: transparent; color: var(--slate); border-color: var(--stone); }
.btn-ghost-light:hover { border-color: var(--canton); color: var(--teal); }

/* Mobile adjustments */
@media (max-width: 860px) {
  .hide-mob { display: none !important; }
  .mob-stack { grid-template-columns: 1fr !important; gap: 32px !important; }
  .mob-pad { padding-left: 24px !important; padding-right: 24px !important; }
}
