@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');
@import url('/assets/tamta-tokens.css');

/* Site theme — dark default, light optional. Brand hex values stay in tokens. */
:root,
[data-theme='dark'] {
  --tt-bg: #152538;
  --tt-bg-accent: #1a2f4a;
  --tt-surface: #1a2f4a;
  --tt-text: #fbfaf7;
  --tt-text-muted: #9aabbf;
  --tt-heading: #e8d9bc;
  --tt-link: #e8d9bc;
  --tt-border: #2f4a6b;
  --tt-wash-a: rgba(232, 217, 188, 0.06);
  --tt-wash-b: rgba(194, 112, 61, 0.08);
  --tt-code-bg: #0f1a28;
  --tt-swatch-card: #1a2f4a;
  --tt-checker-a: #243a56;
  --tt-checker-b: #1a2f4a;
}

[data-theme='light'] {
  --tt-bg: var(--tt-paper);
  --tt-bg-accent: #f3efe6;
  --tt-surface: var(--tt-paper);
  --tt-text: var(--tt-ink);
  --tt-text-muted: var(--tt-muted);
  --tt-heading: var(--tt-blue);
  --tt-link: var(--tt-blue);
  --tt-border: var(--tt-line);
  --tt-wash-a: rgba(31, 58, 95, 0.08);
  --tt-wash-b: rgba(194, 112, 61, 0.06);
  --tt-code-bg: var(--tt-blue);
  --tt-swatch-card: #fff;
  --tt-checker-a: #eee9df;
  --tt-checker-b: #f7f4ee;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

html[data-theme='light'] {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 90% 60% at 12% -10%, var(--tt-wash-a), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 0%, var(--tt-wash-b), transparent 45%),
    linear-gradient(180deg, var(--tt-bg-accent) 0%, var(--tt-bg) 38%, var(--tt-bg) 100%);
  color: var(--tt-text);
  font-family: var(--tt-font-display);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 200ms ease, color 200ms ease;
}

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

a {
  color: var(--tt-link);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

a:hover {
  color: var(--tt-clay);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

@media (min-width: 720px) {
  .site-header {
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand:hover {
  color: inherit;
}

.brand img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem 0.85rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-family: var(--tt-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (min-width: 720px) {
  .header-actions {
    gap: 1.25rem;
  }

  .nav {
    gap: 1.25rem;
    font-size: 0.75rem;
  }
}

.nav a {
  color: var(--tt-text-muted);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--tt-heading);
}

.theme-toggle {
  appearance: none;
  margin: 0;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  background: transparent;
  color: var(--tt-text-muted);
  font-family: var(--tt-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.theme-toggle:hover {
  color: var(--tt-heading);
  border-color: var(--tt-heading);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--tt-clay);
  outline-offset: 2px;
}

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

@media (min-width: 720px) {
  .wrap {
    padding: 0 1.5rem 4rem;
  }
}

/* —— Landing hero —— */
.hero {
  display: grid;
  align-items: end;
  min-height: auto;
  padding: 1.5rem 0 2.5rem;
  gap: 1.75rem;
}

@media (min-width: 720px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 3rem;
    min-height: calc(100svh - 4.5rem);
    padding: 1rem 0 3rem;
  }
}

.hero-copy {
  max-width: 28rem;
}

.hero-label {
  margin: 0 0 0.75rem;
  font-family: var(--tt-font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-text-muted);
  opacity: 0;
  animation: rise 700ms 80ms ease forwards;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 12vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: var(--tt-heading);
  opacity: 0;
  animation: rise 700ms 160ms ease forwards;
}

.hero-mark {
  justify-self: center;
  width: min(58vw, 14rem);
  aspect-ratio: 1;
  opacity: 0;
  animation: settle 900ms 200ms ease forwards;
}

@media (min-width: 720px) {
  .hero-mark {
    width: min(100%, 22rem);
  }
}

.hero-mark img {
  width: 100%;
  height: 100%;
}

/* —— Sections —— */
.sections {
  display: grid;
  margin-top: 0.5rem;
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  overflow: hidden;
  background: var(--tt-surface);
}

@media (min-width: 720px) {
  .sections {
    grid-template-columns: 1fr 1fr;
  }
}

.panel {
  padding: 1.85rem 1.5rem;
  background: var(--tt-surface);
  min-width: 0;
}

.panel + .panel {
  border-top: 1px solid var(--tt-border);
}

@media (min-width: 720px) {
  .panel {
    padding: 2.75rem;
  }

  .panel + .panel {
    border-top: none;
    border-left: 1px solid var(--tt-border);
  }
}

.panel-label {
  margin: 0 0 0.85rem;
  font-family: var(--tt-font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-text-muted);
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--tt-text);
}

.panel p {
  margin: 0 0 1rem;
  color: var(--tt-text-muted);
  max-width: 28rem;
  overflow-wrap: anywhere;
}

.panel p:last-child {
  margin-bottom: 0;
}

.panel a.inline {
  font-weight: 600;
}

.accent-link {
  color: var(--tt-clay);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  overflow-wrap: anywhere;
  transition: border-color 160ms ease, color 160ms ease;
}

.accent-link:hover {
  color: var(--tt-clay);
  border-bottom-color: var(--tt-clay);
}

.panel-robots {
  font-family: var(--tt-font-mono);
  font-size: 0.9rem;
  line-height: 1.65;
}

.panel-robots h2 {
  font-family: var(--tt-font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0;
}

.panel-robots .panel-label {
  color: var(--tt-heading);
}

.site-footer {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  font-family: var(--tt-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tt-text-muted);
}

@media (min-width: 720px) {
  .site-footer {
    padding: 2rem 1.5rem 3rem;
  }
}

.site-footer a {
  color: var(--tt-text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--tt-heading);
}

/* —— Brand guide —— */
.guide-hero {
  padding: 2.5rem 0 2rem;
}

.guide-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--tt-heading);
  line-height: 1.05;
}

.guide-hero p {
  margin: 0;
  max-width: 36rem;
  color: var(--tt-text-muted);
  font-size: 1.125rem;
}

.guide-meta {
  margin-top: 1rem;
  font-family: var(--tt-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-text-muted);
}

.guide-section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--tt-border);
}

.guide-section h2 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--tt-text);
}

.guide-section > .lede {
  margin: 0 0 1.5rem;
  color: var(--tt-text-muted);
  max-width: 38rem;
}

.guide-section h3 {
  margin: 1.75rem 0 0.65rem;
  font-family: var(--tt-font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-text-muted);
}

.guide-section p,
.guide-section li {
  color: var(--tt-text-muted);
}

.guide-section ul {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
}

.guide-section li + li {
  margin-top: 0.35rem;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.75rem;
}

.swatch {
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  overflow: hidden;
  background: var(--tt-swatch-card);
}

.swatch-chip {
  height: 4.5rem;
}

.swatch-meta {
  padding: 0.7rem 0.8rem 0.85rem;
}

.swatch-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--tt-text);
}

.swatch-hex {
  margin: 0.2rem 0 0;
  font-family: var(--tt-font-mono);
  font-size: 0.75rem;
  color: var(--tt-text-muted);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 1rem;
}

.asset {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.asset-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  background:
    linear-gradient(45deg, var(--tt-checker-a) 25%, transparent 25%),
    linear-gradient(-45deg, var(--tt-checker-a) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--tt-checker-a) 75%),
    linear-gradient(-45deg, transparent 75%, var(--tt-checker-a) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: var(--tt-checker-b);
}

.asset-frame.on-blue {
  background: var(--tt-blue);
  border-color: var(--tt-blue);
}

.asset-frame img {
  width: 64%;
  height: auto;
}

.asset figcaption {
  font-family: var(--tt-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--tt-text-muted);
}

.type-sample {
  margin: 0 0 1.25rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  background: var(--tt-swatch-card);
}

.type-sample.display {
  font-family: var(--tt-font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--tt-text);
}

.type-sample.mono {
  font-family: var(--tt-font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-text-muted);
}

.code-block {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  background: var(--tt-code-bg);
  color: var(--tt-sand);
  font-family: var(--tt-font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.checklist li {
  position: relative;
  padding: 0.85rem 0 0.85rem 2.5rem;
  border-top: 1px solid var(--tt-border);
  color: var(--tt-text-muted);
}

.checklist li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--tt-blue);
  color: var(--tt-sand);
  font-family: var(--tt-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
}

[data-theme='dark'] .checklist li::before {
  background: var(--tt-sand);
  color: var(--tt-blue);
}

.machine-note {
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--tt-clay);
  background: var(--tt-wash-a);
  font-family: var(--tt-font-mono);
  font-size: 0.82rem;
  color: var(--tt-text-muted);
}

.machine-note a {
  font-weight: 500;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* —— Lab —— */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lab-page > p {
  margin: 0 0 1.15rem;
  max-width: 40rem;
  color: var(--tt-text-muted);
}

.lab-page > p:last-child {
  margin-bottom: 0;
}

.lab-learned strong {
  color: var(--tt-text);
  font-weight: 600;
}

.lab-table {
  width: 100%;
  margin: 1.75rem 0 1.5rem;
  border-collapse: collapse;
  border-top: 1px solid var(--tt-border);
}

.lab-table th,
.lab-table td {
  padding: 0.9rem 0.85rem 0.9rem 0;
  border-bottom: 1px solid var(--tt-border);
  text-align: left;
  vertical-align: top;
}

.lab-table th {
  font-family: var(--tt-font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-text-muted);
}

.lab-table td {
  color: var(--tt-text-muted);
}

.lab-table td:first-child {
  width: 11rem;
  padding-right: 1.25rem;
  font-weight: 600;
  color: var(--tt-text);
  white-space: nowrap;
}

.lab-table a {
  font-weight: 600;
}

@media (max-width: 719px) {
  .lab-table,
  .lab-table thead,
  .lab-table tbody,
  .lab-table tr,
  .lab-table th,
  .lab-table td {
    display: block;
    width: 100%;
  }

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

  .lab-table tr {
    padding: 1rem 0;
    border-bottom: 1px solid var(--tt-border);
  }

  .lab-table td {
    padding: 0.2rem 0;
    border-bottom: none;
  }

  .lab-table td:first-child {
    width: auto;
    padding-right: 0;
    padding-bottom: 0.35rem;
    white-space: normal;
  }

  .lab-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    font-family: var(--tt-font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tt-text-muted);
  }

  .lab-table td:first-child::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-label,
  .hero h1,
  .hero-mark {
    opacity: 1;
    animation: none;
  }

  body {
    transition: none;
  }
}
