:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --surface: #1a1a1a;
  --text: #f4f4f4;
  --text-muted: #8e8e8e;
  --accent: #e82127;
  --border: rgba(255, 255, 255, 0.08);
  --max: 1120px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --header-h: 3.75rem;
  --tap-min: 44px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
  margin: 0;
}

main {
  min-width: 0;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 9999;
}

/* ——— Header ——— */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-bottom: 0.75rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.94), rgba(10, 10, 10, 0.75) 60%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--tap-min);
  min-width: 0;
}

.logo {
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  padding: 0.35rem 0;
  -webkit-tap-highlight-color: transparent;
}

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

/* Mobile menu (checkbox, no JS) */
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  margin: -0.5rem -0.25rem -0.5rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.menu-btn span {
  display: block;
  width: 1.125rem;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  position: relative;
}

.menu-btn span::before,
.menu-btn span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s var(--ease);
}

.menu-btn span::before {
  top: -6px;
}

.menu-btn span::after {
  top: 6px;
}

.nav-toggle:checked + .menu-btn {
  border-color: var(--accent);
  background: rgba(232, 33, 39, 0.12);
}

.nav-toggle:checked + .menu-btn span {
  background: transparent;
}

.nav-toggle:checked + .menu-btn span::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle:checked + .menu-btn span::after {
  top: 0;
  transform: rotate(-45deg);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  justify-content: flex-end;
  align-items: center;
}

nav a {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.25s var(--ease);
  padding: 0.5rem 0.15rem;
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

nav a:hover,
nav a:active {
  color: var(--text);
}

@media (max-width: 767px) {
  header {
    overflow: visible;
  }

  .header-inner {
    position: relative;
    z-index: 102;
    flex-wrap: nowrap;
  }

  .menu-btn {
    display: inline-flex;
    flex-shrink: 0;
    z-index: 103;
  }

  .logo {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100vw - 5.5rem);
  }

  nav {
    position: absolute;
    z-index: 101;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0;
    margin: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    max-height: 0;
    overflow: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      max-height 0.35s var(--ease),
      opacity 0.25s var(--ease),
      visibility 0.35s;
  }

  nav a {
    font-size: 0.8125rem;
    letter-spacing: 0.14em;
    padding: 0.95rem 1rem;
    min-height: var(--tap-min);
    border-top: 1px solid var(--border);
    justify-content: center;
    box-sizing: border-box;
  }

  nav a:first-of-type {
    border-top: none;
  }

  .nav-toggle:checked ~ nav {
    max-height: min(72dvh, 420px);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

@media (min-width: 768px) {
  header {
    overflow: visible;
  }

  .header-inner {
    position: static;
    flex-wrap: nowrap;
  }

  .logo {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }

  nav {
    position: static;
    z-index: auto;
    top: auto;
    left: auto;
    right: auto;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem 1rem;
    padding: 0;
    margin: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    max-height: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: none;
  }

  nav a {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    padding: 0.35rem 0;
    min-height: unset;
    border-top: none;
  }

  .nav-toggle:checked ~ nav {
    max-height: none;
  }
}

/* ——— Hero ——— */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 1.5rem) max(1rem, env(safe-area-inset-right)) 3rem max(1rem, env(safe-area-inset-left));
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(140vw, 900px);
  height: min(140vw, 900px);
  max-width: 100vw;
  max-height: 100vw;
  background: radial-gradient(ellipse at center, rgba(232, 33, 39, 0.08) 0%, transparent 55%);
  pointer-events: none;
}

@media (max-width: 767px) {
  .hero {
    overflow-x: hidden;
  }

  .hero::before {
    width: min(100vw, 900px);
    height: min(100vw, 900px);
  }
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-label {
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  animation: fadeUp 0.8s var(--ease) both;
  line-height: 1.4;
}

@media (min-width: 480px) {
  .hero-label {
    font-size: 0.75rem;
    letter-spacing: 0.28em;
    margin-bottom: 1.25rem;
  }
}

.hero h1 {
  font-size: clamp(2rem, 9.5vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 1.25rem;
  animation: fadeUp 0.8s var(--ease) 0.1s both;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.hero-lead {
  max-width: 32rem;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.65;
  animation: fadeUp 0.8s var(--ease) 0.2s both;
}

@media (min-width: 480px) {
  .hero-lead {
    font-size: 1.0625rem;
  }
}

@media (min-width: 640px) {
  .hero-lead {
    font-size: 1.125rem;
  }
}

.hero-cta {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: fadeUp 0.8s var(--ease) 0.35s both;
}

@media (min-width: 420px) {
  .hero-cta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2.5rem;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  min-height: var(--tap-min);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 420px) {
  .btn {
    padding: 0.875rem 1.75rem;
    min-height: unset;
  }
}

@media (max-width: 419px) {
  .btn {
    width: 100%;
  }
}

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

.btn-primary:hover {
  transform: scale(1.02);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

@media (hover: none) {
  .btn-primary:hover {
    transform: none;
  }
}

/* ——— Sections ——— */
section {
  padding: 3.25rem max(1rem, env(safe-area-inset-left)) 3.25rem max(1rem, env(safe-area-inset-right));
  border-top: 1px solid var(--border);
}

@media (min-width: 640px) {
  section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

@media (min-width: 900px) {
  section {
    padding: 5rem 1.5rem;
  }
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
  min-width: 0;
}

.section-head {
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .section-head {
    margin-bottom: 3rem;
  }
}

.section-kicker {
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.65rem;
}

@media (min-width: 480px) {
  .section-kicker {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    margin-bottom: 0.75rem;
  }
}

.section-head h2 {
  font-size: clamp(1.5rem, 5.5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 640px) {
  .about-grid {
    gap: 2.5rem;
  }
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 280px 1fr;
    gap: 4rem;
  }
}

.portrait {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  max-width: 320px;
  margin: 0 auto;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
}

@media (min-width: 900px) {
  .portrait {
    margin: 0;
    max-width: none;
  }
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prose {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.75;
}

@media (min-width: 480px) {
  .prose {
    font-size: 1rem;
  }
}

.prose p + p {
  margin-top: 1rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.25rem;
}

@media (min-width: 480px) {
  .tag-cloud {
    gap: 0.5rem;
    margin-top: 1.5rem;
  }
}

.tag {
  font-size: 0.625rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.45rem 0.7rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  line-height: 1.2;
}

@media (min-width: 480px) {
  .tag {
    font-size: 0.6875rem;
    padding: 0.4rem 0.75rem;
    letter-spacing: 0.06em;
  }
}

.two-col {
  display: grid;
  gap: 1.5rem;
  min-width: 0;
}

@media (min-width: 640px) {
  .two-col {
    gap: 2rem;
  }
}

@media (min-width: 768px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.25rem;
  min-width: 0;
}

@media (min-width: 480px) {
  .card {
    padding: 1.5rem 1.75rem;
  }
}

.card h3 {
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  font-weight: 600;
}

@media (min-width: 480px) {
  .card h3 {
    font-size: 0.6875rem;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
  }
}

.card p,
.card li {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.65;
}

@media (min-width: 480px) {
  .card p,
  .card li {
    font-size: 0.9375rem;
  }
}

.card ul {
  list-style: none;
  padding-left: 0;
}

.card li + li {
  margin-top: 0.5rem;
}

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

.kv-list dt {
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 1.1rem;
  margin-bottom: 0.35rem;
}

@media (min-width: 480px) {
  .kv-list dt {
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    margin-top: 1.25rem;
  }
}

.kv-list dt:first-child {
  margin-top: 0;
}

.kv-list dd {
  color: var(--text);
  font-size: 0.875rem;
}

@media (min-width: 480px) {
  .kv-list dd {
    font-size: 0.9375rem;
  }
}

.timeline {
  position: relative;
  padding-left: 1.35rem;
}

@media (min-width: 480px) {
  .timeline {
    padding-left: 1.5rem;
  }
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

@media (min-width: 480px) {
  .timeline-item {
    padding-bottom: 2rem;
  }
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.35rem;
  top: 0.35rem;
  width: 9px;
  height: 9px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

@media (min-width: 480px) {
  .timeline-item::before {
    left: -1.5rem;
  }
}

.timeline-item strong {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

@media (min-width: 480px) {
  .timeline-item strong {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
  }
}

.timeline-item p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

@media (min-width: 480px) {
  .timeline-item p {
    font-size: 0.9375rem;
  }
}

.pub-list {
  counter-reset: pub;
  list-style: none;
}

.pub-list li {
  counter-increment: pub;
  position: relative;
  padding-left: 2rem;
  margin-bottom: 1.1rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.65;
  word-break: break-word;
}

@media (max-width: 767px) {
  .pub-list li {
    overflow-wrap: anywhere;
  }
}

@media (min-width: 480px) {
  .pub-list li {
    padding-left: 2.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
  }
}

.pub-list li::before {
  content: "[" counter(pub) "]";
  position: absolute;
  left: 0;
  top: 0.1em;
  color: var(--text);
  font-weight: 500;
  font-size: 0.7rem;
}

@media (min-width: 480px) {
  .pub-list li::before {
    font-size: 0.8rem;
    top: 0;
  }
}

footer {
  padding: 2.75rem max(1rem, env(safe-area-inset-left)) max(2rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-right));
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

@media (min-width: 640px) {
  footer {
    padding: 4rem 1.5rem;
  }
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
  }
}

.footer-brand {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

@media (min-width: 480px) {
  .footer-brand {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
  }
}

.footer-contact a {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--accent);
  transition: color 0.2s;
  padding: 0.35rem 0;
  min-height: var(--tap-min);
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}

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

.footer-address {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.65;
}

@media (min-width: 480px) {
  .footer-address {
    font-size: 0.875rem;
    line-height: 1.6;
  }
}

.footer-copy-muted {
  opacity: 0.5;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .hero-label,
  .hero h1,
  .hero-lead,
  .hero-cta {
    animation: none;
  }

  .menu-btn span::before,
  .menu-btn span::after {
    transition: none;
  }

  nav {
    transition: none;
  }
}
