:root {
  --ink: #12171c;
  --ink-soft: #3a4550;
  --mist: #8a97a3;
  --paper: #e8ecef;
  --paper-deep: #d5dde3;
  --slate: #1c2833;
  --teal: #2f6f6a;
  --teal-deep: #1f4d49;
  --line: rgba(18, 23, 28, 0.12);
  --glow: rgba(47, 111, 106, 0.22);
  --font-display: "Instrument Serif", "Times New Roman", Georgia, serif;
  --font-body: "Schibsted Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 72rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.55;
  background:
    radial-gradient(120% 80% at 10% -10%, rgba(47, 111, 106, 0.12), transparent 55%),
    radial-gradient(90% 60% at 100% 0%, rgba(28, 40, 51, 0.1), transparent 50%),
    linear-gradient(180deg, #f4f6f8 0%, #e7ebef 45%, #eef1f3 100%);
  min-height: 100%;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 20;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: var(--paper);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  color: #edf2f4;
  isolation: isolate;
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(160deg, rgba(15, 20, 24, 0.35), rgba(15, 20, 24, 0.72) 55%, rgba(15, 20, 24, 0.88)),
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(47, 111, 106, 0.35), transparent 60%),
    radial-gradient(ellipse 50% 40% at 15% 80%, rgba(90, 120, 140, 0.25), transparent 55%),
    linear-gradient(135deg, #0f1418 0%, #1a2730 42%, #24343c 100%);
  transform: scale(1.02);
  animation: atmosphere-drift 18s ease-in-out infinite alternate;
}

.hero-grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.28;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-inner {
  width: min(100% - 3rem, var(--max));
  margin: 0 auto;
  padding: 5.5rem 0 4.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
}

.hero-copy {
  min-width: 0;
}

.hero-portrait {
  margin: 0;
  justify-self: stretch;
  align-self: center;
  width: 100%;
  max-width: 36rem;
  /* Keep portrait visible even if entrance animations are blocked */
  opacity: 1;
  animation: portrait-in 1s var(--ease) both;
}

.hero-portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center 22%;
  filter: saturate(0.94) contrast(1.05);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.35);
  background: rgba(237, 242, 244, 0.06);
}

@keyframes portrait-in {
  from {
    opacity: 0;
    transform: translateY(0.8rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(232, 236, 239, 0.72);
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.4rem, 12vw, 7.2rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}

.lede {
  margin: 1.4rem 0 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.55;
  color: rgba(237, 242, 244, 0.86);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid rgba(237, 242, 244, 0.35);
  border-radius: 0;
  background: transparent;
  color: #edf2f4;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.cta:hover,
.cta:focus-visible {
  background: rgba(237, 242, 244, 0.1);
  border-color: rgba(237, 242, 244, 0.7);
}

.cta-primary {
  background: #edf2f4;
  color: var(--ink);
  border-color: #edf2f4;
}

.cta-primary:hover,
.cta-primary:focus-visible {
  background: #fff;
  color: var(--ink);
}

.hero-meta {
  margin: 2.4rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(232, 236, 239, 0.55);
}

.js .anim {
  opacity: 0;
  transform: translateY(1.1rem);
  animation: rise 0.9s var(--ease) forwards;
}

.anim-1 { animation-delay: 0.05s; }
.anim-2 { animation-delay: 0.16s; }
.anim-3 { animation-delay: 0.3s; }
.anim-4 { animation-delay: 0.44s; }
.anim-5 { animation-delay: 0.58s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes atmosphere-drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.06) translate3d(-1.2%, 1%, 0); }
}

/* ——— Sections ——— */
.section {
  padding: clamp(3.5rem, 8vw, 5.5rem) 0;
}

.section-inner {
  width: min(100% - 3rem, 52rem);
  margin: 0 auto;
}

.skills .section-inner,
.footer .section-inner {
  width: min(100% - 3rem, var(--max));
}

.section-title {
  margin: 0 0 1.75rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 0.65rem;
  background: linear-gradient(90deg, var(--teal), transparent 85%);
  transform-origin: left;
  animation: draw-line 1.1s var(--ease) both;
}

@keyframes draw-line {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.about-grid {
  display: grid;
  gap: 1.25rem;
}

.about-grid p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 40rem;
}

.role + .role {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.role-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.15rem;
  margin-bottom: 1.4rem;
}

.role-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.org {
  margin: 0;
}

.org-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-bottom: none;
  line-height: 0;
  transition: opacity 0.2s var(--ease);
}

a.org-brand:hover,
a.org-brand:focus-visible {
  opacity: 0.78;
}

.org-logo {
  width: auto;
  height: 1.55rem;
  max-width: 8.5rem;
  object-fit: contain;
  object-position: left center;
}

.org-logo-pepper {
  height: 1.45rem;
}

.org-logo-microsoft {
  height: 1.35rem;
}

.stint + .stint {
  margin-top: 1.5rem;
}

.when {
  margin: 0 0 0.55rem;
  color: var(--mist);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.stint ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
}

.stint li + li {
  margin-top: 0.45rem;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 2.5rem;
}

.skill-grid h3 {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.skill-grid p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.edu-line {
  margin: 0;
  font-size: 1.2rem;
}

.edu-courses {
  margin: 0.75rem 0 0;
  color: var(--ink-soft);
  max-width: 36rem;
}

.footer {
  padding: 2.75rem 0 3.25rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.footer-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.35rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.footer-links a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--teal);
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 4.75rem 0 3.5rem;
    align-items: start;
  }

  .hero-portrait {
    order: -1;
    max-width: min(100%, 28rem);
    margin-inline: auto;
    animation: none;
  }
}

@media (max-width: 720px) {
  .skill-grid {
    grid-template-columns: 1fr;
  }

  .cta {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .anim,
  .hero-atmosphere,
  .hero-portrait,
  .section-title::after {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
