@font-face {
  font-family: "TDAText";
  /* Upstream “webfonts/*.woff2” are mislabeled TTFs; use real TTF. */
  src: url("fonts/TDAText.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fliege Mono";
  src: url("fonts/FliegeMonoVF.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette from assets/chatul.png — cream, ginger, eye green, AI metal */
  --bg: #f6e8c8;
  --bg-2: #edd9a8;
  --ink: #3a2418;
  --muted: #6b5344;
  --line: #d4b88a;
  --accent: #e88820;
  --accent-hover: #c96f12;
  --accent-ink: #fff8ec;
  --lime: #3ba84a;
  --metal: #5a5c60;
  --panel: #fdf3dc;
  --app: #2c3036;
  --font-display: "TDAText", ui-monospace, monospace;
  --font: "Fliege Mono", ui-monospace, monospace;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 56px;
  --space-16: 80px;
  --max: 1040px;
  --pad: var(--space-6);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 420;
  line-height: 1.5;
  letter-spacing: -0.01em;
  background:
    radial-gradient(90% 70% at 85% 8%, rgba(232, 136, 32, 0.14) 0%, transparent 52%),
    radial-gradient(70% 50% at 8% 92%, rgba(59, 168, 74, 0.08) 0%, transparent 48%),
    linear-gradient(165deg, #faf0d4 0%, var(--bg) 48%, var(--bg-2) 100%);
  background-attachment: fixed;
}

.top,
main,
.foot {
  width: min(100% - 2 * var(--pad), var(--max));
  margin-inline: auto;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--accent);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.03;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(58, 36, 24, 0.28) 0,
    rgba(58, 36, 24, 0.28) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

/* —— Header —— */

.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-5) 0;
}

.top__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: inherit;
}

.top__brand:hover {
  color: inherit;
}

.top__mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 7px;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.top__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-4);
  font-size: 0.8125rem;
  color: var(--muted);
}

.top__nav a {
  text-decoration: none;
}

.top__nav a:hover {
  color: var(--ink);
}

.top__link {
  color: var(--ink);
}

/* —— Hero —— */

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: var(--space-2);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  animation: rise 0.85s var(--ease) both;
}

.hero__copy {
  position: relative;
  z-index: 2;
  padding: var(--space-8) var(--space-6) var(--space-6);
}

.hero__title {
  margin: 0 0 var(--space-4);
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.5vw, 2.35rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.01em;
}

.hero__lead {
  margin: 0 0 var(--space-6);
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.hero__stage {
  position: relative;
  width: 100%;
  min-height: min(52vh, 520px);
  background: var(--app);
  border-top: 1px solid var(--line);
}

.hero__shot {
  display: block;
  width: 100%;
  height: min(52vh, 520px);
  object-fit: cover;
  object-position: top center;
}

/* —— Buttons —— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 520;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease;
}

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

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.btn--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* —— Sections —— */

.band {
  position: relative;
  z-index: 1;
  padding: var(--space-12) 0 var(--space-8);
}

.band--tight {
  padding-bottom: var(--space-4);
}

.band__title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.6vw, 2.15rem);
  font-weight: 400;
  line-height: 1.1;
}

.band__text {
  margin: 0;
  max-width: 44ch;
  color: var(--muted);
  font-size: 0.9375rem;
}

.callout {
  margin-top: var(--space-6);
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(232, 136, 32, 0.08);
}

.callout__lead {
  margin: 0 0 var(--space-6);
  max-width: 48ch;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink);
}

.callout .rows {
  margin: 0;
}

.band__text + .rows,
.band__text + .tools,
.band__text + .callout,
.band__text + .parity-wrap {
  margin-top: var(--space-8);
}

/* —— Simple rows —— */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.rows li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: var(--space-4);
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}

.rows__k {
  color: var(--muted);
}

.rows__v {
  color: var(--ink);
}

/* —— Tools —— */

.tools {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.tools li {
  display: grid;
  gap: 3px;
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--line);
}

.tools li:nth-child(even) {
  padding-left: 16px;
  padding-right: 0;
  border-left: 1px solid var(--line);
}

.tools__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.2;
}

.tools__desc {
  color: var(--muted);
  font-size: 0.8125rem;
}

/* —— Horizontal galleries —— */

.gallery {
  position: relative;
  z-index: 1;
  width: min(100% - 2 * var(--pad), var(--max));
  margin: 0 auto var(--space-8);
  overflow: hidden;
}

.gallery__track {
  display: flex;
  gap: var(--space-4);
  padding: 0 0 var(--space-3);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.gallery__track::-webkit-scrollbar {
  height: 5px;
}

.gallery__track::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}

.gallery__item {
  flex: 0 0 min(85%, 380px);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  scroll-snap-align: start;
}

.gallery__img {
  display: block;
  width: 100%;
  height: min(58vh, 560px);
  background: var(--app);
  object-fit: cover;
  object-position: top center;
}

.gallery__cap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
}

.gallery__name {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.gallery__desc {
  color: var(--muted);
}

/* Job cards in gallery */

.gallery--jobs .gallery__item,
.job-card {
  flex: 0 0 min(85%, 340px);
  margin: 0;
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  scroll-snap-align: start;
}

.job-card__title {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.15;
  color: var(--accent);
}

.job-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.job-card__list li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--ink);
}

.job-card__list li:last-child {
  padding-bottom: 0;
}

/* —— Parity table —— */

.parity-wrap {
  width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

.parity {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.parity th,
.parity td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

.parity thead th {
  color: var(--muted);
  font-weight: 520;
  font-size: 0.75rem;
}

.parity thead th.parity__you {
  color: var(--accent);
}

.parity tbody th {
  text-align: left;
  font-weight: 450;
  color: var(--ink);
  padding-left: 0;
}

.parity tbody td:nth-child(2),
.parity thead th:nth-child(2) {
  background: rgba(232, 136, 32, 0.1);
}

.parity__yes {
  color: var(--lime);
}

.parity__partial {
  color: var(--metal);
}

.parity__no {
  color: #a89078;
}

.parity__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin: var(--space-5) 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.parity__mark {
  font-style: normal;
  margin-right: 0.35em;
}

.parity__mark--yes {
  color: var(--lime);
}

.parity__mark--partial {
  color: var(--metal);
}

.parity__mark--no {
  color: #a89078;
}

.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;
}

/* —— Close / footer —— */

.close {
  position: relative;
  z-index: 1;
  padding: var(--space-12) 0 var(--space-10);
}

.close__brand {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1;
}

.close__line {
  margin: 0 0 var(--space-6);
  max-width: 28ch;
  color: var(--muted);
  font-size: 0.9375rem;
}

.foot {
  position: relative;
  z-index: 1;
  padding: 0 0 var(--space-10);
  color: var(--muted);
  font-size: 0.75rem;
}

.foot p {
  margin: 0 0 var(--space-2);
}

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

/* —— Desktop —— */

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(280px, 0.92fr) 1.2fr;
    min-height: 560px;
    align-items: stretch;
  }

  .hero__copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-10) var(--space-8);
  }

  .hero__stage {
    border-top: 0;
    border-left: 1px solid var(--line);
    min-height: 560px;
    height: 100%;
  }

  .hero__shot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .gallery__item {
    flex-basis: min(42%, 400px);
  }

  .gallery__img {
    height: min(64vh, 620px);
  }

  .gallery--jobs .job-card,
  .job-card {
    flex-basis: min(38%, 320px);
  }
}

@media (max-width: 640px) {
  .rows li {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 12px 0;
  }

  .tools {
    grid-template-columns: 1fr;
  }

  .tools li,
  .tools li:nth-child(even) {
    padding: 12px 0;
    border-left: 0;
  }

  .top__nav {
    gap: var(--space-3);
    font-size: 0.75rem;
  }
}

/* —— Blog —— */

.blog-hero {
  position: relative;
  z-index: 1;
  padding: var(--space-10) 0 var(--space-6);
  animation: rise 0.7s var(--ease) both;
}

.blog-hero__title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 400;
  line-height: 1.12;
}

.blog-hero__lead {
  margin: 0;
  max-width: 40ch;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.blog-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 var(--space-16);
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.blog-list__item {
  border-bottom: 1px solid var(--line);
}

.blog-list__link {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: var(--space-4) var(--space-6);
  padding: var(--space-5) 0;
  text-decoration: none;
  color: inherit;
  transition: background-color 150ms ease;
}

.blog-list__link:hover {
  color: inherit;
}

.blog-list__link:hover .blog-list__title {
  color: var(--accent);
}

.blog-list__date {
  margin: 0.2em 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.blog-list__title {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.01em;
  transition: color 150ms ease;
}

.blog-list__excerpt {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.article {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  padding: var(--space-8) 0 var(--space-16);
  animation: rise 0.7s var(--ease) both;
}

.article__back {
  display: inline-block;
  margin-bottom: var(--space-6);
  color: var(--muted);
  font-size: 0.8125rem;
  text-decoration: none;
}

.article__back:hover {
  color: var(--ink);
}

.article__meta {
  margin: 0 0 var(--space-3);
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

.article__title {
  margin: 0 0 var(--space-5);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.8vw, 2.2rem);
  font-weight: 400;
  line-height: 1.15;
}

.article__lead {
  margin: 0 0 var(--space-8);
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.45;
}

.article__body p {
  margin: 0 0 var(--space-5);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.article__body h2 {
  margin: var(--space-8) 0 var(--space-3);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.2;
}

.article__body ul {
  margin: 0 0 var(--space-5);
  padding-left: 1.15em;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.article__body li {
  margin-bottom: var(--space-2);
}

.article__body li::marker {
  color: var(--accent);
}

.article__example {
  margin: var(--space-6) 0;
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.article__example p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink);
}

.article__example strong {
  font-weight: 560;
}

.article__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
}

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

.article__nav a:hover {
  color: var(--accent);
}

@media (max-width: 640px) {
  .blog-list__link {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
}

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