/* ==========================================================================
   AppanDesign — Base
   Averix design tokens, reset, and the typographic primitives.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Palette — raw values
   -------------------------------------------------------------------------- */
:root {
  /* Ink ramp */
  --ink:        #0f0f0f;
  --ink-pure:   #000000;
  --ink-18:     #181818;
  --ink-1e:     #1e1e1e;
  --ink-31:     #313131;
  --ink-33:     #333333;

  /* Grays */
  --gray:       #545454;
  --gray-66:    #666666;
  --gray-c5:    #c5c5c5;
  --gray-d9:    #d9d9d9;

  /* Light surfaces */
  --off-f5:     #f5f5f5;
  --off-f8:     #f8f8f8;
  --white:      #ffffff;

  /* Accents */
  --amber:      #ecb014;
  --red:        #ff3d2e;
  --teal:       #003b49;

  /* Alpha ink — hairlines, veils, shadows */
  --ink-a90:    rgba(15, 15, 15, 0.9);
  --ink-a75:    rgba(15, 15, 15, 0.75);
  --ink-a50:    rgba(15, 15, 15, 0.5);
  --ink-a30:    rgba(15, 15, 15, 0.3);
  --ink-a20:    rgba(15, 15, 15, 0.2);
  --ink-a08:    rgba(15, 15, 15, 0.08);
  --gray-a50:   rgba(84, 84, 84, 0.5);
  --gray-a30:   rgba(84, 84, 84, 0.3);
  --gray-a20:   rgba(84, 84, 84, 0.2);
  --gray-a12:   rgba(84, 84, 84, 0.12);
  --white-a20:  rgba(255, 255, 255, 0.2);
  --white-a50:  rgba(255, 255, 255, 0.5);
}

/* --------------------------------------------------------------------------
   2. Semantic tokens — light context is the default
   Dark bands re-declare these under `.is-dark`, so every component below
   can be written once and simply inherit the right values.
   -------------------------------------------------------------------------- */
:root {
  --text-heading:  var(--ink);
  --text-body:     var(--gray);
  --text-strong:   var(--ink);
  --text-muted:    var(--gray-66);
  --text-faint:    var(--gray-a50);

  --accent:        var(--amber);
  --accent-ink:    var(--ink);          /* readable text on an amber fill */

  --surface:       var(--white);
  --surface-muted: var(--off-f5);
  --surface-card:  var(--white);

  --border-hair:   var(--gray-a30);
  --border-soft:   var(--gray-a20);
  --border-field:  var(--gray-a12);
  --border-strong: var(--ink);

  --action-fill:   var(--ink);
  --action-text:   var(--white);
  --action-knob:   var(--white);
  --action-glyph:  var(--ink);

  --ring-nav:      inset 0 0 0 1px var(--gray-a20);
  --ring-card:     inset 0 0 0 1px var(--gray-a50);
  --ring-panel:    inset 0 0 0 1px var(--gray-a30);
  --ring-pill:     inset 0 0 0 1px var(--ink);
  --shadow-card:   0 12px 40px 4px rgba(15, 15, 15, 0.08);
  --shadow-nav:    0 8px 30px rgba(15, 15, 15, 0.06);
}

/* Dark bands: the hero, the services block, the closing CTA, the footer. */
.is-dark {
  --text-heading:  var(--white);
  --text-body:     var(--gray-c5);
  --text-strong:   var(--white);
  --text-muted:    var(--white-a50);
  --text-faint:    var(--white-a20);

  --surface:       var(--ink);
  --surface-muted: var(--ink-18);
  --surface-card:  var(--ink-1e);

  --border-hair:   var(--white-a20);
  --border-soft:   var(--white-a20);
  --border-field:  var(--white-a20);
  --border-strong: var(--white);

  --action-fill:   var(--white);
  --action-text:   var(--ink);
  --action-knob:   var(--ink);
  --action-glyph:  var(--white);

  --ring-pill:     inset 0 0 0 1px var(--white-a20);
  --ring-card:     inset 0 0 0 1px var(--white-a20);
  --ring-panel:    inset 0 0 0 1px var(--white-a20);

  background: var(--ink);
  color: var(--text-heading);
}

/* --------------------------------------------------------------------------
   3. Type
   Averix measures its scale on a fixed 1920px frame. Here every step is
   fluid and tops out at the measured value.
   -------------------------------------------------------------------------- */
:root {
  --font-display: "General Sans", "General Sans Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body:    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ui:      "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-accent:  Outfit, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-brand:   "Funnel Display", "General Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* Display steps — General Sans Semibold */
  --size-mega:    clamp(46px, 8.4vw, 160px);
  --size-hero:    clamp(42px, 7.9vw, 150px);
  --size-display: clamp(38px, 5.3vw, 100px);
  --size-h1:      clamp(32px, 3.7vw, 70px);
  --size-h2:      clamp(27px, 2.7vw, 50px);
  --size-h3:      clamp(22px, 1.9vw, 36px);
  --size-h4:      clamp(19px, 1.3vw, 24px);

  --lh-mega:    1.06;
  --lh-hero:    1.07;
  --lh-display: 1.10;
  --lh-h1:      1.14;
  --lh-h2:      1.20;
  --lh-h3:      1.28;
  --lh-h4:      1.42;

  --track-tight: -0.02em;
  --track-snug:  -0.01em;

  /* Body steps — Inter */
  --size-quote:   clamp(22px, 2.1vw, 40px);
  --size-lead:    clamp(17px, 1.25vw, 24px);
  --size-body-lg: clamp(16px, 1.05vw, 20px);
  --size-body:    clamp(15px, 0.95vw, 18px);
  --size-body-sm: clamp(14px, 0.85vw, 16px);
  --size-label:   clamp(13px, 0.95vw, 18px);
  --size-micro:   12.5px;

  --lh-quote: 1.35;
  --lh-lead:  1.58;
  --lh-body:  1.55;
  --lh-loose: 1.7;
}

/* --------------------------------------------------------------------------
   4. Layout & motion tokens
   -------------------------------------------------------------------------- */
:root {
  --frame:        1920px;
  --shell:        1604px;   /* the recurring content column */
  --shell-narrow: 1240px;
  --gutter:       clamp(20px, 8.2vw, 158px);
  --gutter-nav:   clamp(16px, 5.2vw, 100px);

  --section-y:    clamp(72px, 6.8vw, 130px);
  --section-y-lg: clamp(90px, 9vw, 170px);
  --eyebrow-gap:  clamp(20px, 2.2vw, 43px);
  --rule-len:     50px;

  --radius-field:  10px;
  --radius-chip:   8px;
  --radius-card:   18px;
  --radius-pill:   30px;
  --radius-button: 40px;
  --radius-nav:    100px;

  --ease:       cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.76, 0, 0.24, 1);
  --duration-fast: 180ms;
  --duration-base: 300ms;
  --duration-slow: 600ms;

  --nav-h: 80px;
}

/* --------------------------------------------------------------------------
   5. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: var(--weight-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  color: var(--text-heading);
  letter-spacing: var(--track-snug);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-base) var(--ease), opacity var(--duration-base) var(--ease);
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

button { background: none; border: 0; padding: 0; cursor: pointer; }

input, textarea, select, button { font: inherit; color: inherit; }

::selection { background: var(--amber); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 2100;
  padding: 12px 20px;
  background: var(--amber);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--size-body-sm);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-pill);
  transition: top var(--duration-base) var(--ease);
}
.skip-link:focus { top: 16px; }

/* --------------------------------------------------------------------------
   6. Typographic primitives
   -------------------------------------------------------------------------- */

/* Eyebrow — uppercase label with the short rule Averix puts beside it */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-ui);
  font-weight: var(--weight-semibold);
  font-size: var(--size-label);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-heading);
}
.eyebrow::before {
  content: "";
  width: var(--rule-len);
  height: 1px;
  background: var(--amber);
  flex-shrink: 0;
}
.eyebrow--amber { color: var(--amber); }

/* Display headings */
.display {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  color: var(--text-heading);
  letter-spacing: var(--track-snug);
  line-height: var(--lh-h1);
}
.display--mega { font-size: var(--size-mega);    line-height: var(--lh-mega);    letter-spacing: var(--track-tight); }
.display--hero { font-size: var(--size-hero);    line-height: var(--lh-hero);    letter-spacing: var(--track-tight); }
.display--page { font-size: var(--size-display); line-height: var(--lh-display); letter-spacing: var(--track-tight); }
.display--xl   { font-size: var(--size-h1);      line-height: var(--lh-h1); }
.display--lg   { font-size: var(--size-h1);      line-height: var(--lh-h1); }
.display--md   { font-size: var(--size-h2);      line-height: var(--lh-h2); }
.display--sm   { font-size: var(--size-h3);      line-height: var(--lh-h3); }
.display--xs   { font-size: var(--size-h4);      line-height: var(--lh-h4); }

/* Body copy */
.lede {
  font-family: var(--font-body);
  font-size: var(--size-lead);
  line-height: var(--lh-lead);
  color: var(--text-body);
}
.copy {
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--lh-loose);
  color: var(--text-body);
}
.copy--sm { font-size: var(--size-body-sm); }
.meta {
  font-family: var(--font-ui);
  font-size: var(--size-body-sm);
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

/* Measure helpers */
.measure-xs { max-width: 34ch; }
.measure-sm { max-width: 42ch; }
.measure    { max-width: 50ch; }
.measure-lg { max-width: 58ch; }
.measure-xl { max-width: 66ch; }

.accent { color: var(--amber); }
