/* ==========================================================================
   mezulanik.cz · site styles
   Single stylesheet for index.html. Tokens first, then layout, then sections.
   ========================================================================== */

:root {
  --bg: #f6f2ee;
  --bg-alt: #ece5df;
  --surface: #fffdfb;
  --text: #16181d;
  --text-soft: #3b3f48;
  --muted: #5c6270;
  --line: #e0d8d0;
  --line-strong: #cdc3b9;
  /* Coral accent kept from the original site, darkened for AA contrast on light bg */
  --accent: #b5352f;
  --accent-hover: #962a25;
  --accent-soft: rgba(181, 53, 47, 0.09);
  --on-accent: #ffffff;
  --accent-text: #a32f2a; /* accent for small text, AA on --bg-alt too */
  --electric: #167d9a;
  --electric-soft: rgba(22, 125, 154, 0.12);
  /* Welcoming tech blue: clear enough to feel innovative, soft enough to stay approachable */
  --hero-bg: #b8d3eb;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --container: 1120px;
  --gutter: 24px;
  --header-h: 64px;
  --radius: 14px;
  --radius-sm: 8px;
  --section-y: clamp(72px, 10vw, 128px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-alt: #14171c;
    --surface: #181b21;
    --text: #ecedf0;
    --text-soft: #c9ccd3;
    --muted: #9399a5;
    --line: #262a32;
    --line-strong: #353a44;
    --accent: #ff7b72;
    --accent-hover: #ff958e;
    --accent-soft: rgba(255, 123, 114, 0.12);
    --on-accent: #0f1115;
    --accent-text: #ff8a82;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

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

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

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

/* ---------- Shared bits ---------- */

.eyebrow,
.section-index,
.tech,
.row-num,
.project-kind,
.note-label,
.hero-role {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

.section-index {
  color: var(--muted);
  margin-bottom: 16px;
}

.tech {
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.6;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.975rem;
  line-height: 1;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

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

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
}

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

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  font-weight: 500;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.link-arrow::after {
  content: "↗";
  font-size: 0.85em;
  color: var(--muted);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}

.link-arrow:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.link-arrow:hover::after {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--hero-bg);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

/* While the header sits over the hero, use the hero text tokens */
.site-header:not(.is-scrolled) {
  --bg: var(--hero-bg);
  --muted: #465466;
  --line: rgba(15, 28, 46, 0.12);
}

@media (prefers-color-scheme: dark) {
  .site-header:not(.is-scrolled) {
    --text: #f3f5f8;
    --muted: #a3b1c4;
    --line: #22324a;
  }
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  color: var(--text);
  transition: color 0.2s var(--ease);
}

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

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  gap: 4px;
}

.site-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--text);
}

.site-nav a[aria-current] {
  background: var(--accent-soft);
}

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

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 500 0.75rem/1 var(--font-mono);
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}

.menu-toggle {
  display: none;
  appearance: none;
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.25s var(--ease);
}

.menu-toggle span:first-child {
  top: 17px;
}

.menu-toggle span:last-child {
  top: 23px;
}

.menu-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(40px, 7vw, 96px);
  padding-bottom: clamp(40px, 5vw, 64px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.36;
  background-image:
    linear-gradient(rgba(15, 28, 46, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 28, 46, 0.055) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(90deg, transparent 8%, #000 52%, #000 100%);
}

.hero-tech {
  position: absolute;
  z-index: 0;
  top: 76px;
  right: max(-110px, calc((100vw - var(--container)) / 2 - 180px));
  width: min(48vw, 680px);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0.72;
}

.hero-ring {
  position: absolute;
  border: 1px solid rgba(15, 28, 46, 0.15);
  border-radius: 50%;
}

.hero-ring-one {
  inset: 14%;
  animation: orbit-spin 28s linear infinite;
}

.hero-ring-one::before,
.hero-ring-two::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 8px var(--accent-soft);
}

.hero-ring-two {
  inset: 27%;
  border-style: dashed;
  animation: orbit-spin 20s linear infinite reverse;
}

.hero-ring-two::before {
  top: 12%;
  left: auto;
  right: 8%;
  background: var(--electric);
  box-shadow: 0 0 0 8px var(--electric-soft);
}

.hero-node {
  position: absolute;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(15, 28, 46, 0.18);
  border-radius: 13px;
  background: color-mix(in srgb, var(--hero-bg) 78%, white);
  color: var(--text);
  font: 600 0.72rem/1 var(--font-mono);
  box-shadow: 0 14px 32px rgba(15, 28, 46, 0.1);
  animation: node-float 5s var(--ease) infinite;
}

.hero-node-ai { top: 9%; right: 28%; }
.hero-node-rn { top: 42%; right: 5%; animation-delay: -1.7s; }
.hero-node-ts { bottom: 13%; right: 35%; animation-delay: -3.3s; }

.hero-grid,
.hero > .container {
  position: relative;
  z-index: 1;
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

@keyframes node-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: end;
}

.hero-copy {
  padding-bottom: clamp(48px, 7vw, 88px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin-bottom: 28px;
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

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

.hero-name {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.hero-statement {
  font-size: clamp(2.125rem, 4.4vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.032em;
  font-weight: 650;
}

.hero-role {
  margin-top: 24px;
  color: var(--text);
  font-size: 0.875rem;
}

.hero-lead {
  margin-top: 20px;
  max-width: 60ch;
  font-size: 1.125rem;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

/* Transparent cut-out portrait that "stands" on the facts divider below it */
.hero-photo {
  margin: 0;
  justify-self: end;
  align-self: end;
  width: 100%;
  max-width: 380px;
}

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

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.facts > div {
  padding: 24px 24px 0 0;
}

.facts > div + div {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.facts dt {
  color: var(--text);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.facts dd {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section-y);
}

.hero + .section {
  padding-top: calc(var(--section-y) * 0.9);
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.section-head h2,
.section-contact h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.028em;
}

.section-lead {
  margin-top: 20px;
  color: var(--muted);
  font-size: 1.125rem;
  max-width: 62ch;
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
  gap: clamp(40px, 7vw, 96px);
  align-items: start;
}

.prose p + p {
  margin-top: 1.1em;
}

.prose p {
  max-width: 64ch;
}

.companies {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 22px 60px -48px rgba(15, 28, 46, 0.4);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.companies:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 70px -45px rgba(15, 28, 46, 0.5);
}

.companies h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.companies li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.companies strong {
  color: var(--text);
  font-weight: 600;
}

.companies li span {
  color: var(--muted);
  font-size: 0.9375rem;
}

.link-down {
  display: inline-block;
  margin-top: 16px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.link-down::after {
  content: " ↓";
  color: var(--muted);
}

.link-down:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* AI */

.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.practice-grid li {
  position: relative;
  background: var(--surface);
  padding: 28px;
  overflow: hidden;
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.practice-grid li::before {
  content: "0" counter(list-item);
  display: block;
  margin-bottom: 28px;
  color: var(--accent-text);
  font: 500 0.72rem/1 var(--font-mono);
  letter-spacing: 0.08em;
}

.practice-grid li::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -85px;
  bottom: -95px;
  border-radius: 50%;
  background: var(--accent-soft);
  filter: blur(2px);
  transition: transform 0.45s var(--ease);
}

.practice-grid li:hover {
  z-index: 1;
  background: color-mix(in srgb, var(--surface) 94%, var(--accent));
}

.practice-grid li:hover::after {
  transform: scale(1.5);
}

.practice-grid h3 {
  font-size: 1.0625rem;
  margin-bottom: 8px;
}

.practice-grid p {
  font-size: 0.975rem;
  color: var(--muted);
}

.note {
  margin-top: 32px;
  max-width: 760px;
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--accent);
}

.note-label {
  color: var(--accent-text);
  margin-bottom: 8px;
}

/* Expertise rows */

.rows {
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 56px minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s var(--ease);
}

.row:hover {
  background: linear-gradient(90deg, var(--electric-soft), transparent 72%);
}

.row-num {
  color: var(--muted);
  padding-top: 4px;
}

.row h3 {
  font-size: 1.25rem;
  letter-spacing: -0.015em;
}

.row:hover .row-num {
  color: var(--accent);
}

.stack {
  margin-top: clamp(48px, 6vw, 72px);
}

.stack-title {
  font-size: 1rem;
  margin-bottom: 20px;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stack-grid > div {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.stack-grid > div:hover {
  border-color: var(--line-strong);
  box-shadow: 0 14px 30px -28px rgba(15, 28, 46, 0.55);
}

.stack-grid dt {
  color: var(--text);
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 6px;
}

.stack-grid dd {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Experience */

.jobs {
  position: relative;
}

.jobs::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 7px;
  width: 1px;
  background: linear-gradient(var(--accent), var(--electric), transparent);
}

.job {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  gap: 24px 48px;
  padding: 32px 0 32px 36px;
}

.job::before {
  content: "";
  position: absolute;
  top: 38px;
  left: 3px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--bg-alt);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease);
}

.job:hover::before {
  transform: scale(1.35);
  background: var(--electric);
}

.job h3 {
  font-size: 1.25rem;
}

.job-role {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.9375rem;
}


.job-body p:first-child {
  max-width: 64ch;
}

.job-body {
  margin-bottom: -32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line-strong);
}

.job:last-child .job-body {
  border-bottom: 0;
}

/* Projects */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.project {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 28px 64px -52px rgba(15, 28, 46, 0.65);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.project:hover {
  border-color: var(--line-strong);
  transform: translateY(-8px);
  box-shadow: 0 38px 80px -48px rgba(15, 28, 46, 0.7);
}

.project-media {
  position: relative;
  display: flex;
  justify-content: center;
  height: clamp(300px, 35vw, 390px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}

.project-media-parking {
  background: radial-gradient(circle at 50% 35%, #3027a8 0, #171160 58%, #0d0a35 100%);
}

.project-media-terraclast {
  background: radial-gradient(circle at 50% 25%, #33451c 0, #10170e 50%, #080b08 100%);
}

.project-screenshot {
  width: auto;
  height: 94%;
  margin-top: 6%;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.35);
  transition: transform 0.45s var(--ease);
}

.project:hover .project-screenshot {
  transform: translateY(-6px) scale(1.015);
}

.project-icon {
  position: absolute;
  z-index: 1;
  top: 20px;
  left: 20px;
  width: 64px;
  height: 64px;
  border-radius: 15px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.project-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(24px, 3vw, 36px);
}

.project-kind {
  color: var(--accent);
  margin-bottom: 10px;
}

.project h3 {
  font-size: 1.5rem;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.project-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
  margin-top: auto;
  padding-top: 24px;
  font-size: 0.9375rem;
}

.project-content > p + .project-meta {
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.project-meta dt {
  color: var(--muted);
}

.project-meta dd {
  color: var(--text);
}

.project-store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.store-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 132px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.store-link:hover {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.more-apps {
  margin-top: 24px;
  padding: 24px clamp(24px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.more-apps h3 {
  font-size: 1rem;
  margin-bottom: 16px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.app-card {
  display: flex;
  gap: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.app-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

.app-icon {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 11px;
  box-shadow: 0 6px 16px -8px rgba(15, 28, 46, 0.45);
}

.app-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.app-body h4 {
  margin: 0 0 4px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  font-size: 1.0625rem;
  letter-spacing: -0.015em;
}

.app-body p {
  color: var(--text-soft);
  font-size: 0.9375rem;
}

.app-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: auto;
  padding-top: 12px;
  font-size: 0.875rem;
}

.app-links-label {
  color: var(--muted);
  margin-right: -8px;
}

.app-cities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.app-cities a {
  display: inline-block;
  padding: 2px 10px;
  line-height: 1.6;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.app-cities a:hover {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

/* Scroll reveal: content remains fully visible without JavaScript. */
.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 28px;
  color: var(--muted);
}

.side-project {
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  gap: 12px 48px;
}

.side-project h3 {
  font-size: 1.0625rem;
}

.side-project > p:first-of-type {
  color: var(--muted);
}

.side-links {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: 0.9375rem;
}

/* Contact */

.section-contact {
  border-top: 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 96px);
  align-items: start;
}

.contact-email {
  display: inline-block;
  margin-top: 32px;
  color: var(--text);
  font-size: clamp(1.5rem, 3.2vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  border-bottom: 2px solid var(--accent);
  overflow-wrap: anywhere;
  transition: color 0.2s var(--ease);
}

.contact-email:hover {
  color: var(--accent);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 28px;
}

.open-to {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.open-to h3 {
  font-size: 1.0625rem;
  margin-bottom: 14px;
}

.open-to li {
  position: relative;
  padding: 8px 0 8px 22px;
  font-size: 0.975rem;
  border-bottom: 1px solid var(--line);
}

.open-to li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 18px;
  width: 8px;
  height: 1.5px;
  background: var(--accent);
}

.location {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.contact-form-wrap {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.5fr);
  gap: clamp(32px, 6vw, 80px);
  margin-top: 24px;
  padding: clamp(28px, 5vw, 56px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.contact-form-head .section-index {
  margin-bottom: 12px;
}

.contact-form-head h3 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

.contact-form-head > p:last-child {
  margin-top: 12px;
  color: var(--muted);
}

.contact-form {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field-message,
.form-submit,
.form-status {
  grid-column: 1 / -1;
}

.form-field label {
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.form-field input {
  min-height: 48px;
  padding: 0 14px;
}

.form-field textarea {
  min-height: 150px;
  padding: 12px 14px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}

.btn-contact {
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
}

.btn-contact:hover {
  background: var(--accent-hover);
}

.btn-contact:disabled {
  cursor: wait;
  opacity: 0.72;
}

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

.form-status {
  display: none;
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
}

.form-status.is-success,
.form-status.is-error {
  display: block;
}

.form-status.is-success {
  color: #b8efc9;
  background: rgba(56, 161, 105, 0.14);
  border: 1px solid rgba(104, 211, 145, 0.28);
}

.form-status.is-error {
  color: #ffc0bb;
  background: rgba(255, 123, 114, 0.12);
  border: 1px solid rgba(255, 123, 114, 0.28);
}

.form-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Footer */

.site-footer {
  padding-block: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

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

/* ---------- Section themes ---------- */

.theme-hero,
.theme-ink {
  background: var(--bg);
  color: var(--text-soft);
}

.theme-hero {
  --bg: var(--hero-bg);
  --text: #0f1c2e;
  --text-soft: #26303d;
  --muted: #465466;
  --line: rgba(15, 28, 46, 0.12);
  --line-strong: rgba(15, 28, 46, 0.22);
  --accent: #9f2b26;
  --accent-text: #9f2b26;
  --accent-soft: rgba(168, 47, 40, 0.1);
  background: var(--bg);
}

.theme-ink {
  --bg: #15171c;
  --bg-alt: #15171c;
  --surface: #1d2026;
  --text: #f1efec;
  --text-soft: #c9ccd3;
  --muted: #9aa0ab;
  --line: #2a2e36;
  --line-strong: #3a3f49;
  --accent: #ff7b72;
  --accent-hover: #ff958e;
  --accent-text: #ff8a82;
  --accent-soft: rgba(255, 123, 114, 0.12);
  --electric: #5fd3ea;
  --electric-soft: rgba(95, 211, 234, 0.12);
  --on-accent: #15171c;
  color-scheme: dark;
}

#ai {
  background-image:
    radial-gradient(circle at 12% 12%, rgba(95, 211, 234, 0.08), transparent 28%),
    radial-gradient(circle at 88% 76%, rgba(255, 123, 114, 0.07), transparent 26%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --hero-bg: #0f1c2e;
  }

  .theme-hero {
    --text: #f3f5f8;
    --text-soft: #d3d9e2;
    --muted: #a3b1c4;
    --line: #22324a;
    --line-strong: #2e4060;
    --accent: #ff8a7a;
    --accent-text: #ff9a8c;
    --accent-soft: rgba(255, 138, 122, 0.12);
    --on-accent: #0f1c2e;
    background:
      radial-gradient(circle at 82% 43%, rgba(255, 138, 122, 0.1) 0, transparent 34%),
      var(--bg);
  }

  /* In dark mode the page is already dark, so ink sections go one step lighter to stay distinct */
  .theme-ink {
    --bg: #1a1d23;
    --bg-alt: #1a1d23;
    --surface: #22262d;
    --line: #2f343d;
  }
}

.site-footer.theme-ink {
  border-top-color: var(--line);
}

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
  .practice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-nav a {
    padding: 8px 9px;
  }
}

@media (max-width: 900px) {
  :root {
    --header-h: 60px;
  }

  .menu-toggle {
    display: inline-block;
  }

  .header-actions {
    margin-left: auto;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    margin: 0;
    padding: 8px var(--gutter) 24px;
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.18);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s linear 0.2s;
  }

  .site-header:not(.is-scrolled) .site-nav {
    background: var(--hero-bg);
  }

  .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .site-nav a {
    padding: 14px 0;
    font-size: 1.0625rem;
    color: var(--text);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .site-nav a[aria-current] {
    background: none;
    color: var(--accent);
  }

  .hero-grid,
  .about-grid,
  .contact-grid,
  .contact-form-wrap {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-bottom: 8px;
  }

  .hero-photo {
    justify-self: center;
    max-width: 300px;
  }

  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .facts > div {
    padding: 20px 16px 20px 0;
  }

  .facts > div + div {
    padding-left: 0;
    border-left: 0;
  }

  .facts > div:nth-child(even) {
    padding-left: 20px;
    border-left: 1px solid var(--line);
  }

  .facts > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .row {
    grid-template-columns: 40px 1fr;
    gap: 8px 16px;
  }

  .row > div {
    grid-column: 2;
  }

  .job,
  .side-project {
    grid-template-columns: 1fr;
  }

  .side-links {
    grid-column: auto;
  }

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

  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  :root {
    --gutter: 16px;
  }

  body {
    font-size: 1rem;
  }

  .hero-lead,
  .section-lead {
    font-size: 1.0625rem;
  }

  .hero-photo {
    max-width: 240px;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .practice-grid,
  .stack-grid,
  .app-grid {
    grid-template-columns: 1fr;
  }


  .practice-grid li {
    padding: 22px;
  }

  .facts dt {
    font-size: 1.5rem;
  }

  .project-meta {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .contact-form {
    grid-template-columns: 1fr;
  }

  .form-field-message,
  .form-submit,
  .form-status {
    grid-column: auto;
  }

  .project-meta dd + dt {
    margin-top: 10px;
  }

  .open-to {
    padding: 22px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal-ready .reveal {
    opacity: 1;
    transform: none;
  }
}

