/* Ashpool Software: site styles. Palette and type from docs/brand-tokens.json. */

@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/InstrumentSans-400.ttf") format("truetype"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/InstrumentSans-500.ttf") format("truetype"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/InstrumentSans-600.ttf") format("truetype"); }

:root {
  --forest: #14332B;
  --ailm: #3E9C6E;
  --ailm-deep: #2B7552;
  --bone: #F4F1EA;
  --stone: #56665F;
  --sage: #B5C9BF;
  --rule: #E4E0D6;
  --white: #FFFFFF;

  --font: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-y: clamp(80px, 11vw, 160px);
  --radius-card: 12px;
  --radius-btn: 8px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --fg: var(--forest);
  --fg-2: var(--stone);
  --line: var(--rule);
  --link: var(--ailm-deep);
  --focus: var(--ailm-deep);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1rem, .96rem + .2vw, 1.125rem);
  line-height: 1.5;
  color: var(--fg);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
/* The hidden attribute always wins over display rules (JS-only controls stay hidden without JS). */
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }

/* Light and dark grounds */
.on-dark { --fg: var(--bone); --fg-2: var(--sage); --line: var(--stone); --link: var(--bone); --focus: var(--bone); color: var(--fg); }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.visually-hidden {
  position: absolute !important; 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; left: 12px; top: -100px; z-index: 100;
  padding: 12px 18px; border-radius: var(--radius-btn);
  background: var(--bone); color: var(--forest); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Type */
h1, h2, h3 { font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
h2 { font-size: clamp(2.25rem, 1.3rem + 3.6vw, 4.5rem); line-height: 1.04; max-width: 16ch; }
h3 { font-size: clamp(1.25rem, 1.1rem + .5vw, 1.5rem); line-height: 1.2; }

.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-size: .8125rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-2);
}
/* A single short stroke before every eyebrow, the recurring Ogham device. */
.eyebrow::before { content: ""; width: 20px; height: 2px; border-radius: 2px; background: currentColor; flex: none; }
.eyebrow-num { font-variant-numeric: tabular-nums; color: var(--fg); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px; border-radius: var(--radius-btn);
  border: 1px solid transparent; font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary { background: var(--bone); color: var(--forest); }
.btn-primary:hover { background: var(--white); }
.btn-ghost { color: var(--bone); border-color: var(--stone); }
.btn-ghost:hover { border-color: var(--bone); }
.btn-dark { background: var(--forest); color: var(--bone); }
.btn-dark:hover { background: var(--ailm-deep); }
.btn-outline { background: transparent; color: var(--forest); border-color: var(--forest); }
.btn-outline:hover { background: var(--white); }
.btn-icon { width: 16px; height: 16px; flex: none; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--forest);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-block: 28px;
  transition: padding .25s var(--ease);
}
/* Logo: min 120px wide; clear space X is about 7.9% of its width, kept by the header padding. */
.brand { display: block; flex: none; padding: 4px; margin: -4px; border-radius: 4px; }
.brand img { width: 168px; height: auto; transition: width .25s var(--ease); }
.site-header.is-compact { border-bottom-color: var(--stone); }
.site-header.is-compact .header-inner { padding-block: 14px; }
.site-header.is-compact .brand img { width: 136px; }

.site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.site-nav a {
  display: block; padding: 10px 14px; border-radius: var(--radius-btn);
  color: var(--bone); font-weight: 500; text-decoration: none;
  transition: background-color .2s var(--ease);
}
.site-nav a:hover { background: var(--stone); }

.nav-toggle {
  display: none; align-items: center; gap: 10px;
  min-height: 44px; padding: 8px 14px; border: 1px solid var(--stone); border-radius: var(--radius-btn);
  background: transparent; color: var(--bone); font: inherit; font-weight: 500; cursor: pointer;
}
.nav-toggle-icon { position: relative; width: 18px; height: 12px; }
.nav-toggle-icon span {
  position: absolute; left: 0; width: 18px; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform .25s var(--ease), top .25s var(--ease);
}
.nav-toggle-icon span:first-child { top: 2px; }
.nav-toggle-icon span:last-child { top: 8px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:first-child { top: 5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:last-child { top: 5px; transform: rotate(-45deg); }

@media (max-width: 760px) {
  .header-inner { padding-block: 18px; }
  .brand img, .site-header.is-compact .brand img { width: 132px; }
  .site-header.is-compact .header-inner { padding-block: 12px; }
  .site-nav { flex-basis: 100%; }
  .header-inner { flex-wrap: wrap; }
  .site-nav a { padding: 8px 10px; }
  /* With JS: a toggle and a drop-down panel. Without JS the links simply wrap below the logo. */
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; padding-bottom: 12px; }
  .js .site-nav.is-open ul { flex-direction: column; gap: 0; border-top: 1px solid var(--stone); padding-top: 8px; }
  .js .site-nav.is-open a { font-size: 1.375rem; font-weight: 600; letter-spacing: -.02em; padding: 12px 4px; }
}

/* Hero */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--forest);
  padding-block: clamp(48px, 9vw, 120px) clamp(32px, 4vw, 56px);
  min-height: min(calc(100svh - 110px), 920px);
  display: flex; flex-direction: column; justify-content: space-between; gap: clamp(48px, 8vw, 96px);
}
/* Decorative motif: only from 1024px up. JS measures the text, buttons and meta row, then sets
   left/width so the SVG starts 48px right of them, and draws only the stems that fit whole.
   Below 1024px there is no real margin beside the text, so it is not shown at all. */
.hero-motif { display: none; position: absolute; z-index: -1; top: 0; height: 100%; }
.hero-inner { position: relative; }
.hero .eyebrow { margin-bottom: clamp(20px, 3vw, 32px); }
.hero-title {
  font-size: clamp(2.5rem, .9rem + 5.4vw, 6.5rem);
  line-height: 1.02; letter-spacing: -.02em;
  max-width: 11.5em;
  text-wrap: balance;
}
.accent-stop { color: var(--ailm); }
.hero-lede {
  margin-top: clamp(24px, 3vw, 36px); max-width: 38rem;
  font-size: clamp(1.0625rem, 1rem + .45vw, 1.375rem); line-height: 1.5; color: var(--sage);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(28px, 4vw, 44px); }
.hero-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px 32px;
  max-width: 760px; padding-top: 20px; border-top: 1px solid var(--stone);
  font-size: .9375rem; color: var(--bone);
}
.hero-meta span { display: block; margin-bottom: 2px; font-size: .8125rem; font-weight: 500; color: var(--sage); }
@media (min-width: 1024px) {
  .hero-motif { display: block; }
  .hero-title { max-width: 10.5em; }
  .hero-meta { max-width: 640px; }
}
/* Short laptop screens: keep the buttons above the fold. */
@media (min-width: 1024px) and (max-height: 860px) {
  .hero { padding-top: clamp(40px, 6vh, 72px); }
  .hero .eyebrow { margin-bottom: 20px; }
}

/* Ogham strokes (decorative motifs and the toy) */
.ogham line { fill: none; stroke-linecap: round; }
.hero-motif line, .card-motif line { stroke: var(--stone); stroke-width: 2.5; }
.ogham .is-drawing { animation: draw var(--t, .5s) var(--ease) var(--d, 0s) both; }
@keyframes draw {
  from { stroke-dasharray: 1 2; stroke-dashoffset: 1; opacity: 0; }
  2% { opacity: 1; }
  to { stroke-dasharray: 1 2; stroke-dashoffset: 0; opacity: 1; }
}
.js .reveal:not(.is-in) .is-drawing { animation-play-state: paused; }

/* Sections */
.section { padding-block: var(--section-y); }
.section-bone { background: var(--bone); }
.section-white { background: var(--white); }
.section-forest { background: var(--forest); }
.section-head { display: grid; gap: 20px; margin-bottom: clamp(40px, 6vw, 72px); }

/* Bento */
.bento { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  position: relative; overflow: hidden;
  border: 1px solid var(--rule); border-radius: var(--radius-card);
  background: var(--white);
  padding: clamp(24px, 3vw, 40px);
  transition: transform .35s var(--ease), border-color .35s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--sage); }
/* Reveal moves cards with `translate`, hover with `transform`, so the two never fight. */
.js .card.reveal { transition: opacity .8s var(--ease), translate .8s var(--ease), transform .35s var(--ease), border-color .35s var(--ease); }
.card-feature {
  grid-column: span 2; grid-row: span 2;
  background: var(--forest); border-color: var(--forest);
  min-height: 560px; display: flex; align-items: flex-end;
}
.card-feature:hover { border-color: var(--stone); }
.card-feature-body { position: relative; max-width: 36rem; }
.card-feature { container-type: inline-size; }
.card-motif { position: absolute; top: 0; right: clamp(8px, 4vw, 48px); height: 100%; width: 120px; }
@container (max-width: 700px) { .card-motif { display: none; } }
.product-name { margin-top: 20px; font-size: clamp(3rem, 1.6rem + 5vw, 6rem); line-height: .98; letter-spacing: -.02em; }
.product-tagline { margin-top: 12px; font-size: clamp(1.25rem, 1.1rem + .6vw, 1.625rem); font-weight: 500; color: var(--sage); }
.product-desc { margin-top: 24px; color: var(--bone); }
.product-note { margin: 20px 0 28px; font-size: .9375rem; color: var(--sage); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chips li {
  padding: 6px 14px; border: 1px solid var(--stone); border-radius: 999px;
  font-size: .875rem; font-weight: 500; color: var(--bone);
}
.chips li::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 10px; height: 2px; margin: -2px 8px 0 0; border-radius: 2px; background: var(--sage);
}
.card-title { margin-top: 16px; }
.card:not(.card-feature) p:not(.eyebrow) { color: var(--stone); }
.card-soon p:not(.eyebrow) { margin-top: 12px; }
.langs { margin-top: 20px; display: grid; gap: 2px; }
.langs li {
  font-size: clamp(1.375rem, 1.2rem + .8vw, 1.875rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.25;
  padding-block: 6px; border-bottom: 1px solid var(--rule);
}
.card .card-foot { margin-top: 16px; font-size: .9375rem; }
.card-soon { background: transparent; border-style: dashed; border-color: var(--stone); }
.card-soon:hover { border-color: var(--forest); }
/* An unfinished stem: the product is still being written. */
.soon-stem { position: relative; width: 40px; height: 88px; margin-bottom: 28px; }
.soon-stem::before { content: ""; position: absolute; left: 19px; top: 0; bottom: 0; width: 2px; border-radius: 2px; background: var(--stone); }
.soon-stem span { position: absolute; left: 20px; width: 18px; height: 2px; border-radius: 2px; background: var(--stone); }
.soon-stem span:nth-child(1) { bottom: 14px; }
.soon-stem span:nth-child(2) { bottom: 26px; }

@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-feature { grid-column: 1 / -1; grid-row: auto; min-height: 0; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
}

/* Approach */
.principles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.principle { padding: 32px 28px 8px 0; }
.principle + .principle { padding-left: 28px; border-left: 1px solid var(--rule); }
.principle h3 { margin-top: 28px; }
.principle p { margin-top: 12px; color: var(--stone); }
/* Stroke tally: 1 to 4 strokes off a short stem, like the Ogham B, L, F, S group. */
.tally { position: relative; display: block; width: 32px; height: 40px; }
.tally::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; border-radius: 2px; background: var(--forest); }
.tally i { position: absolute; left: 0; width: 22px; height: 2px; border-radius: 2px; background: var(--forest); }
.tally i:nth-child(1) { bottom: 6px; }
.tally i:nth-child(2) { bottom: 14px; }
.tally i:nth-child(3) { bottom: 22px; }
.tally i:nth-child(4) { bottom: 30px; }

@media (max-width: 1000px) {
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principle:nth-child(3) { padding-left: 0; border-left: 0; }
  .principle:nth-child(n+3) { border-top: 1px solid var(--rule); margin-top: 24px; }
}
@media (max-width: 600px) {
  .principles { grid-template-columns: minmax(0, 1fr); }
  .principle, .principle + .principle { padding: 28px 0 4px; border-left: 0; }
  .principle + .principle { border-top: 1px solid var(--rule); margin-top: 24px; }
}

/* The mark */
.mark-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(48px, 7vw, 112px); align-items: start; }
.mark-explain h2 { margin-top: 20px; }
.mark-explain > p:not(.eyebrow) { margin-top: 24px; max-width: 36rem; color: var(--sage); }
.mark-figure {
  display: flex; align-items: center; gap: clamp(32px, 5vw, 56px);
  margin-top: 40px; padding: 40px clamp(24px, 4vw, 48px);
  border: 1px solid var(--stone); border-radius: var(--radius-card);
}
.mark-img { width: 96px; height: auto; flex: none; }
.mark-legend { display: grid; gap: 18px; }
.mark-legend li { display: flex; align-items: baseline; gap: 14px; color: var(--sage); }
.mark-legend b { width: 1.5ch; font-size: 1.5rem; font-weight: 600; color: var(--bone); }
.mark-legend li:last-child b { color: var(--ailm); }
.mark-explain .mark-read { color: var(--bone); font-weight: 500; }

.toy {
  border: 1px solid var(--stone); border-radius: var(--radius-card);
  padding: clamp(24px, 3vw, 36px);
  display: grid; gap: 12px;
}
.toy-title { font-size: clamp(1.375rem, 1.2rem + .6vw, 1.75rem); margin-bottom: 8px; }
.toy-label { font-size: .875rem; font-weight: 500; color: var(--sage); }
.toy-input {
  width: 100%; min-height: 52px; padding: 12px 16px;
  border: 1px solid var(--sage); border-radius: var(--radius-btn);
  background: var(--forest); color: var(--bone);
  font: inherit; font-size: 1.25rem; font-weight: 500; letter-spacing: .04em;
}
.toy-input::placeholder { color: var(--sage); opacity: 1; letter-spacing: 0; font-weight: 400; }
.toy-input:focus-visible { outline: 3px solid var(--bone); outline-offset: 2px; }
.toy-stage { height: clamp(260px, 48vh, 420px); overflow-y: auto; overscroll-behavior: contain; border-bottom: 1px solid var(--stone); }
.toy-svg { width: 100%; height: 100%; }
.toy-svg line { stroke: var(--bone); stroke-width: 2.5; }
.toy-svg .stem { stroke: var(--sage); }
.toy-svg .ailm { stroke: var(--ailm); } /* the A notch only, as in the mark */
.toy-out { font-size: 1rem; font-weight: 500; color: var(--bone); min-height: 1.5em; }
.toy-help { font-size: .875rem; color: var(--sage); }

@media (max-width: 900px) {
  .mark-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .mark-figure { flex-direction: column; align-items: flex-start; }
}

/* Contact */
.contact-body { display: grid; gap: 28px; }
.contact-lede { max-width: 38rem; font-size: clamp(1.0625rem, 1rem + .4vw, 1.3125rem); color: var(--stone); }
.contact-email { font-size: clamp(1.25rem, .6rem + 4.2vw, 4rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; overflow-wrap: break-word; }
.contact-email a { color: var(--forest); text-decoration-color: var(--ailm); text-decoration-thickness: 2px; text-underline-offset: .14em; }
.contact-email a:hover { color: var(--ailm-deep); }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.copy-status { font-size: .9375rem; color: var(--forest); }
.contact-place { padding-top: 20px; border-top: 1px solid var(--rule); color: var(--forest); }
.contact-place span { display: block; font-size: .8125rem; font-weight: 500; color: var(--stone); }

/* Footer */
.site-footer { background: var(--forest); padding-block: clamp(56px, 7vw, 96px) 40px; }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.brand-footer img { width: 140px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.footer-nav a { display: inline-block; padding-block: 8px; color: var(--bone); text-decoration: none; font-weight: 500; }
.footer-nav a:hover { text-decoration: underline; }
/* Horizontal hairline with a short group of notches across it. */
.footer-rule { position: relative; height: 14px; margin-block: 40px 28px; }
.footer-rule::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 1px; background: var(--stone); }
.footer-rule i { position: absolute; top: 0; width: 2px; height: 14px; border-radius: 2px; background: var(--stone); }
.footer-rule i:nth-child(1) { left: 0; }
.footer-rule i:nth-child(2) { left: 8px; }
.footer-rule i:nth-child(3) { left: 16px; }
.legal { max-width: 60rem; font-size: .875rem; color: var(--sage); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; margin-top: 16px; font-size: .875rem; color: var(--sage); }

/* 404 */
.notfound { min-height: calc(100svh - 110px); justify-content: center; }
.notfound h1 { font-size: clamp(2.75rem, 1rem + 7vw, 6.5rem); line-height: 1.02; max-width: 12ch; text-wrap: balance; }
.notfound p:not(.eyebrow) { margin: 24px 0 36px; max-width: 34rem; color: var(--sage); font-size: clamp(1.0625rem, 1rem + .4vw, 1.3125rem); }

/* Reveal on scroll: only hides anything once JS has added .js to <html>. */
.js .reveal { opacity: 0; translate: 0 20px; transition: opacity .8s var(--ease), translate .8s var(--ease); }
.js .reveal.is-in { opacity: 1; translate: none; }
@media print { .js .reveal { opacity: 1; translate: none; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; translate: none; }
  .card:hover, .btn:hover { transform: none; }
}
