/* darma.page — one stylesheet, no framework.
   Tokens first; components follow in page order. */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #FFFFFF;
  --surface: #F4F4F2;
  --ink: #111214;
  --ink-hover: #2A2C30;
  --text-2: #3F4247;
  --muted: #63666B;
  --line: #E7E7E5;
  --line-strong: #111214;
  --border: #D6D6D3;
  --underline: #C9C9C6;
  --accent: #2B50C8;
  --ok: #1A8F4C;
  --ok-ring: #E2F2E8;

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --max: 880px;
  --gutter: 24px;
  --radius: 10px;
}

/* Base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

p,
ul,
ol,
dl,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 14px;
  text-decoration: none;
  z-index: 10;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono {
  font-family: var(--mono);
}

/* Header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 24px;
  padding-block: 20px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: auto;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

/* Language switch: flags plus a language code, so it reads without the flag too */

.lang {
  display: flex;
  gap: 4px 14px;
  font-family: var(--mono);
  font-size: 12px;
}

.lang a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
}

.lang a:hover,
.lang a[aria-current] {
  color: var(--ink);
}

.lang a[aria-current] {
  font-weight: 500;
}

.flag {
  flex: none;
  display: block;
  width: 20px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(17, 18, 20, 0.12);
}

.lang a:not([aria-current]) .flag {
  opacity: 0.6;
}

.lang a:hover .flag {
  opacity: 1;
}

/* On phones: name and language switch on the first line, navigation below */
@media (max-width: 600px) {
  .lang {
    order: 1;
  }

  .nav {
    order: 2;
    width: 100%;
  }
}

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

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  font-size: 14px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-2);
  text-decoration: none;
}

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

.nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

/* Buttons and links */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

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

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

.btn-secondary {
  padding: 0 18px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
}

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

.link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-pad {
  padding: 0 8px;
  font-size: 15px;
}

.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 15px;
}

.icon {
  flex: none;
}

.text-link {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-underline-offset: 3px;
}

.text-link:hover {
  text-decoration-color: var(--ink);
}

/* Hero (home) */

.hero {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-block: 72px 88px;
}

.status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-2);
}

.status-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: calc((1.6em - 8px) / 2);
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-ring);
}

.hero-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.display {
  font-size: clamp(40px, 10vw, 56px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.role {
  font-size: 22px;
  line-height: 1.35;
  color: var(--text-2);
  letter-spacing: -0.01em;
}

.lead {
  max-width: 640px;
  font-size: 18px;
  line-height: 1.65;
  text-wrap: pretty;
}

.lead-muted {
  max-width: 600px;
  color: var(--text-2);
}

.previously {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.previously p {
  flex: 1 1 400px;
  min-width: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-2);
  text-wrap: pretty;
}

.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Sections */

.section {
  padding-bottom: 88px;
}

.section-tight {
  padding-bottom: 72px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
}

.section-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-head .link {
  font-size: 14px;
}

.count {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.prose {
  max-width: 680px;
  padding-top: 20px;
  color: var(--text-2);
  text-wrap: pretty;
}

/* Project rows: meta column + body, wraps on phones */

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding-block: 32px;
  border-bottom: 1px solid var(--line);
}

.row-lg {
  padding-block: 36px;
}

.row-meta {
  flex: 1 1 120px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 3px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.row-lg .row-meta {
  padding-top: 5px;
}

.row-body {
  flex: 999 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.row-lg .row-body {
  gap: 16px;
}

.row-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.row-lg .row-heading {
  gap: 6px;
}

.row-title {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.row-lg .row-title,
.row-title-lg {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.title-link {
  color: inherit;
  text-decoration: none;
}

.title-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.row-title-note {
  font-weight: 400;
  color: var(--muted);
}

.summary {
  color: var(--text-2);
  text-wrap: pretty;
}

.bullets {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 18px;
}

.bullets strong {
  font-weight: 600;
}

.stack-line {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
}

.metric {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.metric-label {
  font-size: 14px;
  color: var(--text-2);
}

.metrics-sm {
  gap: 8px 28px;
}

.metrics-sm .metric-value {
  font-size: 26px;
}

.metrics-sm .metric-label {
  font-size: 13px;
}

/* Key/value list (stack) */

.kv-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 32px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}

.kv-row dt {
  flex: 1 1 120px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.85;
  color: var(--muted);
}

.kv-row dd {
  flex: 999 1 480px;
  min-width: 0;
  margin: 0;
}

/* Projects page */

.page-intro {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-block: 64px 72px;
}

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  font-family: var(--mono);
  font-size: 13px;
}

.jump a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  text-decoration: none;
}

.jump a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.shot {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.shot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: left top;
}

.shot-center img {
  object-position: center;
}

.feature {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px 32px;
  padding-block: 36px;
  border-bottom: 1px solid var(--line);
}

.feature-media,
.feature-body {
  flex: 1 1 340px;
  min-width: 0;
}

.feature-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-body .bullets {
  font-size: 15px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 40px 24px;
  padding-top: 36px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-title {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.card-meta {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.card .summary {
  font-size: 15px;
}

.card .stack-line {
  font-size: 12px;
}

/* Case study */

.case-intro {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-block: 40px 48px;
}

.back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}

.back:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.case-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-lead {
  max-width: 680px;
  font-size: 22px;
  line-height: 1.45;
  color: var(--text-2);
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 16px 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.facts div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.facts dt {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-size: 15px;
}

.facts a {
  font-weight: 500;
  text-decoration: none;
}

.figure {
  padding-bottom: 56px;
}

.figure .shot {
  border-radius: 12px;
}

.figure figcaption {
  padding-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 24px 32px;
  padding-block: 28px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.numbers .metric-value {
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
}

.split > .section-title {
  flex: 1 1 160px;
  padding-top: 4px;
}

.split-body {
  flex: 999 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 17px;
  line-height: 1.7;
  text-wrap: pretty;
}

.split-body .muted {
  color: var(--text-2);
}

.steps {
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 32px;
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
}

.step-label {
  flex: 1 1 160px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
}

.step-body {
  flex: 999 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-wrap: pretty;
}

.step-body .mono {
  font-size: 12px;
  color: var(--muted);
}

.problems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 0 40px;
}

.problem {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}

.problem h3 {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.problem p {
  color: var(--text-2);
  text-wrap: pretty;
}

/* Contact and footer */

.contact {
  padding-bottom: 72px;
}

.contact-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 56px;
  border-top: 1px solid var(--line-strong);
}

.contact-title {
  font-size: clamp(28px, 6vw, 36px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.contact-text {
  max-width: 600px;
  color: var(--text-2);
  text-wrap: pretty;
}

.site-footer {
  padding-bottom: 40px;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
