@layer reset, tokens, base, hero, catalogue, support, responsive;

@font-face {
  font-family: "Covington Expanded";
  src: url("../fonts/covington/covington.exp.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Covington Expanded";
  src: url("../fonts/covington/covington.exp-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@layer tokens {
  :root {
    --th-o: #FC4C02;
    --th-c: #F6E8D7;
    --th-k: #0D1117;
    --th-white: #FFF9F0;
    --th-page: #F6E8D7;
    --th-panel: #FFF9F0;
    --th-text: #0D1117;
    --th-muted: #655E55;
    --th-line: rgba(13, 17, 23, .25);
    --th-soft-line: rgba(13, 17, 23, .13);
    --th-display: "Covington Expanded", Georgia, serif;
    --th-body: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --th-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
    --th-ease: cubic-bezier(.16, 1, .3, 1);
    --th-shell: min(1440px, calc(100vw - 48px));
  }

  html[data-ee-theme="dark"] {
    --th-page: #151A20;
    --th-panel: #1B2128;
    --th-text: #F6E8D7;
    --th-muted: #B7AA9A;
    --th-line: rgba(246, 232, 215, .22);
    --th-soft-line: rgba(246, 232, 215, .11);
  }
}

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { min-width: 320px; scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
  body, h1, h2, h3, p, ul, ol, figure { margin: 0; }
  ul, ol { padding: 0; list-style: none; }
  img, svg { display: block; max-width: 100%; }
  button, input, select, textarea { font: inherit; }
  button, summary { cursor: pointer; }
  a { color: inherit; }
}

@layer base {
  body.ee-tools-hub {
    min-width: 320px;
    overflow-x: clip;
    background: var(--th-page);
    color: var(--th-text);
    font: 500 16px/1.5 var(--th-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  body.ee-tools-hub::selection { background: var(--th-o); color: var(--th-k); }

  .tools-skip {
    position: fixed;
    z-index: 2000;
    top: 10px;
    left: 10px;
    padding: 10px 14px;
    background: var(--th-c);
    color: var(--th-k);
    border: 1px solid var(--th-k);
    transform: translateY(-180%);
  }

  .tools-skip:focus { transform: none; }
  :focus-visible { outline: 3px solid var(--th-o); outline-offset: 3px; }

  .tools-index-label {
    font: 900 9px/1.25 var(--th-mono);
    letter-spacing: .12em;
    text-transform: uppercase;
  }
}

@layer hero {
  .tools-hero {
    width: 100%;
    min-height: calc(100svh - 68px);
    border-bottom: 1px solid var(--th-line);
  }

  .tools-route-band {
    width: var(--th-shell);
    min-height: 40px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--th-muted);
    border-bottom: 1px solid var(--th-line);
    font: 900 8px/1 var(--th-mono);
    letter-spacing: .1em;
    text-transform: uppercase;
  }

  .tools-route-band strong { color: var(--th-o); font-weight: 900; }

  .tools-hero__layout {
    width: var(--th-shell);
    min-height: calc(100svh - 108px);
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(300px, .36fr) minmax(0, .64fr);
    grid-template-rows: minmax(132px, auto) minmax(456px, 1fr);
    grid-template-areas: "intro intro" "selector preview";
  }

  .tools-intro {
    grid-area: intro;
    min-width: 0;
    padding: 22px 0 20px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    grid-template-rows: auto 1fr auto;
    column-gap: clamp(32px, 5vw, 76px);
    align-items: end;
    border-bottom: 1px solid var(--th-line);
  }

  .tools-intro > .tools-index-label { grid-column: 1 / -1; margin-bottom: 10px; color: var(--th-o); }

  .tools-intro h1 {
    grid-column: 1;
    grid-row: 2 / 4;
    max-width: 20ch;
    font: 700 clamp(44px, 4.55vw, 70px)/.8 var(--th-display);
    letter-spacing: -.022em;
    text-transform: uppercase;
    text-wrap: balance;
  }

  .tools-intro h1 em {
    display: block;
    color: var(--th-o);
    font-style: normal;
  }

  .tools-intro__deck {
    grid-column: 2;
    grid-row: 2;
    max-width: 46ch;
    margin-top: 0;
    padding-top: 0;
    color: var(--th-muted);
    font-size: clamp(14px, 1.15vw, 17px);
    line-height: 1.55;
  }

  .tools-intro__proof {
    grid-column: 2;
    grid-row: 3;
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }

  .tools-intro__proof span {
    min-height: 30px;
    padding-inline: 10px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--th-line);
    font: 900 7px/1 var(--th-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .tool-preview {
    grid-area: preview;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(226px, .42fr);
    background: #07090C;
    color: var(--th-c);
    border-right: 1px solid rgba(246, 232, 215, .22);
    overflow: hidden;
  }

  .tool-preview__visual {
    position: relative;
    min-width: 0;
    min-height: 360px;
    overflow: hidden;
    border-right: 1px solid rgba(246, 232, 215, .2);
    background:
      linear-gradient(rgba(246, 232, 215, .055) 1px, transparent 1px),
      linear-gradient(90deg, rgba(246, 232, 215, .055) 1px, transparent 1px),
      #07090C;
    background-size: 40px 40px;
  }

  .tool-preview__visual::before,
  .tool-preview__visual::after {
    content: "";
    position: absolute;
    z-index: 2;
    width: 28px;
    height: 28px;
    border-color: var(--th-o);
    pointer-events: none;
  }

  .tool-preview__visual::before { top: 18px; left: 18px; border-top: 2px solid; border-left: 2px solid; }
  .tool-preview__visual::after { right: 18px; bottom: 18px; border-right: 2px solid; border-bottom: 2px solid; }

  .tool-preview__readout {
    position: absolute;
    z-index: 3;
    top: 18px;
    right: 18px;
    padding: 7px 9px;
    background: var(--th-o);
    color: var(--th-k);
    font: 900 7px/1 var(--th-mono);
    letter-spacing: .09em;
    text-transform: uppercase;
  }

  .tool-preview__art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: clamp(28px, 4vw, 58px);
    opacity: 0;
    transform: scale(.985);
    transition: opacity 120ms ease, transform 240ms var(--th-ease);
    pointer-events: none;
  }

  .tool-preview__art.is-active { opacity: 1; transform: none; }
  .tool-preview__art text { fill: #F6E8D7; font: 800 14px var(--th-mono); letter-spacing: .06em; }
  .tool-preview__art .label-small { fill: rgba(246, 232, 215, .58); font-size: 10px; }
  .tool-preview__art .line { fill: none; stroke: #F6E8D7; stroke-width: 5; stroke-linecap: square; stroke-linejoin: miter; }
  .tool-preview__art .line-thin { fill: none; stroke: rgba(246, 232, 215, .45); stroke-width: 1.5; }
  .tool-preview__art .orange { fill: none; stroke: #FC4C02; stroke-width: 5; }
  .tool-preview__art .orange-fill { fill: #FC4C02; }
  .tool-preview__art .cream-fill { fill: #F6E8D7; }
  .tool-preview__art .ghost-fill { fill: rgba(246, 232, 215, .08); stroke: rgba(246, 232, 215, .28); stroke-width: 1.5; }

  .tool-preview__console {
    min-width: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background: #0D1117;
  }

  .tool-preview__channel {
    min-height: 36px;
    padding-bottom: 13px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: rgba(246, 232, 215, .52);
    border-bottom: 1px solid rgba(246, 232, 215, .2);
    font: 900 7px/1.25 var(--th-mono);
    letter-spacing: .09em;
    text-transform: uppercase;
  }

  .tool-preview__channel span:first-child { color: var(--th-o); }

  .tool-preview__task {
    margin-top: auto;
    color: var(--th-o);
    font: 900 8px/1.2 var(--th-mono);
    letter-spacing: .1em;
    text-transform: uppercase;
  }

  .tool-preview__console h2 {
    margin-top: 10px;
    font: 700 clamp(30px, 3vw, 48px)/.86 var(--th-display);
    letter-spacing: -.012em;
    text-transform: uppercase;
  }

  .tool-preview__description {
    margin-top: 14px;
    color: rgba(246, 232, 215, .66);
    font-size: 12px;
    line-height: 1.5;
  }

  .tool-preview__open {
    min-height: 48px;
    margin-top: 22px;
    padding-inline: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--th-o);
    color: var(--th-k);
    border: 1px solid var(--th-o);
    text-decoration: none;
    font: 900 8px/1 var(--th-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    box-shadow: 3px 3px 0 var(--th-c);
    transition: transform 110ms var(--th-ease), box-shadow 110ms var(--th-ease);
  }

  .tool-preview__open:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--th-c); }
  .tool-preview__open:active { transform: translate(2px, 2px); box-shadow: none; }

  .tool-selector {
    grid-area: selector;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(6, minmax(0, 1fr));
    border-left: 1px solid var(--th-line);
    border-bottom: 1px solid var(--th-line);
  }

  .tool-switch {
    position: relative;
    min-width: 0;
    min-height: 0;
    padding: 10px 14px;
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) 22px;
    grid-template-rows: 1fr 1fr;
    align-items: center;
    color: var(--th-text);
    border-right: 1px solid var(--th-line);
    border-bottom: 1px solid var(--th-line);
    text-decoration: none;
    overflow: hidden;
    transition: background-color 120ms ease, color 120ms ease, transform 110ms var(--th-ease);
  }

  .tool-switch:last-child { border-bottom: 0; }

  .tool-switch::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--th-o);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 150ms var(--th-ease);
  }

  .tool-switch.is-active,
  .tool-switch:hover { background: var(--th-k); color: var(--th-c); }
  .tool-switch.is-active::before,
  .tool-switch:hover::before { transform: scaleX(1); }
  .tool-switch:active { transform: translateY(2px); }

  .tool-switch__head {
    grid-column: 1;
    grid-row: 1 / 3;
    display: grid;
    gap: 5px;
    color: var(--th-muted);
    font: 900 7px/1 var(--th-mono);
    letter-spacing: .1em;
    text-transform: uppercase;
  }

  .tool-switch.is-active .tool-switch__head,
  .tool-switch:hover .tool-switch__head { color: rgba(246, 232, 215, .58); }
  .tool-switch__head b { color: var(--th-o); }
  .tool-switch strong { grid-column: 2; grid-row: 1; align-self: end; min-width: 0; font: 700 clamp(19px, 1.75vw, 27px)/.9 var(--th-display); text-transform: uppercase; }
  .tool-switch small { grid-column: 2 / 4; grid-row: 2; align-self: start; display: grid; grid-template-columns: minmax(0, 1fr) 20px; gap: 8px; color: var(--th-muted); font: 800 7px/1.25 var(--th-mono); letter-spacing: .065em; text-transform: uppercase; }
  .tool-switch.is-active small,
  .tool-switch:hover small { color: rgba(246, 232, 215, .62); }
  .tool-switch small span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tool-switch small span:last-child { color: var(--th-o); font-size: 12px; text-align: right; }
}

@layer catalogue {
  .field-index {
    width: var(--th-shell);
    margin-inline: auto;
    padding-block: clamp(86px, 10vw, 154px);
  }

  .field-index__heading {
    margin-bottom: 44px;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
    gap: 28px 54px;
    align-items: end;
  }

  .field-index__heading .tools-index-label { grid-column: 1 / -1; color: var(--th-o); }
  .field-index__heading h2 { max-width: 9ch; font: 700 clamp(52px, 6.5vw, 98px)/.82 var(--th-display); letter-spacing: -.018em; text-transform: uppercase; }
  .field-index__heading > p:last-child { max-width: 42ch; color: var(--th-muted); font-size: 16px; line-height: 1.55; }

  .field-index__rows { border-top: 1px solid var(--th-line); }

  .field-row {
    min-height: 112px;
    display: grid;
    grid-template-columns: 68px minmax(220px, .78fr) minmax(220px, .9fr) minmax(220px, 1.1fr) 64px;
    align-items: center;
    gap: 22px;
    border-bottom: 1px solid var(--th-line);
    color: var(--th-text);
    text-decoration: none;
    transition: background-color 120ms ease, padding 150ms var(--th-ease);
  }

  .field-row:hover { padding-inline: 14px; background: var(--th-panel); }
  .field-row__number { color: var(--th-o); font: 900 9px/1 var(--th-mono); letter-spacing: .1em; }
  .field-row h3 { font: 700 clamp(24px, 2.3vw, 36px)/.9 var(--th-display); text-transform: uppercase; }
  .field-row p { color: var(--th-muted); font-size: 13px; line-height: 1.45; }
  .field-row__output { color: var(--th-text); font: 850 8px/1.45 var(--th-mono); letter-spacing: .07em; text-transform: uppercase; }
  .field-row__arrow { color: var(--th-o); font: 700 25px/1 var(--th-mono); text-align: right; transition: transform 150ms var(--th-ease); }
  .field-row:hover .field-row__arrow { transform: translate(5px, -5px); }
}

@layer support {
  .tools-support {
    background: var(--th-o);
    color: var(--th-k);
    border-block: 1px solid var(--th-k);
  }

  .tools-support__inner {
    width: var(--th-shell);
    min-height: 220px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 38px;
  }

  .tools-support .tools-index-label { margin-bottom: 14px; }
  .tools-support h2 { max-width: 13ch; font: 700 clamp(38px, 4.5vw, 68px)/.84 var(--th-display); letter-spacing: -.015em; text-transform: uppercase; }
  .tools-support__actions { display: flex; gap: 10px; }

  .tools-support__actions a {
    min-height: 50px;
    padding-inline: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--th-k);
    color: var(--th-k);
    text-decoration: none;
    font: 900 8px/1 var(--th-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    box-shadow: 3px 3px 0 var(--th-k);
    transition: transform 110ms var(--th-ease), box-shadow 110ms var(--th-ease), background-color 110ms ease, color 110ms ease;
  }

  .tools-support__actions a:hover { background: var(--th-k); color: var(--th-c); transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--th-k); }
  .tools-support__actions a:active { transform: translate(2px, 2px); box-shadow: none; }

  .tools-disclaimer {
    width: var(--th-shell);
    margin-inline: auto;
    padding-block: 18px;
    color: var(--th-muted);
    font: 750 8px/1.5 var(--th-mono);
    letter-spacing: .045em;
  }

  .tools-footer {
    background: var(--th-k);
    color: var(--th-c);
    border-top: 1px solid rgba(246, 232, 215, .18);
  }

  .tools-footer__inner {
    width: var(--th-shell);
    min-height: 78px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: rgba(246, 232, 215, .64);
    font: 850 8px/1.4 var(--th-mono);
    letter-spacing: .07em;
    text-transform: uppercase;
  }

  .tools-footer a { color: var(--th-c); }
}

@layer responsive {
  @media (max-width: 1100px) {
    .tools-hero__layout { grid-template-columns: minmax(290px, .38fr) minmax(0, .62fr); grid-template-rows: minmax(150px, auto) minmax(470px, 1fr); }
    .tool-preview { grid-template-columns: minmax(0, 1fr) 210px; }
    .tool-preview__console { padding: 16px; }
    .tool-switch { padding-inline: 12px; }
    .field-row { grid-template-columns: 50px minmax(190px, .8fr) minmax(200px, 1fr) minmax(180px, 1fr) 36px; gap: 16px; }
  }

  @media (max-width: 820px) {
    :root { --th-shell: calc(100vw - 24px); }
    .tools-route-band { min-height: 36px; }
    .tools-route-band span:last-child { display: none; }
    .tools-hero__layout {
      min-height: auto;
      grid-template-columns: 1fr;
      grid-template-rows: auto auto auto;
      grid-template-areas: "intro" "preview" "selector";
    }
    .tools-intro { min-height: 310px; padding: 34px 0 28px; grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; align-items: start; border-right: 0; }
    .tools-intro > .tools-index-label { grid-column: 1; grid-row: 1; }
    .tools-intro h1 { grid-column: 1; grid-row: 2; max-width: 10ch; font-size: clamp(56px, 12vw, 78px); }
    .tools-intro__deck { grid-column: 1; grid-row: 3; max-width: 44ch; margin-top: 24px; padding-top: 0; }
    .tools-intro__proof { grid-column: 1; grid-row: 4; }
    .tool-preview { min-height: 430px; border-left: 1px solid rgba(246, 232, 215, .2); }
    .tool-preview__visual { min-height: 430px; }
    .tool-selector { grid-template-columns: 1fr; grid-template-rows: repeat(6, minmax(80px, auto)); }
    .tool-switch { min-height: 80px; }
    .field-index__heading { grid-template-columns: 1fr; }
    .field-index__heading .tools-index-label { grid-column: auto; }
    .field-row { min-height: 100px; grid-template-columns: 44px minmax(0, 1fr) 36px; gap: 14px; }
    .field-row p, .field-row__output { display: none; }
    .tools-support__inner { min-height: 260px; grid-template-columns: 1fr; align-content: center; }
  }

  @media (max-width: 600px) {
    .tools-hero { min-height: auto; }
    .tools-intro { min-height: 285px; }
    .tools-intro h1 { font-size: clamp(50px, 15vw, 68px); }
    .tools-intro__deck { font-size: 14px; }
    .tools-intro__proof span { font-size: 6px; }
    .tool-selector { grid-template-columns: 1fr; grid-template-rows: repeat(6, minmax(82px, auto)); }
    .tool-switch { min-height: 82px; padding: 10px 12px; }
    .tool-switch strong { font-size: clamp(20px, 6.2vw, 25px); }
    .tool-preview { min-height: auto; grid-template-columns: 1fr; }
    .tool-preview__visual { min-height: 280px; border-right: 0; border-bottom: 1px solid rgba(246, 232, 215, .2); }
    .tool-preview__art { padding: 30px; }
    .tool-preview__console { min-height: 230px; }
    .tool-preview__task { margin-top: 24px; }
    .field-index { padding-block: 82px; }
    .field-index__heading { margin-bottom: 28px; }
    .field-index__heading h2 { font-size: clamp(48px, 15vw, 68px); }
    .field-index__heading > p:last-child { font-size: 14px; }
    .tools-support h2 { font-size: clamp(38px, 12vw, 54px); }
    .tools-support__actions { display: grid; grid-template-columns: repeat(2, 1fr); }
    .tools-support__actions a:last-child { grid-column: 1 / -1; }
    .tools-footer__inner { min-height: 100px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
  }

  @media (forced-colors: active) {
    .tool-preview, .tool-switch, .field-row, .tools-support__actions a { border: 1px solid CanvasText; }
  }

  @media print {
    .tools-hero { min-height: auto; }
    .tools-hero__layout { display: block; }
    .tool-preview, .tools-support { display: none; }
    .tool-selector { grid-template-columns: repeat(3, 1fr); grid-template-rows: auto; }
    .tool-switch { min-height: 110px; }
  }
}
