:root {
  /* Warm Ink: warm paper base, navy-charcoal ink, one teal accent, sparing clay */
  --bg: #F5F2EB;
  --surface: #FCFAF5;
  --border: #E4DDD0;
  --text: #17222E;
  --muted: #50596A;
  --accent: #0E7C6B;
  --accent-strong: #0B6156;
  --accent-soft: rgba(14, 124, 107, 0.10);
  --secondary: #B25B38;
  --secondary-text: #8A4227;

  /* Spacing scale, 4px base, ~1.5x steps, used with intent */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 20px;
  --s5: 32px;
  --s6: 52px;
  --s7: 84px;

  --maxw: 1080px;
  --radius: 8px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Grounded, humanist pairing: Source Serif for headings, Source Sans for everything else. */
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #FFFFFF; }

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; }

/* Header: brand left, nav centre, toggles right. Grid so it never wraps raggedly. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s4);
  padding: var(--s3) var(--s5);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.015em;
}
.brand:hover { text-decoration: none; color: var(--accent-strong); }

.site-nav {
  display: flex;
  justify-content: center;
  gap: var(--s5);
}
.site-nav a {
  color: var(--muted);
  font-size: 15px;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }

/* Toggles: quiet segmented controls, comfortable to tap */
.toggles { display: flex; align-items: center; gap: var(--s3); flex-shrink: 0; }
.toggle-group {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 4px 9px;
  min-height: 26px;
  cursor: pointer;
  transition: color 160ms var(--ease), background 160ms var(--ease);
}
.toggle + .toggle { border-left: 1px solid var(--border); }
.toggle:hover { color: var(--text); }
.toggle[aria-pressed="true"] {
  background: var(--accent);
  color: #FFFFFF;
}

/* Currency: show only the active currency in each price row */
body[data-currency="usd"] .price-figure .try { display: none; }
body[data-currency="try"] .price-figure .usd { display: none; }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s5); }

/* Scroll targets clear the sticky header on in-page navigation */
.section, .hero { scroll-margin-top: 96px; }

/* Kicker: small confident eyebrow, sans */
.kicker {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent-strong);
  margin: 0 0 var(--s3);
}

/* Hero: pushed left on a wide measure, roomy */
.hero { padding: var(--s7) 0 var(--s6); }
.hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  margin: 0 0 var(--s4);
  letter-spacing: -0.015em;
  max-width: 16ch;
}
.lead {
  font-size: 19px;
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 var(--s4);
}
.trust-line {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 var(--s5);
  max-width: 60ch;
}

.hero-actions, .contact-links { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }

/* Buttons: distinct primary (solid accent) and secondary (hairline outline) */
.btn {
  display: inline-block;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease), background 180ms var(--ease);
}
.btn:hover { border-color: var(--text); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn.ghost { background: transparent; }
.btn.ghost:hover { border-color: var(--text); }

/* Sections: generous top gaps, hairline rule */
.section { padding: var(--s7) 0; border-top: 1px solid var(--border); }
.section h2 {
  font-size: clamp(28px, 3.4vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s3);
}
.section-note { color: var(--muted); margin: 0 0 var(--s6); max-width: 60ch; }

/* Work grid: uneven, first repo featured full-width */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s4);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s5);
  display: flex;
  flex-direction: column;
  transition: border-color 200ms var(--ease), transform 200ms var(--ease);
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.card h3 { margin: 0 0 var(--s1); font-size: 21px; line-height: 1.15; }
.card p { margin: 0 0 var(--s4); color: var(--muted); font-size: 15.5px; }

.project-card.featured { grid-column: 1 / -1; }
.project-card.featured h3 { font-size: 26px; }
.project-card.featured p { font-size: 17px; max-width: 62ch; }

.repo-slug {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 var(--s3);
}

.project-meta {
  display: flex;
  gap: var(--s4);
  flex-wrap: wrap;
  margin-top: auto;
  padding: var(--s3) 0 0;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.project-meta .lang { display: inline-flex; align-items: center; gap: var(--s2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }

.project-card .repo-link {
  padding-top: var(--s3);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-strong);
}

/* Tags: quiet outlined chips */
.tags { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0 0 var(--s3); }
.tag {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  background: transparent;
  padding: 2px 9px;
  border-radius: 999px;
}

/* Pricing: distinct cards in a responsive grid */
.price-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s4);
}
.price-row {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.price-info h3 { margin: 0 0 var(--s2); font-size: 19px; line-height: 1.2; }
.price-info p { margin: 0; color: var(--muted); font-size: 15px; }
.price-figure {
  margin-top: auto;
  padding-top: var(--s3);
}
.price-figure .usd,
.price-figure .try {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.price-row.hourly-row { grid-column: 1 / -1; }

.guarantees {
  list-style: none;
  margin: var(--s5) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3) var(--s5);
  font-size: 15px;
  color: var(--text);
}
.guarantees li { position: relative; padding-left: var(--s4); }
.guarantees li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* Mid-page CTA band where purchase intent peaks */
.cta-band {
  margin-top: var(--s6);
  padding: var(--s5);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}
.cta-band p { margin: 0; max-width: 52ch; color: var(--text); }

/* Contact */
.contact p { color: var(--muted); max-width: 60ch; }
.contact-links { margin-top: var(--s5); }
.contact-email {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.contact-alt { margin-top: var(--s4); font-size: 15px; color: var(--muted); }

.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s5) var(--s5) var(--s7);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}
.foot-brand { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--text); }

@media (max-width: 720px) {
  .projects { grid-template-columns: 1fr; }
  .project-card.featured { grid-column: auto; }
  .cta-band { flex-direction: column; align-items: flex-start; }
}

/* Mobile header: brand + toggles on one tidy row, nav on a centred second row */
@media (max-width: 600px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: var(--s2) var(--s3);
    padding: var(--s3) var(--s4);
  }
  .brand { grid-row: 1; grid-column: 1; }
  .toggles { grid-row: 1; grid-column: 2; }
  .site-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: center;
    gap: var(--s5);
  }
  .toggle { min-height: 28px; padding: 5px 9px; }
  .section, .hero { scroll-margin-top: 120px; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .hero { padding: var(--s6) 0 var(--s5); }
  .section { padding: var(--s6) 0; }
  main { padding: 0 var(--s4); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto; }
}
