:root {
  --bg: #f5f8f7;
  --surface: #ffffff;
  --surface-soft: #eef6f4;
  --surface-tint: #f8fbfa;
  --text: #14313a;
  --muted: #344f57;
  --line: #dbe7e5;
  --brand: #006f82;
  --brand-dark: #004f60;
  --brand-soft: #e0f2f1;
  --green: #3d806f;
  --gold: #d6a43f;
  --shadow-sm: 0 1px 2px rgba(20, 49, 58, 0.06);
  --shadow-md: 0 12px 24px rgba(20, 49, 58, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --container: 1160px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, var(--surface-tint) 0%, var(--bg) 100%);
  color: var(--text);
  line-height: 1.62;
}

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

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

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0, 111, 130, 0.08), transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #f2f8f7 100%);
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--green) 58%, var(--gold) 100%);
}

.hero-bg {
  position: absolute;
  inset: 8px 0 0;
  opacity: 0.48;
  background-image:
    linear-gradient(to right, rgba(0, 111, 130, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 111, 130, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.72fr);
  gap: 4rem;
  align-items: center;
  padding: 4.75rem 0 4.25rem;
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--brand);
}

.hero h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.subtitle {
  margin: 1rem 0 0;
  max-width: 38rem;
  font-size: clamp(1.1rem, 1.8vw, 1.42rem);
  color: var(--brand-dark);
  font-weight: 700;
}

.lead {
  max-width: 45rem;
  margin: 1.4rem 0 0;
  font-size: 1.08rem;
  color: var(--muted);
}

.hero-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.hero-scope span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.38rem 0.72rem;
  border: 1px solid rgba(0, 111, 130, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-dark);
  font-size: 0.86rem;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.9rem;
}

.hero-actions.center {
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.74rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.96rem;
  gap: 0.55rem;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--brand);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-secondary {
  border: 1px solid rgba(0, 111, 130, 0.22);
  background: white;
  color: var(--brand-dark);
}

.btn-secondary:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.btn-download {
  background: #e8f5f3;
  border-color: rgba(0, 111, 130, 0.3);
}

.btn-linkedin {
  border-color: rgba(0, 119, 181, 0.28);
  color: #005d8f;
}

.btn-linkedin:hover {
  background: #e8f3f8;
  border-color: #0077b5;
}

.btn-secondary.light {
  border: 1px solid rgba(0, 111, 130, 0.22);
  background: white;
  color: var(--brand-dark);
}

.btn-secondary.light:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.35rem;
}

.hero-meta > * {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.91rem;
  font-weight: 600;
  transition: border-color 180ms ease, color 180ms ease;
}

.hero-meta > *:hover {
  border-color: rgba(0, 111, 130, 0.32);
  color: var(--brand-dark);
}

.icon {
  flex-shrink: 0;
  opacity: 0.82;
}

.profile-panel {
  position: relative;
  padding: 1.75rem;
  border: 1px solid rgba(0, 111, 130, 0.18);
  border-top: 6px solid var(--brand);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
}

.profile-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1.4rem;
}

.profile-panel-header > div {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-panel-header h2 {
  margin-bottom: 0;
}

.profile-photo-button {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: zoom-in;
}

.profile-photo-button:focus-visible {
  outline: 3px solid rgba(0, 111, 130, 0.35);
  outline-offset: 4px;
}

.profile-photo-bubble {
  width: 76px;
  height: 76px;
  border: 3px solid white;
  border-radius: 999px;
  object-fit: cover;
  object-position: center 38%;
  box-shadow: 0 0 0 1px rgba(0, 111, 130, 0.22), var(--shadow-sm);
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.profile-photo-button:hover .profile-photo-bubble {
  box-shadow: 0 0 0 2px rgba(0, 111, 130, 0.28), var(--shadow-md);
  transform: translateY(-1px);
}

.panel-label {
  margin: 0 0 0.75rem;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.profile-panel h2 {
  max-width: 21rem;
  margin: 0 0 1.4rem;
  font-size: clamp(1.28rem, 1.75vw, 1.62rem);
  line-height: 1.22;
}

.profile-panel dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.profile-panel dl div {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.profile-panel dt {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-panel dd {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

.section {
  padding: 4.6rem 0;
}

.section-compact {
  padding-top: 0;
}

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

.section-dark {
  background: linear-gradient(180deg, #12343c 0%, #0c2830 100%);
  color: white;
}

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

.section-head h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.85rem, 3vw, 2.55rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.section-dark .section-head h2 {
  color: white;
}

.cards {
  display: grid;
  gap: 1rem;
}

.cards.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.card {
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.card:hover {
  border-color: rgba(0, 111, 130, 0.28);
  box-shadow: var(--shadow-md);
}

.card.dark {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.card h2,
.card h3 {
  margin: 0 0 0.65rem;
  line-height: 1.24;
}

.card h2 {
  padding-left: 0.85rem;
  border-left: 4px solid var(--green);
}

.card p,
.card li {
  color: var(--muted);
}

.section-dark .card p,
.section-dark .card li,
.section-dark .period-inline {
  color: rgba(255, 255, 255, 0.94);
}

.section-dark .card h3 {
  color: white;
}

.org {
  margin: 0.15rem 0 0.45rem;
  color: var(--brand-dark);
  font-weight: 700;
}

.section-dark .org {
  color: #d8f4f1;
}

.period,
.period-inline {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.62rem;
  border-radius: var(--radius-sm);
  background: #cce8e5;
  color: #003f4d;
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid rgba(0, 111, 130, 0.22);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.skill-item {
  padding: 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.skill-item h3 {
  margin: 0 0 0.45rem;
  color: var(--brand-dark);
  font-size: 1rem;
  line-height: 1.25;
}

.skill-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.section-dark .period,
.section-dark .period-inline {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

.timeline {
  display: grid;
  gap: 1.15rem;
  position: relative;
  padding-left: 1.45rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--brand), var(--green));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding: 1.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.48rem;
  top: 1.65rem;
  width: 0.78rem;
  height: 0.78rem;
  background: white;
  border: 3px solid var(--brand);
  border-radius: 50%;
  z-index: 1;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.timeline-top h3 {
  margin: 0;
}

.cta {
  padding: 2rem;
  text-align: center;
  border: 1px solid rgba(0, 111, 130, 0.16);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, rgba(0, 111, 130, 0.08), rgba(61, 128, 111, 0.08)),
    white;
  box-shadow: var(--shadow-sm);
}

.cta p {
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
  color: var(--muted);
}

.cta h2 {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.cta-contact h2 {
  margin-bottom: 0.75rem;
}

.cta-contact .hero-actions {
  margin-top: 1.15rem;
}

.footer {
  border-top: 1px solid var(--line);
  background: white;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0;
  color: #314a52;
  font-size: 0.94rem;
}

.footer-row p {
  margin: 0;
}

.rainbow-name {
  display: inline-block;
  color: var(--brand-dark);
  font-weight: 800;
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .rainbow-name {
    background: linear-gradient(90deg, #006f82, #3d806f, #d6a43f, #b45172, #006f82);
    background-size: 260% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: footer-rainbow 6s linear infinite;
  }
}

@keyframes footer-rainbow {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 260% 50%;
  }
}

.footer-row > p {
  text-align: right;
}

.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms ease, transform 500ms ease;
}

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

.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 250ms ease, visibility 250ms ease, transform 250ms ease, background 180ms ease;
  z-index: 100;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-photo-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(12, 40, 48, 0.72);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
  z-index: 200;
}

.profile-photo-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.profile-photo-modal img {
  width: min(78vw, 560px);
  max-height: 82vh;
  border: 4px solid white;
  border-radius: var(--radius-lg);
  object-fit: contain;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
  transform: scale(0.96);
  transition: transform 180ms ease;
}

.profile-photo-modal.is-open img {
  transform: scale(1);
}

.profile-photo-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand-dark);
  cursor: pointer;
}

.profile-photo-modal-close:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}

body.photo-modal-open {
  overflow: hidden;
}

.back-to-top:hover {
  background: var(--brand-dark);
}

@media (max-width: 980px) {
  .hero-grid,
  .two-cols,
  .cards.three,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 2.5rem;
    padding: 4rem 0;
  }

  .profile-panel {
    max-width: 42rem;
  }

  .timeline-top,
  .footer-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-row > p {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 3.4rem 0;
  }

  .container {
    width: min(var(--container), calc(100% - 1.2rem));
  }

  .hero-grid {
    padding: 3.2rem 0;
  }

  .hero-meta,
  .hero-scope {
    flex-direction: column;
  }

  .hero-actions {
    gap: 0.55rem;
  }

  .btn {
    min-height: 44px;
    padding: 0.68rem 0.82rem;
    font-size: 0.93rem;
  }

  .hero-meta > *,
  .hero-scope span {
    width: 100%;
  }

  .profile-panel-header {
    align-items: center;
  }

  .profile-photo-bubble {
    width: 64px;
    height: 64px;
  }

  .profile-photo-modal {
    padding: 0.75rem;
  }

  .profile-photo-modal img {
    width: min(92vw, 520px);
    max-height: 78vh;
  }

  .timeline {
    padding-left: 1rem;
  }

  .timeline-item {
    padding: 1.15rem;
  }

  .timeline-item::before {
    left: -1.03rem;
  }

  .cta {
    padding: 1.35rem;
  }
}

@media print {
  @page {
    margin: 1.2cm;
  }

  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html {
    scroll-behavior: auto;
  }

  body {
    background: #ffffff !important;
    color: #111111;
    font-size: 10.5pt;
    line-height: 1.35;
  }

  a {
    color: #111111;
  }

  .container {
    width: 100%;
  }

  .hero,
  .section,
  .section-alt,
  .section-dark,
  .footer {
    background: #ffffff !important;
    color: #111111 !important;
    border-color: #cccccc !important;
  }

  .hero::before,
  .hero-bg,
  .hero-actions,
  .back-to-top,
  .profile-photo-button,
  .profile-photo-bubble {
    display: none !important;
  }

  .hero-grid,
  .cards.three,
  .two-cols,
  .skills-grid {
    display: block;
  }

  .hero-grid {
    padding: 0 0 0.8cm;
  }

  .hero h1 {
    max-width: none;
    font-size: 28pt;
  }

  .subtitle,
  .section-head h2,
  .section-dark .section-head h2,
  .profile-panel h2 {
    color: #111111 !important;
  }

  .lead,
  .card p,
  .card li,
  .skill-item p,
  .profile-panel dd,
  .footer-row,
  .cta p,
  .section-dark .card p,
  .section-dark .card li {
    color: #222222 !important;
  }

  .hero-scope,
  .hero-meta {
    gap: 0.25rem;
  }

  .hero-scope span,
  .hero-meta > *,
  .period,
  .period-inline {
    display: inline-flex;
    margin: 0 0.25rem 0.25rem 0;
    border: 1px solid #cccccc;
    background: #ffffff !important;
    color: #111111 !important;
  }

  .profile-panel,
  .card,
  .skill-item,
  .timeline-item,
  .cta {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 0.35cm;
    border: 1px solid #cccccc;
    background: #ffffff !important;
  }

  .section {
    padding: 0.45cm 0;
  }

  .section-compact {
    padding-top: 0;
  }

  .timeline {
    padding-left: 0;
  }

  .timeline::before,
  .timeline-item::before {
    display: none;
  }

  .timeline-top {
    display: flex;
    flex-direction: row;
  }

  .footer-row {
    display: block;
    border-top: 1px solid #cccccc;
    padding-top: 0.4cm;
  }

  .footer-row > p {
    text-align: left;
  }
}

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

  .js .reveal,
  .btn,
  .back-to-top,
  .profile-photo-bubble,
  .profile-photo-modal,
  .profile-photo-modal img,
  .rainbow-name {
    animation: none;
    transition: none;
  }
}
