:root {
  --paper: #f3efe4;
  --paper-warm: #e8dfcc;
  --ink: #15130f;
  --ink-soft: #3c372f;
  --muted: #756d60;
  --line: rgba(21, 19, 15, 0.16);
  --line-strong: rgba(21, 19, 15, 0.34);
  --card: rgba(255, 252, 244, 0.72);
  --card-solid: #fffaf0;
  --accent: #d4482f;
  --accent-dark: #9d2d20;
  --blue: #253f7a;
  --shadow: 0 24px 70px rgba(35, 29, 18, 0.12);
  --shadow-crisp: 7px 7px 0 rgba(21, 19, 15, 0.07);
  --max-width: 1240px;
  --radius: 10px;
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 6%, rgba(212, 72, 47, 0.12), transparent 30rem),
    radial-gradient(circle at 84% 22%, rgba(37, 63, 122, 0.1), transparent 28rem),
    linear-gradient(115deg, var(--paper), #f9f4e8 52%, var(--paper-warm));
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 78px 78px;
  opacity: 0.26;
  mask-image: linear-gradient(to bottom, black 0 58%, transparent);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, transparent 0 49.85%, rgba(21, 19, 15, 0.06) 49.85% 50.15%, transparent 50.15%),
    repeating-linear-gradient(0deg, rgba(21, 19, 15, 0.025) 0 1px, transparent 1px 5px);
  opacity: 0.42;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.13;
  background-image:
    radial-gradient(circle, rgba(21, 19, 15, 0.22) 0 0.6px, transparent 0.7px),
    radial-gradient(circle, rgba(21, 19, 15, 0.12) 0 0.5px, transparent 0.6px);
  background-position: 0 0, 7px 11px;
  background-size: 13px 13px, 19px 19px;
  mix-blend-mode: multiply;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.site-shell {
  width: min(100% - 36px, var(--max-width));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 18px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  margin: 20px 0 34px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(249, 244, 232, 0.84);
  box-shadow: 0 18px 50px rgba(35, 29, 18, 0.08);
  backdrop-filter: blur(20px) saturate(135%);
}

.brand,
.header-actions,
.language-switch,
.hero-actions,
.contact-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(21, 19, 15, 0.12);
  overflow: hidden;
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  shape-rendering: geometricPrecision;
}

.brand-mark rect {
  fill: var(--ink);
}

.brand-mark path:first-of-type {
  fill: var(--paper);
}

.brand-mark path:last-of-type {
  fill: var(--accent);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
  letter-spacing: -0.035em;
}

.brand small,
.header-link {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.header-actions {
  gap: 10px;
}

.language-switch {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.74);
  overflow: hidden;
}

.language-switch button {
  min-width: 44px;
  padding: 10px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.language-switch button:last-child {
  border-right: 0;
}

.language-switch button.is-active {
  background: var(--ink);
  color: var(--paper);
}

.header-link {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.54);
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.header-link:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.section-panel,
.content-grid,
.experience,
.projects {
  margin-bottom: clamp(76px, 10vw, 132px);
}

.section-panel {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.86), rgba(232, 223, 204, 0.74)),
    var(--card);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  display: grid;
  min-height: calc(100vh - 116px);
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: clamp(30px, 5.2vw, 74px);
  align-items: stretch;
  padding: clamp(30px, 5.6vw, 76px);
  overflow: hidden;
}

.hero::before {
  position: absolute;
  right: clamp(28px, 5vw, 74px);
  top: clamp(26px, 5vw, 68px);
  width: 68px;
  height: 68px;
  content: "";
  border: 1px solid var(--accent);
  background:
    linear-gradient(45deg, transparent 48%, var(--accent) 49% 51%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, var(--accent) 49% 51%, transparent 52%);
  opacity: 0.16;
}

.hero::after {
  position: absolute;
  right: clamp(22px, 4vw, 62px);
  bottom: clamp(22px, 4vw, 62px);
  width: clamp(180px, 24vw, 330px);
  height: 1px;
  content: "";
  background: var(--line-strong);
}

.hero-orbit {
  position: absolute;
  right: -80px;
  top: -130px;
  width: clamp(300px, 39vw, 520px);
  aspect-ratio: 1;
  pointer-events: none;
  border: 1px solid rgba(37, 63, 122, 0.14);
  border-radius: 0;
  transform: rotate(11deg);
}

.hero-orbit span {
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(212, 72, 47, 0.18);
}

.hero-orbit span:last-child {
  inset: 34%;
  border-color: rgba(21, 19, 15, 0.13);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 610px;
  padding-top: 34px;
}

.system-card,
.content-grid,
.experience,
.projects,
.contact {
  position: relative;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--accent-dark);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before,
.section-kicker::before {
  width: 34px;
  height: 1px;
  content: "";
  background: currentColor;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  text-wrap: balance;
}

h1 {
  max-width: 980px;
  margin-bottom: 24px;
  font-size: clamp(4.05rem, 8.7vw, 9.1rem);
  line-height: 0.84;
  letter-spacing: -0.08em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2.35rem, 4.75vw, 5.25rem);
  line-height: 0.92;
  letter-spacing: -0.065em;
}

h3 {
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.42rem;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.hero-lead {
  max-width: 680px;
  margin-bottom: 32px;
  color: var(--ink-soft);
  font-size: clamp(1.04rem, 1.55vw, 1.3rem);
  line-height: 1.62;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 14px 18px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 5px 5px 0 rgba(212, 72, 47, 0.9);
}

.button.primary:hover {
  box-shadow: 3px 3px 0 rgba(212, 72, 47, 0.9);
}

.button.ghost {
  background: rgba(255, 250, 240, 0.46);
}

.button.ghost:hover {
  background: var(--accent);
  color: var(--paper);
}

.button.large {
  min-height: 60px;
  padding-inline: 24px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 760px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.42);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  max-width: 760px;
  margin: 28px 0 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: rgba(255, 250, 240, 0.3);
}

.signal-strip div {
  padding: 16px 16px 18px;
  border-right: 1px solid var(--line-strong);
}

.signal-strip div:last-child {
  border-right: 0;
}

.signal-strip dt {
  margin-bottom: 6px;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--accent);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1;
  letter-spacing: -0.08em;
}

.signal-strip dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.system-card {
  align-self: end;
  min-height: 535px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(21, 19, 15, 0.78);
  border-radius: 18px;
  background: var(--card-solid);
  box-shadow: var(--shadow-crisp), 0 26px 68px rgba(35, 29, 18, 0.1);
  overflow: hidden;
}

.system-card::before {
  position: absolute;
  inset: 13px;
  pointer-events: none;
  content: "";
  border: 1px solid var(--line);
  border-radius: 10px;
}

.card-halo {
  position: absolute;
  right: -72px;
  top: -72px;
  width: 190px;
  aspect-ratio: 1;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(212, 72, 47, 0.08);
  transform: rotate(22deg);
}

.terminal-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.terminal-bar span {
  width: 9px;
  height: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
}

.terminal-bar span:first-child {
  background: var(--accent);
}

.terminal-bar span:nth-child(2) {
  background: var(--blue);
}

.terminal-bar span:nth-child(3) {
  background: var(--ink);
}

.terminal-bar strong {
  margin-left: auto;
  font-weight: 900;
}

.status-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px 22px;
  padding-block: 54px;
}

.status-grid span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.status-grid strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 500;
}

pre {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(37, 63, 122, 0.08), transparent),
    #f7f0df;
  color: var(--ink-soft);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: clamp(0.72rem, 1.1vw, 0.9rem);
  line-height: 1.7;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(30px, 7vw, 90px);
  align-items: start;
}

.section-sticky {
  position: sticky;
  top: 116px;
}

.section-index {
  display: inline-grid;
  width: 58px;
  height: 36px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.48);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.copy-block {
  display: grid;
  gap: 20px;
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.54);
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.45vw, 1.22rem);
  line-height: 1.74;
  box-shadow: 0 20px 54px rgba(35, 29, 18, 0.055);
}

.copy-block p {
  margin-bottom: 0;
}

.section-heading {
  max-width: 840px;
  margin-bottom: 34px;
}

.timeline,
.project-grid,
.stack-grid {
  display: grid;
}

.timeline {
  grid-template-columns: 0.92fr 1.08fr;
  gap: 20px;
}

.experience-card,
.project-card,
.stack-grid article {
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.58);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.experience-card:hover,
.project-card:hover,
.stack-grid article:hover {
  background: var(--card-solid);
  box-shadow: var(--shadow-crisp), 0 24px 56px rgba(35, 29, 18, 0.08);
  transform: translateY(-3px);
}

.experience-card {
  position: relative;
  padding: clamp(24px, 4vw, 38px);
  overflow: hidden;
}

.experience-card::after {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 82px;
  height: 82px;
  content: "";
  border: 1px solid rgba(212, 72, 47, 0.2);
  border-radius: 10px;
  transform: rotate(18deg);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 38px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.role {
  margin-bottom: 24px;
  color: var(--muted);
  font-weight: 700;
}

.experience-card ul {
  display: grid;
  gap: 13px;
  margin: 0;
  padding-left: 0;
  color: var(--ink-soft);
  line-height: 1.58;
  list-style: none;
}

.experience-card li {
  position: relative;
  padding-left: 24px;
}

.experience-card li::before {
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 10px;
  height: 1px;
  content: "";
  background: var(--accent);
}

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

.stack-grid article {
  position: relative;
  padding: 24px;
  background: rgba(255, 250, 240, 0.5);
}

.stack-grid article::before {
  display: block;
  width: 54px;
  height: 1px;
  margin-bottom: 18px;
  content: "";
  background: var(--accent);
}

.stack-grid p {
  margin-bottom: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.project-grid {
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.project-card {
  position: relative;
  grid-column: span 3;
  min-height: 264px;
  padding: 26px;
  overflow: hidden;
}

.project-card:nth-child(1),
.project-card:nth-child(4) {
  grid-column: span 6;
}

.project-card:nth-child(2),
.project-card:nth-child(3) {
  grid-column: span 6;
  transform: none;
}

.project-card:nth-child(2):hover,
.project-card:nth-child(3):hover {
  transform: translateY(-3px);
}

.project-card::before {
  position: absolute;
  left: 26px;
  right: 26px;
  top: 74px;
  height: 1px;
  content: "";
  background: var(--line-strong);
}

.project-card span {
  display: inline-flex;
  margin-bottom: 54px;
  color: var(--accent-dark);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-card p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.62;
}

.contact {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  padding: clamp(30px, 5.6vw, 66px);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(212, 72, 47, 0.12), transparent 44%),
    rgba(255, 250, 240, 0.72);
}

.contact-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.reveal {
  animation: reveal 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.reveal:nth-child(3) {
  animation-delay: 110ms;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero,
  .content-grid,
  .contact {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-copy {
    min-height: 500px;
  }

  .system-card {
    min-height: auto;
  }

  .section-sticky {
    position: static;
  }

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

  .project-card,
  .project-card:nth-child(1),
  .project-card:nth-child(2),
  .project-card:nth-child(3),
  .project-card:nth-child(4) {
    grid-column: auto;
    transform: none;
  }

  .project-card:nth-child(2):hover,
  .project-card:nth-child(3):hover {
    transform: translateY(-3px);
  }

  .contact-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .site-shell {
    width: min(100% - 24px, var(--max-width));
  }

  .site-header {
    position: static;
    grid-template-columns: 1fr;
    border-radius: 22px;
  }

  .header-actions {
    justify-content: space-between;
  }

  .language-switch {
    flex: 1;
  }

  .language-switch button {
    flex: 1;
  }

  .header-link {
    display: none;
  }

  .section-panel,
  .content-grid,
  .experience,
  .projects {
    margin-bottom: 70px;
  }

  .hero {
    padding: 24px;
  }

  .hero-copy {
    min-height: 470px;
  }

  .hero-orbit {
    right: -160px;
    top: -140px;
    width: 340px;
  }

  h1 {
    font-size: clamp(3.1rem, 16vw, 5rem);
    letter-spacing: -0.072em;
  }

  h2 {
    letter-spacing: -0.056em;
  }

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

  .project-card {
    min-height: auto;
  }

  .project-card span {
    margin-bottom: 48px;
  }

  .system-card {
    box-shadow: 5px 5px 0 rgba(21, 19, 15, 0.07), 0 20px 46px rgba(35, 29, 18, 0.08);
  }

  .signal-strip {
    grid-template-columns: 1fr;
  }

  .signal-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .signal-strip div:last-child {
    border-bottom: 0;
  }

  .contact-actions,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
