/* ==========================================================================
   Easco — brand foundation
   Layered on top of Bootstrap 5.3 (grid + utilities). Tokens first,
   then base, then components. Product themes are set with data-product.
   ========================================================================== */

:root {
  /* Neutrals */
  --paper: #F7F5F0;
  --paper-2: #EFECE4;
  --surface: #FFFFFF;
  --ink: #141414;
  --ink-2: #5E5C56;
  --ink-3: #8A867D;      /* decorative only — below 4.5:1 */
  --line: #E4E0D6;
  --line-strong: #D3CEC1;

  /* Brand accent — "the dot" */
  --accent: #E5481F;     /* decorative, large type, the period */
  --accent-ink: #C93A15; /* small text on paper/white */

  /* Product family — taken from each live product's own CSS; keep in sync */
  --dtt: #0F766E;          /* dtt.easco.ie --primary */
  --dtt-ink: #0F766E;
  --dtt-tint: #E7F3EF;
  --carindex: #EB5C25;     /* carindex.easco.ie logo stop */
  --carindex-ink: #C34719; /* carindex.easco.ie --primary */
  --carindex-tint: #FBEDE6;
  --refuel: #D54A24;       /* refuel.easco.ie --primary */
  --refuel-ink: #B93E1E;   /* refuel.easco.ie --primary-hover */
  --refuel-tint: #FBECE5;

  /* Type */
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-display: clamp(3rem, 1.6rem + 5.6vw, 6.5rem);
  --fs-h2: clamp(2rem, 1.35rem + 2.6vw, 3.5rem);
  --fs-h3: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  --fs-lead: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;
  --fs-label: 0.75rem;

  /* Space (spacious scale) */
  --space-section: clamp(5rem, 3rem + 8vw, 10rem);

  /* Shape & motion */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 180ms;
  --dur: 320ms;
  --dur-slow: 640ms;

  /* Bootstrap overrides */
  --bs-body-bg: var(--paper);
  --bs-body-color: var(--ink);
  --bs-body-font-family: var(--font-body);
  --bs-body-font-size: var(--fs-body);
  --bs-body-line-height: 1.6;
  --bs-border-color: var(--line);
  --bs-link-color-rgb: 20, 20, 20;
  --bs-link-hover-color-rgb: 201, 58, 21;
  --bs-focus-ring-color: rgba(229, 72, 31, 0.35);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--ink); color: var(--paper); }

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: var(--ink);
  font-variation-settings: "opsz" 96;
  text-wrap: balance;
}
h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; line-height: 1.15; font-variation-settings: "opsz" 32; }
p { text-wrap: pretty; }

a { text-underline-offset: 0.2em; text-decoration-thickness: 1px; transition: color var(--dur-fast) ease; }

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

.container-ea { max-width: 1280px; --bs-gutter-x: 2.5rem; }
@media (min-width: 992px) { .container-ea { --bs-gutter-x: 4rem; } }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.lead-ea { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2); max-width: 34rem; }
.dot { color: var(--accent); }

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .5rem .875rem; border-radius: 8px;
  text-decoration: none; transition: top var(--dur-fast) ease;
}
.skip-link:focus { top: 1rem; color: var(--paper); }

/* --------------------------------------------------------------------------
   Wordmark — lowercase, tight, the period carries the accent
   -------------------------------------------------------------------------- */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 1.625rem;
  letter-spacing: -0.055em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  font-variation-settings: "opsz" 48;
}
.wordmark .wm-dot {
  display: inline-block;
  color: var(--accent);
  transition: transform var(--dur) var(--ease-out);
}
a.wordmark:hover { color: var(--ink); }
a.wordmark:hover .wm-dot { transform: translateX(0.12em); }

/* --------------------------------------------------------------------------
   Navigation — no hamburger; three links fit at 360px
   -------------------------------------------------------------------------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) ease;
}
.site-nav.is-scrolled { border-bottom-color: var(--line); }
.site-nav .nav-inner { height: 4.25rem; }
.nav-links { display: flex; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 .75rem; border-radius: 999px;
  font-size: .9375rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.nav-links a:hover { color: var(--ink); background: var(--paper-2); }
@media (max-width: 400px) {
  .nav-links a { padding: 0 .5rem; font-size: .875rem; }
  .site-nav .wordmark { font-size: 1.4rem; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn-ea {
  --arrow-shift: 0;
  display: inline-flex; align-items: center; gap: .625rem;
  min-height: 52px; padding: 0 1.5rem;
  border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper);
  font-weight: 500; font-size: 1rem; text-decoration: none;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.btn-ea:hover { background: #000; color: var(--paper); }
.btn-ea:active { transform: scale(0.98); }
.btn-ea .arrow { transition: transform var(--dur) var(--ease-out); }
.btn-ea:hover .arrow { transform: translateX(3px); }
.btn-ea.down:hover .arrow { transform: translateY(3px); }

.link-ea {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px;
  font-weight: 500; color: var(--ink); text-decoration: none;
}
.link-ea span { background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; transition: background-size var(--dur) var(--ease-out); }
.link-ea:hover span { background-size: 0 1px; background-position: 100% 100%; }

.arrow { width: 1em; height: 1em; flex: none; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { padding-top: clamp(2rem, 1rem + 3vw, 3rem); padding-bottom: clamp(2rem, 1.25rem + 2vw, 3rem); }
.hero h1 { font-size: var(--fs-display); max-width: 11ch; margin: 1rem 0 1.25rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin-top: 1.75rem; }

/* The headline's full stop arrives last: a short move forward, then it settles */
.js .hero-dot { display: inline-block; animation: dot-arrive 900ms var(--ease-out) 700ms both; }
@keyframes dot-arrive {
  0%   { opacity: 0; transform: translateX(-0.45em); }
  45%  { opacity: 1; }
  75%  { transform: translateX(0.05em); }
  100% { opacity: 1; transform: none; }
}

/* Products follow the hero closely so the first cards show in the first view */
#products { padding-top: clamp(2rem, 1.25rem + 2vw, 2.5rem); }
#products .section-head { margin-bottom: 2rem; }
#products .section-head h2 { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); }

/* The device: a tangled line that resolves into a straight path, ending at the dot.
   Tangle is a fixed-ratio SVG; the straight run is a flexible line, so it works at any width. */
.way {
  display: flex; align-items: center; width: 100%;
  margin-top: clamp(3rem, 2rem + 4vw, 5.5rem);
  color: var(--ink);
}
.way-tangle { flex: none; width: clamp(150px, 26vw, 340px); height: auto; overflow: visible; }
.way-path {
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.way-line { flex: 1; height: 2px; background: currentColor; transform-origin: left center; margin-left: -1px; }
.way-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); margin-left: 10px; }
.way-labels { display: flex; justify-content: space-between; margin-top: 1rem; }

.js .way .way-path { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.js .way .way-line { transform: scaleX(0); }
.js .way .way-dot { opacity: 0; transform: scale(0.2); }
.way.is-drawn .way-path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.5s cubic-bezier(.45,.05,.35,1); }
.way.is-drawn .way-line { transform: scaleX(1); transition: transform 1.1s var(--ease-out) 1.35s; }
.way.is-drawn .way-dot { opacity: 1; transform: scale(1); transition: opacity .25s ease 2.15s, transform .6s cubic-bezier(.34,1.56,.64,1) 2.15s; }

/* Product names beside the hero button */
.family-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1.5rem; margin: 0; }
.family-line .p-word { font-size: 1.375rem; padding: .625rem 0; }
.family-line .is-soon { color: var(--ink-2); }
.family-line small { font-family: var(--font-mono); font-size: .6875rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-left: .25rem; }

/* Full-stop field (canvas, drawn in easco.js) */
.dotfield { display: block; width: 100%; height: 100%; min-height: 340px; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding: var(--space-section) 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); }
.section-head h2 { font-size: var(--fs-h2); margin: .875rem 0 0; max-width: 14ch; }
.section-head p { color: var(--ink-2); max-width: 26rem; margin: 0; }
.rule { border: 0; border-top: 1px solid var(--line); opacity: 1; margin: 0; }

/* --------------------------------------------------------------------------
   Product card system
   Theme via data-product="dtt|carindex|refuel" → --p, --p-ink, --p-tint
   -------------------------------------------------------------------------- */
[data-product="dtt"]      { --p: var(--dtt);      --p-ink: var(--dtt-ink);      --p-tint: var(--dtt-tint); }
[data-product="carindex"] { --p: var(--carindex); --p-ink: var(--carindex-ink); --p-tint: var(--carindex-tint); }
[data-product="refuel"]   { --p: var(--refuel);   --p-ink: var(--refuel-ink);   --p-tint: var(--refuel-tint); }

.p-card {
  position: relative;
  display: flex; flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  transition: border-color var(--dur) ease, box-shadow var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
a.p-card:hover, a.p-card:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--p) 45%, var(--line));
  box-shadow: 0 1px 0 rgba(20,20,20,.02), 0 24px 48px -24px color-mix(in srgb, var(--p) 40%, transparent);
  transform: translateY(-4px);
}
a.p-card:focus-visible { outline-offset: 4px; border-radius: var(--radius-lg); }

.p-card__stage {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--paper-2);
  display: grid; place-items: end center;
  padding: 2rem 2rem 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.p-card__body { display: flex; flex-direction: column; gap: 1rem; padding: 1.75rem; flex: 1; }
.p-card__top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem 1rem; }
.p-card__name { white-space: nowrap; font-family: var(--font-display); font-weight: 700; font-size: 1.375rem; letter-spacing: -0.03em; line-height: 1.1; margin: 0; }
.p-card__domain { display: block; margin-top: .5rem; font-family: var(--font-mono); font-size: .8125rem; color: var(--ink-2); }
.p-card__desc { color: var(--ink-2); margin: 0; max-width: 34rem; }
.p-card__cta {
  margin-top: auto; padding-top: .5rem;
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 500; color: var(--p-ink);
}
.p-card__cta .arrow { transition: transform var(--dur) var(--ease-out); }
a.p-card:hover .p-card__cta .arrow { transform: translateX(4px); }

/* Product wordmark: same construction as "easco." — lowercase, tight,
   the full stop carries the product colour. This is the only product mark. */
.p-word {
  display: inline-block; margin: 0;
  font-family: var(--font-display); font-weight: 750;
  font-size: clamp(1.625rem, 1.4rem + .8vw, 2rem);
  letter-spacing: -0.05em; line-height: 1;
  font-variation-settings: "opsz" 48;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.p-word .fam { color: var(--ink-3); font-weight: 600; }
.p-word .pd { display: inline-block; color: var(--p, var(--accent)); transition: transform var(--dur) var(--ease-out); }
a.p-word:hover { color: var(--ink); }
a.p-word:hover .pd, a.p-card:hover .p-word .pd { transform: translateX(.14em); }
a.p-word:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: var(--line-strong); }

/* Status: a plain label, no badge */
.status {
  font-family: var(--font-mono); font-size: .6875rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2); white-space: nowrap; padding-top: .35rem;
}
.status.is-soon { color: var(--p-ink); }

/* Coming-soon variant: quieter, not clickable as a product link */
.p-card.is-soon { background: transparent; border-style: dashed; border-color: var(--line-strong); }
.p-card.is-soon .p-card__stage { background: repeating-linear-gradient(-45deg, transparent 0 10px, var(--line) 10px 11px), var(--paper); border-bottom-style: dashed; border-bottom-color: var(--line-strong); }
.p-card.is-soon .p-word { color: var(--ink-2); }

@media (min-width: 992px) {
  .p-card--wide { flex-direction: row; }
  .p-card--wide .p-card__stage { aspect-ratio: auto; flex: 0 0 52%; border-bottom: 0; border-right: 1px dashed var(--line-strong); padding: 2rem 2rem 0; min-height: 300px; }
  .p-card--wide .p-card__body { justify-content: center; padding: 2.5rem; }
}

/* "More to come" slot — keeps the grid open-ended */
.p-slot {
  height: 100%; min-height: 220px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding: 1.75rem; border-radius: var(--radius-lg);
  border: 1px dashed var(--line-strong);
  color: var(--ink-2);
}
.p-word.is-ghost { color: var(--ink-3); }
.p-word.is-ghost .pd { color: var(--ink-3); }
.p-word .blank { display: inline-block; width: 2.6em; height: .08em; margin-left: .05em; background: repeating-linear-gradient(90deg, var(--ink-3) 0 .18em, transparent .18em .3em); vertical-align: baseline; }

/* --------------------------------------------------------------------------
   Product screenshots — real captures of each live site, framed and
   bleeding off the bottom of the stage. Re-capture when the sites change.
   -------------------------------------------------------------------------- */
.shot {
  display: block; align-self: end;
  width: 100%; height: auto;
  border: 1px solid var(--line-strong); border-bottom: 0;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 18px 40px -24px rgba(20, 20, 20, .28);
  transform: translateY(10px);
  transition: transform var(--dur-slow) var(--ease-out);
}
a.p-card:hover .shot { transform: translateY(0); }

/* --------------------------------------------------------------------------
   Philosophy — the one dark band
   -------------------------------------------------------------------------- */
.philosophy { background: var(--ink); color: var(--paper); }
.philosophy h2 { color: var(--paper); font-size: clamp(2.5rem, 1.4rem + 4.6vw, 5.5rem); max-width: 13ch; margin: 1.25rem 0 0; }
.philosophy h2 .soft { color: color-mix(in srgb, var(--paper) 45%, var(--ink)); }
.philosophy p:not(.eyebrow) { color: color-mix(in srgb, var(--paper) 78%, var(--ink)); font-size: var(--fs-lead); max-width: 32rem; }
.philosophy .eyebrow { color: color-mix(in srgb, var(--paper) 70%, var(--ink)); }
.philosophy .way { color: var(--paper); }
.philosophy .way-labels { color: color-mix(in srgb, var(--paper) 70%, var(--ink)); }

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.about h2 { font-size: var(--fs-h2); margin: .875rem 0 0; max-width: 12ch; }
.about-copy p { font-size: var(--fs-lead); line-height: 1.6; color: var(--ink-2); }
.about-copy p:first-child { color: var(--ink); }
.principles { list-style: none; padding: 0; margin: 2.5rem 0 0; border-top: 1px solid var(--line); }
.principles li { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.principles .n { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--accent-ink); padding-top: .2rem; }
.principles strong { display: block; font-weight: 600; margin-bottom: .125rem; }
.principles span { color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Contact + footer
   -------------------------------------------------------------------------- */
.contact { padding: clamp(4rem, 3rem + 4vw, 7rem) 0; border-top: 1px solid var(--line); }
.contact h2 { font-size: var(--fs-h2); margin: 0; }
.contact-mail {
  display: inline-flex; align-items: center; gap: .75rem; margin-top: 1.25rem;
  font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em;
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.5rem);
  color: var(--ink); text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  transition: background-size var(--dur) var(--ease-out);
  padding-bottom: .15em;
}
.contact-mail:hover { color: var(--ink); background-size: 100% 2px; }

.site-footer { padding: 3.5rem 0 2.5rem; border-top: 1px solid var(--line); font-size: var(--fs-small); }
.site-footer .tagline { color: var(--ink-2); margin-top: .75rem; }
.footer-h { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: .75rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links a, .footer-links span { display: inline-flex; align-items: center; gap: .5rem; min-height: 36px; color: var(--ink); text-decoration: none; }
.footer-links a:hover { color: var(--accent-ink); }
.footer-links .soon { color: var(--ink-2); }
.footer-links .tag { font-family: var(--font-mono); font-size: .625rem; letter-spacing: .06em; text-transform: uppercase; padding: .125rem .4rem; border: 1px dashed var(--line-strong); border-radius: 4px; color: var(--ink-2); }
.footer-base { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--ink-2); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; }

/* --------------------------------------------------------------------------
   Email links: the address never appears in the HTML. Until a visitor
   interacts, CSS draws it from two attributes (not in the DOM text bots read);
   easco.js then writes the real text and mailto link. See easco.js.
   -------------------------------------------------------------------------- */
.js-mail:empty::before { content: attr(data-a) "\40" attr(data-b); }
a.js-mail:not([href]) { cursor: text; }

/* --------------------------------------------------------------------------
   Reveal on scroll (progressive enhancement)
   -------------------------------------------------------------------------- */
.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); transition-delay: var(--d, 0ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Reduced motion — final states, no movement
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .way .way-path { stroke-dashoffset: 0; }
  .js .way .way-line, .js .way .way-dot { opacity: 1; transform: none; }
  a.p-card:hover { transform: none; }
}
