:root {
  --ink: #172033;
  --muted: #617187;
  --paper: #f5f8fc;
  --surface: #ffffff;
  --line: #d8e3ef;
  --accent: #4f8fc5;
  --accent-strong: #2f6f9f;
  --steel: #4d647a;
  --charcoal: #172033;
  --shadow: 0 24px 70px rgba(23, 32, 51, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
}

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

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(216, 227, 239, 0.88);
  backdrop-filter: blur(18px);
  transition:
    background-color 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--surface);
  background: var(--accent);
  border-radius: 50%;
}

.brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 2vw, 24px);
  margin-left: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 2vw, 26px);
  color: var(--muted);
  font-size: 0.94rem;
}

.site-nav a {
  transition:
    color 160ms ease,
    transform 160ms ease;
}

.site-nav a:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.language-toggle {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.language-toggle:hover {
  border-color: rgba(47, 111, 159, 0.34);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.08);
  transform: translateY(-1px);
}

.language-toggle [data-language-option] {
  display: grid;
  min-width: 28px;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
}

.language-toggle [aria-current="true"] {
  color: var(--surface);
  background: var(--accent);
}

.language-divider {
  color: rgba(97, 113, 135, 0.5);
}

.section-band {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(245, 248, 252, 0.76)),
    var(--paper);
}

.hero {
  display: grid;
  min-height: 92svh;
  grid-template-columns: minmax(0, 0.98fr) minmax(320px, 0.7fr);
  grid-template-areas: "portrait content";
  align-items: center;
  gap: clamp(36px, 6vw, 86px);
  padding: 124px clamp(20px, 6vw, 88px) 72px;
}

.hero,
.content-section,
.contact-section {
  scroll-margin-top: 78px;
}

.hero-content,
.hero-portrait {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 700ms ease,
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.is-ready .hero-content,
body.is-ready .hero-portrait {
  opacity: 1;
  transform: translateY(0);
}

body.is-ready .hero-portrait {
  transition-delay: 120ms;
}

.hero-content {
  grid-area: content;
  isolation: isolate;
}

.hero-content::before {
  position: absolute;
  z-index: -1;
  inset: -42px -52px -34px -42px;
  border-radius: 18px;
  background-image: url("data:image/svg+xml,%3Csvg width='420' height='280' viewBox='0 0 420 280' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%232f6f9f' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M26 58 C76 26 126 42 172 70 S262 112 326 72 398 46 416 62'/%3E%3Cpath d='M14 172 C78 126 132 178 188 138 S276 92 334 128 388 174 414 148'/%3E%3Cpath d='M64 226 C110 198 154 214 206 236 S306 264 374 214'/%3E%3Cpath d='M58 42 L134 82 L210 48 L286 94 L360 56'/%3E%3Cpath d='M86 158 L154 118 L226 152 L302 112 L372 146'/%3E%3Cpath d='M62 42 L86 158 L64 226 M134 82 L154 118 L206 236 M210 48 L226 152 M286 94 L302 112 L374 214 M360 56 L372 146'/%3E%3C/g%3E%3Cg fill='%232f6f9f'%3E%3Ccircle cx='58' cy='42' r='3'/%3E%3Ccircle cx='134' cy='82' r='3'/%3E%3Ccircle cx='210' cy='48' r='3'/%3E%3Ccircle cx='286' cy='94' r='3'/%3E%3Ccircle cx='360' cy='56' r='3'/%3E%3Ccircle cx='86' cy='158' r='3'/%3E%3Ccircle cx='154' cy='118' r='3'/%3E%3Ccircle cx='226' cy='152' r='3'/%3E%3Ccircle cx='302' cy='112' r='3'/%3E%3Ccircle cx='372' cy='146' r='3'/%3E%3Ccircle cx='64' cy='226' r='3'/%3E%3Ccircle cx='206' cy='236' r='3'/%3E%3Ccircle cx='374' cy='214' r='3'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: min(100%, 620px) auto;
  content: "";
  -webkit-mask-image: radial-gradient(ellipse at 45% 48%, #000 0 46%, transparent 78%);
  mask-image: radial-gradient(ellipse at 45% 48%, #000 0 46%, transparent 78%);
  opacity: 0.05;
  pointer-events: none;
}

.hero-content::after {
  position: absolute;
  z-index: -1;
  inset: -42px -52px -34px -42px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 14% 18%, rgba(79, 143, 197, 0.45) 0 2px, rgba(79, 143, 197, 0.18) 3px, transparent 14px),
    radial-gradient(circle at 34% 30%, rgba(47, 111, 159, 0.42) 0 2px, rgba(47, 111, 159, 0.15) 4px, transparent 15px),
    radial-gradient(circle at 52% 22%, rgba(79, 143, 197, 0.38) 0 2px, rgba(79, 143, 197, 0.14) 4px, transparent 16px),
    radial-gradient(circle at 72% 40%, rgba(47, 111, 159, 0.42) 0 2px, rgba(47, 111, 159, 0.16) 4px, transparent 15px),
    radial-gradient(circle at 22% 72%, rgba(79, 143, 197, 0.36) 0 2px, rgba(79, 143, 197, 0.12) 4px, transparent 14px),
    radial-gradient(circle at 64% 78%, rgba(47, 111, 159, 0.34) 0 2px, rgba(47, 111, 159, 0.12) 4px, transparent 15px);
  content: "";
  -webkit-mask-image: radial-gradient(ellipse at 45% 48%, #000 0 44%, transparent 76%);
  mask-image: radial-gradient(ellipse at 45% 48%, #000 0 44%, transparent 76%);
  opacity: 0.32;
  pointer-events: none;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 14px;
  font-size: clamp(3.2rem, 7.2vw, 6.35rem);
  font-weight: 700;
  line-height: 0.98;
}

.hero-role {
  margin-bottom: 24px;
  color: var(--steel);
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  font-weight: 600;
}

.hero-copy {
  max-width: 690px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.6vw, 1.28rem);
  line-height: 1.7;
}

.hero-actions,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

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

.button-primary {
  color: var(--surface);
  background: var(--accent);
  box-shadow: 0 16px 36px rgba(79, 143, 197, 0.18);
}

.button-secondary {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.button-secondary:hover {
  border-color: rgba(47, 111, 159, 0.38);
  box-shadow: 0 14px 32px rgba(23, 32, 51, 0.08);
}

.hero-portrait {
  grid-area: portrait;
  width: min(100%, 500px);
  justify-self: center;
  align-self: center;
  margin: 0;
}

.portrait-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  max-height: min(72vh, 680px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8eef5;
  box-shadow: var(--shadow);
  transition:
    border-color 260ms ease,
    box-shadow 260ms ease,
    transform 260ms ease;
}

.portrait-frame:hover {
  border-color: rgba(47, 111, 159, 0.38);
  box-shadow: 0 30px 90px rgba(23, 32, 51, 0.14);
  transform: translateY(-4px);
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
}

.portrait-frame img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% center;
  filter: grayscale(1) contrast(1.08);
  transition:
    filter 260ms ease,
    transform 420ms ease;
}

.portrait-frame:hover img {
  filter: grayscale(1) contrast(1.14);
  transform: scale(1.025);
}

.portrait-frame img.is-hidden {
  display: none;
}

.portrait-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(23, 32, 51, 0.46);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(216, 227, 239, 0.86)),
    #e8eef5;
  font-size: clamp(2.8rem, 8vw, 5.8rem);
  font-weight: 900;
}

.content-section,
.contact-section {
  padding: clamp(64px, 8vw, 104px) clamp(20px, 6vw, 88px);
}

h2 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1.02;
}

.studies-section {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.studies-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.study-item {
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 16px 42px rgba(23, 32, 51, 0.06);
}

.study-item:nth-child(2) {
  border-top-color: var(--accent-strong);
}

.study-item h3 {
  margin-bottom: 10px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.study-center {
  margin-bottom: 14px;
  color: var(--accent-strong);
  font-weight: 700;
}

.study-item p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.projects-section {
  background: var(--paper);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}

.text-link {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-weight: 900;
}

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

.project-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.06);
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

.project-card:hover {
  border-color: rgba(47, 111, 159, 0.34);
  box-shadow: 0 18px 38px rgba(23, 32, 51, 0.09);
  transform: translateY(-3px);
}

.project-card:nth-child(2) { border-top-color: var(--accent-strong); }
.project-card:nth-child(3) { border-top-color: var(--steel); }
.project-card:nth-child(4) { border-top-color: var(--accent); }
.project-card:nth-child(5) { border-top-color: var(--accent-strong); }
.project-card:nth-child(6) { border-top-color: var(--steel); }
.project-card:nth-child(7) { border-top-color: var(--accent); }

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag {
  padding: 6px 10px;
  color: var(--muted);
  background: #eef4fa;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.tag-strong {
  color: var(--surface);
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.project-card h3 {
  margin-bottom: 8px;
  font-size: 1.02rem;
  line-height: 1.22;
}

.project-card p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.project-card .stack-items {
  margin-top: auto;
}

.project-card .tag {
  padding: 5px 8px;
  font-size: 0.68rem;
}

.project-card .stack-items span {
  padding: 5px 7px;
  font-size: 0.7rem;
}

.stack-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-items span {
  padding: 8px 10px;
  color: var(--muted);
  background: #edf5fc;
  border: 1px solid #d5e6f5;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
}

.contact-copy p {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 720px);
  justify-content: start;
  gap: 24px;
  color: var(--surface);
  background: #284760;
}

.contact-section .section-kicker {
  color: #c8d7e8;
}

.contact-copy h2 {
  margin-bottom: 22px;
}

.contact-copy p {
  max-width: 620px;
}

.contact-links a {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 800;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.contact-links a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.34);
  transform: translateY(-2px);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(20px, 6vw, 88px);
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.site-footer a {
  color: var(--accent-strong);
  font-weight: 900;
}

.cv-page {
  background: var(--surface);
}

.cv-document {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) clamp(20px, 5vw, 56px);
}

.cv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(44px, 7vw, 84px);
}

.cv-hero {
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}

.cv-hero h1 {
  margin-bottom: 12px;
  font-size: clamp(3rem, 8vw, 5.4rem);
}

.cv-hero > p:not(.section-kicker) {
  color: var(--steel);
  font-size: 1.35rem;
  font-weight: 600;
}

.cv-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.cv-links a {
  padding: 9px 12px;
  color: var(--accent-strong);
  background: #edf5fc;
  border: 1px solid #d5e6f5;
  border-radius: 999px;
  font-weight: 700;
}

.cv-section {
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.cv-section h2 {
  margin-bottom: 18px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.cv-section h3 {
  margin-bottom: 8px;
}

.cv-section p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.75;
}

.cv-section article + article {
  margin-top: 20px;
}

.reveal-item {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 620ms ease var(--reveal-delay, 0ms),
    transform 620ms cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .hero {
    grid-template-areas:
      "content"
      "portrait";
  }

  .hero-portrait {
    justify-self: start;
    max-width: 430px;
  }

  .project-grid,
  .studies-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    position: absolute;
    align-items: flex-start;
  }

  .brand-text {
    max-width: 140px;
  }

  .site-nav {
    display: none;
  }

  .language-toggle {
    flex: 0 0 auto;
  }

  .hero {
    min-height: auto;
    padding-top: 104px;
  }

  .hero-content::before,
  .hero-content::after {
    inset: -24px 0 -22px;
  }

  .hero-content::before {
    background-size: 112% auto;
  }

  h1 {
    font-size: clamp(3rem, 17vw, 4.8rem);
  }

  .studies-list,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

}

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

  .hero-content,
  .hero-portrait,
  .reveal-item {
    opacity: 1 !important;
    transform: none !important;
  }
}
