:root {
  --bg: #e8ebe6;
  --bg-deep: #d4d9d2;
  --ink: #1a1f1c;
  --ink-soft: #3d4740;
  --muted: #5c675f;
  --accent: #0d5c4d;
  --accent-hover: #094438;
  --line: rgba(26, 31, 28, 0.14);
  --surface: rgba(255, 255, 255, 0.55);
  --font-display: "Syne", sans-serif;
  --font-body: "Sora", sans-serif;
  --space: clamp(1rem, 3vw, 2rem);
  --max: 1120px;
  --radius: 4px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(13, 92, 77, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(26, 31, 28, 0.06), transparent 45%),
    linear-gradient(165deg, #f0f2ee 0%, var(--bg) 45%, var(--bg-deep) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.55;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 70%);
}

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

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

.site-wrap {
  position: relative;
  z-index: 1;
}

/* ——— Contact strip (always visible) ——— */
.contact-strip {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #f2f4f1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-strip__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.65rem var(--space);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
}

.contact-strip__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
  flex-shrink: 0;
}

.contact-strip__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-size: 0.875rem;
}

.contact-strip__links a {
  color: #f2f4f1;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.contact-strip__links a:hover {
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

.contact-strip__links strong {
  font-weight: 600;
  opacity: 0.65;
  margin-right: 0.25rem;
}

/* ——— Nav ——— */
.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem var(--space) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

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

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.9rem;
}

.nav a {
  color: var(--ink-soft);
  position: relative;
  padding: 0.2rem 0;
  transition: color 0.2s ease;
}

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

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

/* ——— Hero ——— */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2rem) var(--space) clamp(2rem, 5vw, 3rem);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: center;
  min-height: 0;
}

.hero__copy {
  padding-bottom: 0.5rem;
  min-width: 0;
}

.hero__brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 4.75rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: rise 0.8s ease forwards 0.1s;
}

.hero__brand em {
  font-style: normal;
  color: var(--accent);
  display: block;
}

.hero__role {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 28ch;
  margin-bottom: 1.75rem;
  opacity: 0;
  animation: rise 0.8s ease forwards 0.25s;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  opacity: 0;
  animation: rise 0.8s ease forwards 0.4s;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.35rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

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

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

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

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

.btn--ghost:hover {
  background: var(--ink);
  color: #f2f4f1;
}

.hero__media {
  position: relative;
  width: 240px;
  max-width: 240px;
  flex-shrink: 0;
  margin: 0;
  opacity: 0;
  animation: rise 1s ease forwards 0.2s;
}

.hero__media::after {
  content: "";
  position: absolute;
  top: 200px;
  right: -10%;
  width: 36%;
  height: 48px;
  background: var(--accent);
  opacity: 0.18;
  z-index: -1;
  animation: pulse-block 4s ease-in-out infinite;
}

.hero__photo {
  width: 240px;
  height: 240px;
  max-width: none;
  object-fit: cover;
  object-position: center center;
  display: block;
  filter: contrast(1.02) saturate(0.95);
}

.hero__caption {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 240px;
}

/* ——— Page shell ——— */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.5rem, 3.5vw, 2.5rem) var(--space) clamp(2.5rem, 6vw, 4rem);
}

.page-head {
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  max-width: 40rem;
}

.page-head h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.75rem;
}

.page-head p {
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ——— Sections ——— */
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.section-lead {
  color: var(--muted);
  margin-bottom: 1.75rem;
  max-width: 42rem;
}

.band {
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--line);
}

/* ——— Skills ——— */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem 1.5rem;
}

.skill-block h3 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.skill-block p {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ——— Timeline ——— */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.job {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1rem 1.5rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}

.job:first-child {
  border-top: 1px solid var(--line);
}

.job__meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.job__meta strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.job__body h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.job__body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.job__body li {
  position: relative;
  padding-left: 1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.job__body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  background: var(--accent);
}

/* ——— Cases ——— */
.github-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  background: var(--ink);
  color: #f2f4f1;
  margin-bottom: 1.75rem;
}

.github-banner p {
  font-size: 0.95rem;
  opacity: 0.85;
  max-width: 36rem;
}

.github-banner a {
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

.github-banner a:hover {
  border-bottom-color: #fff;
}

.case {
  display: grid;
  grid-template-columns: minmax(0, 8rem) 1fr;
  gap: 1rem 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.case:first-of-type {
  border-top: 1px solid var(--line);
}

.case__index {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.04em;
}

.case__tag {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.case h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.case__problem,
.case__result {
  margin-bottom: 0.85rem;
  color: var(--ink-soft);
}

.case__result strong {
  color: var(--ink);
}

.case__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.case__stack span {
  font-size: 0.75rem;
  padding: 0.3rem 0.55rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

/* ——— Contact page ——— */
.contact-panel {
  display: grid;
  grid-template-columns: 1.4fr minmax(200px, 260px);
  gap: 1.5rem 2rem;
  align-items: start;
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contact-list li {
  border-top: 1px solid var(--line);
}

.contact-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.contact-list a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 0;
  transition: padding-left 0.2s ease;
}

.contact-list a:hover {
  padding-left: 0.5rem;
}

.contact-list .channel {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.contact-list .value {
  font-size: 1.2rem;
  font-weight: 600;
}

.contact-aside {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.contact-aside h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.contact-aside p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.contact-photo {
  width: 180px;
  height: 180px;
  max-width: 180px;
  object-fit: cover;
  object-position: center center;
  display: block;
  margin-bottom: 1rem;
}

/* ——— Home extras ——— */
.home-strip {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space) clamp(2rem, 5vw, 3.5rem);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stat {
  background: rgba(255, 255, 255, 0.4);
  padding: 1.5rem 1.25rem;
  text-align: left;
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat span {
  font-size: 0.85rem;
  color: var(--muted);
}

.teaser {
  margin-top: 2rem;
}

.teaser h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.5rem;
}

.teaser p {
  color: var(--ink-soft);
  max-width: 40rem;
  margin-bottom: 1.25rem;
}

/* ——— Education ——— */
.edu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.edu-list li {
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
}

.edu-list strong {
  display: block;
  font-family: var(--font-display);
}

.edu-list span {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ——— Footer ——— */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--space) 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
}

.site-footer a:hover {
  border-bottom-color: var(--ink-soft);
}

/* ——— Motion ——— */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse-block {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(6px, -4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .hero__brand,
  .hero__role,
  .hero__ctas,
  .hero__media,
  .case {
    opacity: 1;
    transform: none;
  }
}

/* ——— Responsive ——— */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero__media {
    order: -1;
    width: 180px;
    max-width: 180px;
  }

  .hero__photo {
    width: 180px;
    height: 180px;
  }

  .hero__caption {
    max-width: 180px;
  }

  .job {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .case {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

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

  .contact-photo {
    width: 160px;
    height: 160px;
    max-width: 160px;
  }

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

@media (max-width: 540px) {
  .contact-strip__links {
    font-size: 0.8rem;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
