@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/archivo-variable.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/inter-variable.woff2") format("woff2");
}

:root {
  --border: #4f9dff;
  --border-soft: rgba(79, 157, 255, 0.35);
  --text: #fff3e8;
  --text-muted: rgba(255, 243, 232, 0.72);
  --card-bg: rgba(20, 10, 5, 0.28);
  --font-heading: "Archivo", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --bg-core: radial-gradient(120% 120% at 20% 15%, #ffb066 0%, #e8551f 45%, #3a1103 100%);
  --bg-availability: linear-gradient(150deg, #5c1404 0%, #c0480f 55%, #ff8a3d 100%);
  --bg-service-area: linear-gradient(160deg, #7a2a0f 0%, #a8451c 45%, #4a2f5c 100%);
  --bg-resume: radial-gradient(140% 140% at 25% 20%, #ff9142 0%, #8a2f5c 55%, #2a0c1c 100%);
  --bg-cv: radial-gradient(140% 140% at 80% 85%, #6a2f9c 0%, #2e1670 55%, #0c0a2e 100%);
  --bg-blog: linear-gradient(160deg, #4a1a7a 0%, #2e1670 45%, #150c4a 100%);
  --bg-post: linear-gradient(180deg, #241670 0%, #0c1240 100%);
  --bg-contact: radial-gradient(140% 140% at 50% 100%, #4a1a7a 0%, #241670 55%, #0c0a2e 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-core: radial-gradient(120% 120% at 20% 15%, #2659ab 0%, #101f4a 45%, #040616 100%);
    --bg-availability: linear-gradient(150deg, #040616 0%, #153272 55%, #2659ab 100%);
    --bg-service-area: linear-gradient(160deg, #101f4a 0%, #2659ab 45%, #153272 100%);
    --bg-resume: radial-gradient(140% 140% at 25% 20%, #3b6fc0 0%, #153272 55%, #040616 100%);
    --bg-cv: radial-gradient(140% 140% at 80% 85%, #2659ab 0%, #101f4a 55%, #040616 100%);
    --bg-blog: linear-gradient(160deg, #101f4a 0%, #153272 45%, #040616 100%);
    --bg-post: linear-gradient(180deg, #101f4a 0%, #040616 100%);
    --bg-contact: radial-gradient(140% 140% at 50% 100%, #2659ab 0%, #101f4a 55%, #040616 100%);
  }
}

:root[data-theme="dark"] {
  --bg-core: radial-gradient(120% 120% at 20% 15%, #2659ab 0%, #101f4a 45%, #040616 100%);
  --bg-availability: linear-gradient(150deg, #040616 0%, #153272 55%, #2659ab 100%);
  --bg-resume: radial-gradient(140% 140% at 25% 20%, #3b6fc0 0%, #153272 55%, #040616 100%);
  --bg-cv: radial-gradient(140% 140% at 80% 85%, #2659ab 0%, #101f4a 55%, #040616 100%);
  --bg-blog: linear-gradient(160deg, #101f4a 0%, #153272 45%, #040616 100%);
  --bg-post: linear-gradient(180deg, #101f4a 0%, #040616 100%);
  --bg-contact: radial-gradient(140% 140% at 50% 100%, #2659ab 0%, #101f4a 55%, #040616 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.55;
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  height: 100dvh;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

a {
  color: var(--text);
  text-decoration-color: var(--border-soft);
}

a:hover {
  text-decoration-color: var(--border);
}

code {
  font-family: ui-monospace, monospace;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(to bottom, rgba(20, 8, 2, 0.55), transparent);
}

.brand {
  font-family: var(--font-heading);
  font-weight: 700;
  text-decoration: none;
}

.primary-nav {
  display: flex;
  gap: 1.25rem;
}

.primary-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid transparent;
}

.primary-nav a:hover {
  border-bottom-color: var(--border);
}

/* ---- Section jump nav ---- */

.section-nav {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-nav a {
  display: block;
  width: 0.85rem;
  height: 0.85rem;
}

.section-nav a span {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--text);
  border-radius: 50%;
  background: transparent;
  transition: background-color 150ms ease;
}

.section-nav a.is-active span,
.section-nav a:hover span {
  background: var(--text);
}

/* ---- Fullscreen sections ---- */

main {
  display: block;
}

.screen {
  min-height: 100dvh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  padding: 6rem 8vw 4rem;
  border-top: 1px solid var(--border-soft);
  position: relative;
  overflow-y: auto;
}

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  opacity: 0.16;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.screen--core {
  background: var(--bg-core);
}

.screen--availability {
  background: var(--bg-availability);
}

.screen--service-area {
  background: var(--bg-service-area);
}

.screen--resume {
  background: var(--bg-resume);
  overflow-y: auto;
}

.screen--cv {
  background: var(--bg-cv);
}

.screen--blog,
.screen--blog-index {
  background: var(--bg-blog);
}

.screen--post {
  background: var(--bg-post);
  min-height: 100dvh;
}

.screen--contact {
  background: var(--bg-contact);
}

.avatar-wrap {
  position: relative;
  width: min(80vw, 26rem);
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar svg {
  width: 100%;
  height: 100%;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.status-badge {
  position: absolute;
  right: 6%;
  bottom: 6%;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #0c1f4d;
  padding: 0;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.8);
}

.status-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(6% + 2rem);
  transform: translateY(4px);
  background: #0c1f4d;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35em 0.75em;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.status-badge:hover + .status-tooltip,
.status-badge:focus-visible + .status-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.tagline {
  max-width: 42ch;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.contact-line {
  font-size: 0.95rem;
}

.cta {
  display: inline-block;
  align-self: flex-start;
  padding: 0.75em 1.5em;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(155deg, #2f6fd6 0%, #1a3f8f 55%, #0c1f4d 100%);
  box-shadow: 0 2px 10px rgba(6, 16, 46, 0.35);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.cta:hover {
  background: linear-gradient(155deg, #4a8bf0 0%, #2354ad 55%, #102764 100%);
  box-shadow: 0 4px 14px rgba(6, 16, 46, 0.45);
  transform: translateY(-1px);
}

.cta--secondary {
  margin-top: 1rem;
}

.cta-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.signoff {
  margin-top: 1rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
}

.lede {
  font-size: 1.1rem;
  max-width: 60ch;
}

.pull-quote {
  max-width: 50ch;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  border-left: 1px solid var(--border);
  padding-left: 1rem;
  margin-top: 1.5rem;
}

.availability-list {
  padding-left: 1.2rem;
  max-width: 40ch;
}

.availability-list li {
  margin-bottom: 0.4em;
}

/* ---- Section icons ---- */

.section-icon {
  width: 128px;
  max-width: 128px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  align-self: flex-start;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.section-icon svg {
  width: 55%;
  height: 55%;
}

.heading-icon {
  width: 1.1em;
  height: 1.1em;
  color: var(--text);
  margin-right: 0.4em;
  vertical-align: -0.15em;
}

/* ---- Service area map ---- */

.service-area-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
}

.service-area-map {
  width: min(60vw, 18rem);
  height: auto;
  flex-shrink: 0;
}

/* ---- Resume / CV entries ---- */

.print-only {
  display: none;
}

.resume-frontmatter {
  margin-bottom: 1rem;
}

.group-heading {
  margin-top: 1.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1rem;
}

.entry {
  border: 1px solid var(--border-soft);
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  max-width: 70ch;
}

.entry .period {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.entry .subheading {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.entry h4 {
  margin-bottom: 0.25rem;
}

/* ---- Blog list ---- */

.post-list {
  list-style: none;
  padding: 0;
  max-width: 60ch;
}

.post-list li {
  border: 1px solid var(--border-soft);
  background: var(--card-bg);
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.85rem;
}

.post-meta {
  margin: 0 0 0.35em;
  font-family: var(--font-heading);
}

.post-meta a {
  text-decoration: none;
  font-weight: 600;
}

.post-summary {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.post-list-empty {
  color: var(--text-muted);
  border: none;
  background: none;
  padding: 0;
}

/* ---- Footer ---- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 8vw;
  border-top: 1px solid var(--border-soft);
  background: #0a0a0a;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.print-button,
.theme-toggle {
  font: inherit;
  color: var(--text);
  background: linear-gradient(155deg, #2f6fd6 0%, #1a3f8f 55%, #0c1f4d 100%);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5em 1.1em;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(6, 16, 46, 0.35);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.print-button:hover,
.theme-toggle:hover {
  background: linear-gradient(155deg, #4a8bf0 0%, #2354ad 55%, #102764 100%);
  box-shadow: 0 4px 14px rgba(6, 16, 46, 0.45);
  transform: translateY(-1px);
}

.theme-toggle {
  font-size: 0.85rem;
  padding: 0.4em 0.9em;
  white-space: nowrap;
}

.print-button--resume {
  align-self: flex-start;
  font-size: 0.85rem;
  padding: 0.4em 0.9em;
  margin-bottom: 0.5rem;
}

/* ---- Cookie banner ---- */

.cookie-banner {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  max-width: 26rem;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #1c0a02;
  color: var(--text);
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}

.cookie-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cookie-banner p {
  margin: 0;
  flex: 1;
}

.cookie-banner button {
  font: inherit;
  background: linear-gradient(155deg, #2f6fd6 0%, #1a3f8f 55%, #0c1f4d 100%);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4em 0.9em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(6, 16, 46, 0.35);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.cookie-banner button:hover {
  background: linear-gradient(155deg, #4a8bf0 0%, #2354ad 55%, #102764 100%);
  box-shadow: 0 4px 14px rgba(6, 16, 46, 0.45);
  transform: translateY(-1px);
}

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

@media (max-width: 640px) {
  .screen {
    padding: 8rem 6vw 3rem;
  }

  .section-nav {
    right: 0.5rem;
  }

  .site-header {
    flex-wrap: wrap;
  }

  .brand {
    order: 1;
  }

  .theme-toggle {
    order: 2;
  }

  .primary-nav {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.85rem;
  }

  .avatar-wrap {
    align-self: center;
  }

  .section-icon {
    align-self: center;
  }
}

/* ---- Slide-into-view reveal ---- */

.screen > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: calc(var(--reveal-index, 0) * 60ms);
}

.screen.in-view > * {
  opacity: 1;
  transform: translateY(0);
}

.screen > *:nth-child(1) { --reveal-index: 0; }
.screen > *:nth-child(2) { --reveal-index: 1; }
.screen > *:nth-child(3) { --reveal-index: 2; }
.screen > *:nth-child(4) { --reveal-index: 3; }
.screen > *:nth-child(5) { --reveal-index: 4; }
.screen > *:nth-child(6) { --reveal-index: 5; }
.screen > *:nth-child(n + 7) { --reveal-index: 6; }

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

  .screen > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

}
