/* Troika Digital: component and base CSS from the Website design system v1.0 (4 November 2026).
   Load after tokens.css. Components use semantic tokens only. */

/* ---- Base typography and page (Part 3). @font-face rules come from tokens.json via tokens.css. ---- */
html {
  font-family: var(--font-body);
  scroll-padding-top: calc(var(--header-height) + var(--space-2));
}
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text-body);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
}
h1, h2, h3, h4 {
  margin: 0 0 var(--space-2);
  color: var(--color-text-heading);
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
.display { font-size: var(--text-display); line-height: var(--leading-tight); letter-spacing: var(--tracking-display); }
h1 { font-size: var(--text-h1); line-height: var(--leading-tight); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); font-weight: var(--font-weight-semibold); }
h4 { font-size: var(--text-h4); font-weight: var(--font-weight-semibold); letter-spacing: var(--tracking-normal); }
p { margin: 0 0 var(--space-2); max-width: var(--measure); text-wrap: pretty; }
.lead { font-size: var(--text-lead); }
small, .text-small { font-size: var(--text-small); }
.highlight { color: var(--color-text-accent); }
.hand {
  display: inline-block;
  font-family: var(--font-accent);
  font-size: var(--text-accent);
  font-weight: var(--font-weight-bold);
  line-height: 1;
  color: var(--color-text-accent);
  transform: rotate(-3deg);
}
 
a { color: var(--color-link); text-underline-offset: 0.2em; }
a:hover { color: var(--color-link-hover); }
:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
}
.container { max-width: var(--container-max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }

/* ---- Intrinsic grid (Part 4) ---- */
.grid {
  display: grid;
  gap: var(--grid-gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
 
/* Values row: five across on wide screens, wraps naturally */
.grid--values {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}
 
@media (min-width: 64em) {
  .hero { grid-template-columns: 1.15fr 1fr; align-items: center; }
}

/* ---- Buttons (Part 5) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: var(--target-min);
  padding: 0 var(--space-4);
  border: var(--border-width-strong) solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard),
    transform var(--duration-fast) var(--ease-out);
}
.btn--primary { background: var(--color-button-bg); color: var(--color-button-text); }
.btn--primary:hover {
  background: var(--color-button-bg-hover);
  color: var(--color-button-text);
  transform: translateY(calc(var(--distance-lift) / -2));
}
.btn--secondary {
  background: transparent;
  border-color: var(--color-text-heading);
  color: var(--color-text-heading);
}
.btn--secondary:hover { border-color: var(--color-text-accent); color: var(--color-text-accent); }
.btn--small { min-height: 2.5rem; padding: 0 var(--space-3); }
.btn svg { width: 1.25rem; height: 1.25rem; flex: none; }
.btn:active { transform: none; }
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

/* ---- Cards and feature panels (Part 5) ---- */
.card {
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition:
    transform var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
}
.card__title { margin: 0; font-size: var(--text-h4); }
.card__title a { color: inherit; text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable, one link */
.card__title a:focus-visible { outline: none; }
.card:focus-within { outline: var(--focus-ring-width) solid var(--color-focus); outline-offset: var(--focus-ring-offset); }
.card:hover { border-color: var(--color-text-accent); transform: translateY(calc(var(--distance-lift) * -1)); }
.card p { margin: 0; }
 
.panel {
  padding: var(--space-5);
  border: var(--border-width-strong) solid var(--tk-ink);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-raised);
  color: var(--color-text-on-fill);
  --color-text-heading: var(--tk-ink);
  --color-text-body: var(--tk-ink);
  --color-text-accent: var(--tk-ink);
  --color-focus: var(--tk-ink);
}
.panel--orange { background: var(--color-fill-orange); }
.panel--pink { background: var(--color-fill-pink); }
.btn--ink { background: var(--tk-ink); color: var(--tk-white); }  /* White on Ink 15.91:1 */
.btn--ink:hover { background: var(--tk-charcoal); color: var(--tk-white); }

/* ---- Forms (Part 5) ---- */
.field { display: grid; gap: var(--space-1); margin-bottom: var(--space-3); }
.field__label { color: var(--color-text-heading); font-size: var(--text-small); font-weight: var(--font-weight-semibold); }
.field__hint { margin: 0; color: var(--color-text-body); font-size: var(--text-small); }
.field__input {
  min-height: var(--target-min);
  padding: var(--space-1) var(--space-2);
  background: var(--color-surface);
  border: var(--border-width-input) solid var(--color-border-input);
  border-radius: var(--radius-sm);
  color: var(--color-text-heading);
  font: inherit;
}
textarea.field__input { min-height: 8rem; resize: vertical; }
.field__input::placeholder { color: var(--color-text-body); opacity: 0.8; }
.field__input:focus-visible { border-color: var(--color-focus); outline-offset: 2px; }
.field__input[aria-invalid="true"] { border-width: 3px; border-color: var(--color-error); }
.field__error {
  display: flex; align-items: flex-start; gap: var(--space-1); margin: 0;
  color: var(--color-error); font-size: var(--text-small); font-weight: var(--font-weight-semibold);
}
.field__error svg { width: 1.25rem; height: 1.25rem; flex: none; }
.error-summary {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border: var(--border-width-input) solid var(--color-error);
  border-left-width: 6px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}
.error-summary h2 { font-size: var(--text-h4); margin-bottom: var(--space-1); }
.error-summary ul { margin: 0; padding-left: var(--space-3); }
.error-summary a { color: var(--color-error); font-weight: var(--font-weight-semibold); }
.field__check { display: flex; align-items: flex-start; gap: var(--space-2); }
.field__check input { width: 1.5rem; height: 1.5rem; margin: 0; accent-color: var(--tk-violet); }

/* ---- Navigation (Part 5) ---- */
.skip-link {
  position: absolute; left: var(--space-2); top: -100px; z-index: var(--z-skip-link);
  padding: var(--space-1) var(--space-2);
  background: var(--tk-ink); color: var(--tk-white); font-weight: var(--font-weight-semibold);
}
.skip-link:focus { top: var(--space-2); }
 
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: rgb(255 252 245 / 0.92);
  backdrop-filter: blur(12px);
  border-bottom: var(--border-width) solid var(--color-border-subtle);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  max-width: var(--container-max); min-height: var(--header-height);
  margin-inline: auto; padding-inline: var(--gutter);
}
.site-logo {
  display: inline-flex; align-items: center; gap: var(--space-1);
  min-height: var(--target-min);
  font-family: var(--font-heading); font-size: 1.25rem; font-weight: var(--font-weight-bold);
  letter-spacing: var(--tracking-tight); color: var(--tk-ink); text-decoration: none;
}
.site-logo img { width: 2.5rem; height: 2.5rem; }  /* alt="": the visible text names the link */
.site-nav ul { display: flex; gap: var(--space-4); margin: 0; padding: 0; list-style: none; }
.site-nav a:not(.btn) {
  display: inline-flex; align-items: center; min-height: var(--target-min);
  color: var(--color-text-heading); font-size: var(--text-small); font-weight: var(--font-weight-semibold);
  text-decoration: none; text-underline-offset: 0.4em;
}
.site-nav a:not(.btn):hover { color: var(--tk-violet); }
.site-nav a[aria-current="page"] {
  text-decoration: underline; text-decoration-color: var(--tk-violet); text-decoration-thickness: 3px;
}
.nav-toggle {
  display: none; width: var(--target-min); height: var(--target-min); place-items: center;
  background: transparent; border: 0; color: var(--tk-ink);
}
@media (min-width: 64em) {
  :root { --header-height: 5rem; }
  .site-nav { display: flex; align-items: center; gap: var(--space-5); }
}
@media (max-width: 63.99em) {
  .nav-toggle { display: grid; }
  .site-nav { display: none; }
  .nav-toggle[aria-expanded="true"] + .site-nav {
    position: fixed; inset: var(--header-height) 0 0;
    display: flex; flex-direction: column; gap: var(--space-4);
    padding: var(--space-4) var(--gutter);
    background: var(--tk-cream); overflow-y: auto;
  }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a:not(.btn) { font-family: var(--font-heading); font-size: var(--text-h3); }
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---- Eyebrows (Part 5) ---- */
.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--color-text-accent);
  font-size: var(--text-eyebrow);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  line-height: var(--leading-snug);
  text-transform: uppercase;
}

/* ---- Pull quotes (Part 5) ---- */
.pull-quote {
  position: relative;
  max-width: var(--container-narrow);
  margin: var(--space-8) 0;
  padding: var(--space-5);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
}
.pull-quote::before {
  content: "\201C"; position: absolute; top: -0.2em; left: var(--space-4);
  font-family: var(--font-heading); font-size: 5rem; line-height: 1; color: var(--tk-violet);
}
.pull-quote blockquote { margin: 0; }
.pull-quote blockquote p {
  max-width: none; color: var(--color-text-heading);
  font-family: var(--font-heading); font-size: var(--text-quote);
  font-weight: var(--font-weight-semibold); line-height: var(--leading-snug);
}
.pull-quote figcaption { margin-top: var(--space-3); color: var(--color-text-body); font-size: var(--text-small); }
.pull-quote figcaption strong { color: var(--color-text-heading); font-weight: var(--font-weight-semibold); }

/* ---- Dividers (Part 5) ---- */
.divider { height: 1px; margin: var(--space-8) 0; border: 0; background: var(--color-border-subtle); }
.divider--gradient {
  display: block; width: 6rem; height: 4px; margin: var(--space-3) 0;
  border-radius: var(--radius-pill); background: var(--gradient-brand);
}

/* ---- Shapes and sticker (Part 7) ---- */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.shape { position: absolute; z-index: var(--z-shapes); pointer-events: none; }
.shape--blob { width: clamp(10rem, 30vw, 20rem); aspect-ratio: 1; border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; opacity: var(--shape-opacity); }
.shape--circle { width: 4rem; aspect-ratio: 1; border-radius: 50%; }
.shape--pink { background: var(--tk-pink); }
.shape--orange { background: var(--tk-orange); }
.shape--gradient { background: var(--gradient-brand); }
 
.sticker {
  display: inline-block; padding: var(--space-05) var(--space-2);
  background: var(--tk-white); border: var(--border-width-strong) solid var(--tk-ink);
  border-radius: var(--radius-pill); transform: rotate(4deg);
  font-family: var(--font-accent); font-size: var(--text-accent); font-weight: var(--font-weight-bold);
  color: var(--tk-violet); line-height: 1.1;
}

/* ---- Icon chips (Part 7) ---- */
.icon-chip {
  display: grid; place-items: center;
  width: 3.5rem; height: 3.5rem;
  border: var(--border-width-strong) solid var(--tk-ink);
  border-radius: 50%;
  box-shadow: var(--shadow-raised);
  color: var(--tk-ink);
}
.icon-chip svg { width: 1.75rem; height: 1.75rem; }
.icon-chip--orange { background: var(--tk-orange); }
.icon-chip--pink { background: var(--tk-pink); }
.icon-chip--violet { background: var(--color-fill-violet-tint); }

/* ---- Motion: reveal, float, reduced-motion safety net (Part 7) ---- */
.js .reveal {
  opacity: 0;
  transform: translateY(var(--distance-reveal));
  transition: opacity var(--duration-reveal) var(--ease-out), transform var(--duration-reveal) var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal .icon-chip { transform: scale(0.8); transition: transform var(--duration-slow) var(--ease-bounce); }
.js .reveal.is-visible .icon-chip { transform: none; }
 
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .shape--float { animation: tk-float var(--duration-float) var(--ease-in-out) infinite alternate; }
}
@keyframes tk-float {
  to { transform: translate(var(--distance-float), calc(var(--distance-float) * -1)) rotate(6deg); }
}
.is-motion-paused .shape--float { animation-play-state: paused; }
 
/* Safety net for third-party CSS and anything that skips the tokens */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Motion pause control (Part 7) ---- */
.motion-toggle {
  position: absolute; right: var(--gutter); bottom: var(--space-3);
  display: inline-flex; align-items: center; gap: var(--space-1);
  min-height: var(--target-min); padding: 0 var(--space-2);
  background: var(--tk-white); border: var(--border-width-strong) solid var(--tk-ink);
  border-radius: var(--radius-pill); color: var(--tk-ink);
  font: var(--font-weight-semibold) var(--text-small) / 1 var(--font-body); cursor: pointer;
}
.motion-toggle svg { width: 1.25rem; height: 1.25rem; }

/* ---- Section themes and reduced-motion token overrides (Part 9) ---- */
/* Section themes: components use semantic tokens only, so a theme class
   on a section re-colours everything inside it */
.theme-white {
  --color-bg: var(--tk-white);
  --color-surface: var(--tk-cream);
  background: var(--color-bg);
}
 
.theme-ink {
  --color-bg: var(--tk-ink);
  --color-surface: var(--tk-ink);
  --color-text-heading: var(--tk-white);       /* 15.91:1 */
  --color-text-body: var(--tk-cream);          /* 15.53:1 */
  --color-text-accent: var(--tk-orange);       /* 7.13:1 */
  --color-link: var(--tk-orange);
  --color-link-hover: var(--tk-white);
  --color-icon: var(--tk-orange);
  --color-border-input: var(--tk-cream);
  --color-border-subtle: rgb(255 252 245 / 0.2);
  --color-focus: var(--tk-orange);
  --color-error: var(--tk-error-on-ink);       /* 6.97:1 */
  --color-button-bg: var(--tk-orange);         /* Ink label 7.13:1 */
  --color-button-bg-hover: var(--tk-pink);     /* Ink label 5.26:1 */
  --color-button-text: var(--tk-ink);
  --shadow-card: none;
  --shadow-raised: 0 4px 0 var(--tk-orange);
  background: var(--color-bg);
  color: var(--color-text-body);
}
 
.theme-violet {
  --color-bg: var(--tk-violet);
  --color-text-heading: var(--tk-white);       /* 4.63:1: large text and short copy only */
  --color-text-body: var(--tk-white);
  --color-text-accent: var(--tk-white);
  --color-link: var(--tk-white);
  --color-link-hover: var(--tk-cream);
  --color-icon: var(--tk-white);
  --color-focus: var(--tk-white);
  --color-button-bg: var(--tk-white);          /* Violet label 4.63:1 */
  --color-button-bg-hover: var(--tk-cream);    /* Violet label 4.52:1 */
  --color-button-text: var(--tk-violet);
  --color-border-subtle: rgb(255 255 255 / 0.3);
  background: var(--color-bg);
  color: var(--color-text-body);
}
 
/* Reduced motion: keep state changes, remove movement */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-instant: 0ms;
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
    --duration-reveal: 0ms;
    --distance-reveal: 0;
    --distance-lift: 0;
    --distance-float: 0;
  }
}

/* ---- Additions: specs from Parts 5 and 7 that the source gives in words, not code ---- */
/* Icon chip, dense lists: 40px chip, 20px icon, plain edge (Part 7) */
.icon-chip--sm { width: 2.5rem; height: 2.5rem; box-shadow: none; border-width: 0; }
.icon-chip--sm svg { width: 1.25rem; height: 1.25rem; }
/* Squiggle: hand-drawn SVG stroke in Violet, 3px, decorative (Parts 5 and 7) */
.squiggle { display: block; width: 6rem; height: auto; color: var(--color-text-accent); }
.squiggle path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
/* Submit: full width below 768px (Part 5) */
@media (max-width: 47.99em) { .field__submit { width: 100%; } }

/* ---- Form additions from the website copy (30 Oct 2026): radio group, select, privacy line ---- */
.field__group { margin: 0 0 var(--space-3); padding: 0; border: 0; min-width: 0; }
.field__group legend { margin-bottom: var(--space-1); padding: 0; }
.field__group .field__check { min-height: var(--target-min); align-items: center; color: var(--color-text-body); cursor: pointer; }
.field__check input[type="radio"] { width: 1.5rem; height: 1.5rem; margin: 0; accent-color: var(--tk-violet); flex: none; }
select.field__input { appearance: auto; }
.field__privacy { margin: var(--space-2) 0 0; color: var(--color-text-body); font-size: var(--text-small); }

/* ---- Header wordmark (approved 4 Nov 2026: the wordmark replaces the monogram lockup in the header) ---- */
.site-logo--wordmark img { width: auto; height: 2rem; }
@media (max-width: 29.99em) { .site-logo--wordmark img { height: 1.75rem; } }

/* ---- Homepage hero (from the 4 Nov 2026 mockup) ---- */
.icon-chip--lg { width: 5rem; height: 5rem; }
.icon-chip--lg svg { width: 2.25rem; height: 2.25rem; }
.sticker--label { padding: var(--space-1) var(--space-3); font-family: var(--font-body); font-size: var(--text-small); font-weight: var(--font-weight-semibold); color: var(--tk-ink); line-height: 1.2; white-space: nowrap; }
.tick-list { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: var(--space-4) 0 0; padding: 0; list-style: none; color: var(--color-text-body); font-size: var(--text-small); }
.tick-list li { display: inline-flex; align-items: center; gap: var(--space-1); }
.tick-list svg { width: 1.25rem; height: 1.25rem; flex: none; color: var(--color-icon); }
.home-hero { padding-block: var(--space-8); }
.home-hero__inner { display: grid; gap: var(--space-8); align-items: center; }
.home-hero__copy .hand { margin-bottom: var(--space-3); }
.home-hero__copy .display { margin-bottom: var(--space-3); }
.home-hero__price { display: block; margin-top: var(--space-1); font-size: var(--text-h2); letter-spacing: var(--tracking-tight); }
.home-hero__copy .lead { margin-bottom: var(--space-4); }
.home-hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.home-hero__visual { position: relative; width: min(100%, 30rem); aspect-ratio: 1; margin-inline: auto; }
.home-hero__blob { width: 140%; top: -30%; right: -40%; z-index: auto; }
.home-hero__visual > :not(.home-hero__blob) { z-index: 1; }
.home-hero__plate { position: absolute; inset: 12%; display: grid; place-items: center; background: var(--tk-white); border: var(--border-width-strong) solid var(--tk-ink); border-radius: 50%; box-shadow: 0 6px 0 var(--tk-ink); }
.home-hero__plate img { width: 66.6667%; height: auto; }
.home-hero__chip { position: absolute; }
.home-hero__chip--1 { top: 9%; left: 6%; }
.home-hero__chip--2 { top: 42%; right: 2%; }
.home-hero__chip--3 { bottom: 4%; left: 16%; }
.home-hero__sticker { position: absolute; bottom: 8%; right: 0; }
@media (min-width: 64em) {
  .home-hero { padding-block: var(--space-12); }
  .home-hero__inner { grid-template-columns: 1.15fr 1fr; }
}
@media (max-width: 63.99em) { .home-hero__visual { width: min(80%, 26rem); } }

/* ---- Header colour lock: the header is always Cream, so its text and button keep their Cream-section tokens
        even when a page or section theme changes them (otherwise White links land on Cream in .theme-ink) ---- */
.site-header {
  --color-text-heading: var(--tk-charcoal);
  --color-link: var(--tk-violet);
  --color-focus: var(--tk-violet);
  --color-button-bg: var(--tk-violet);
  --color-button-bg-hover: var(--tk-violet-deep);
  --color-button-text: var(--tk-white);
  --color-border-subtle: #ECE6DA;
}
