:root {
  --bg: #0f1726;
  --bg-soft: #1a2538;
  --text: #f2f4f8;
  --muted: #b6bfce;
  --accent: #c8a96b;
  --accent-2: #88a9c3;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(207, 216, 230, 0.24);
  --radius: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Josefin Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(
    140deg,
    var(--bg) 0%,
    var(--bg-soft) 60%,
    #182945 100%
  );
  background-size: 180% 180%;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

@supports (-webkit-touch-callout: none) {
  body {
    min-height: -webkit-fill-available;
  }
}

html {
  height: -webkit-fill-available;
}

main {
  flex: 1 0 auto;
  overflow-x: hidden;
}

body.is-loading {
  overflow: hidden;
  height: 100vh;
}

.page-transition {
  position: fixed;
  inset: 0;
  background: rgba(9, 15, 27, 0.96);
  transform: scaleY(0);
  transform-origin: center;
  z-index: 45;
  pointer-events: none;
}

body.is-leaving .page-transition {
  animation: pageLeave 0.55s cubic-bezier(0.22, 0.8, 0.22, 1) forwards;
}

.page-intro {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -3;
}

.intro-half {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  background: rgba(9, 15, 27, 0.98);
}

.intro-top {
  top: 0;
}

.intro-bottom {
  bottom: 0;
}

.intro-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text);
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 2;
}

.intro-text-top {
  clip-path: inset(0 0 50% 0);
  z-index: 3;
}

.intro-text-bottom {
  clip-path: inset(50% 0 0 0);
  z-index: 3;
}

body.is-loading .page-intro {
  opacity: 1;
  pointer-events: auto;
}

body.is-loading .intro-top {
  animation: slideTop 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.175s forwards;
}

body.is-loading .intro-bottom {
  animation: slideBottom 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.175s forwards;
}

body.is-loading .intro-text-top {
  animation: textSplitTop 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.175s forwards;
}

body.is-loading .intro-text-bottom {
  animation: textSplitBottom 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.175s forwards;
}

.grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.05) 0.8px,
    transparent 0.8px
  );
  background-size: 3px 3px;
  opacity: 0.09;
  pointer-events: none;
  z-index: 2;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 1;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.orb-a {
  width: 340px;
  height: 340px;
  background: rgba(200, 169, 107, 0.3);
  top: -80px;
  left: -80px;
}

.orb-b {
  width: 420px;
  height: 420px;
  background: rgba(136, 169, 195, 0.26);
  right: -120px;
  bottom: -120px;
}

.theme-light .orb-a {
  background: rgba(169, 127, 63, 0.24);
}

.theme-light .orb-b {
  background: rgba(74, 111, 143, 0.22);
}

.site-header,
main,
.site-footer {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 16px;
  z-index: 12;
  padding: 16px 22px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 38, 0.64);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  border-radius: 999px;
  transform-origin: top center;
  transition:
    transform 0.22s ease,
    opacity 0.22s ease,
    box-shadow 0.22s ease;
  will-change: transform;
}

.site-header.minimized {
  background: rgba(15, 23, 38, 0.82);
  box-shadow: 0 10px 30px rgba(5, 9, 18, 0.35);
  transform: translateY(-2px) scale(0.97);
}

.logo {
  font-family: "Josefin Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 1.5px;
  font-size: 1.8rem;
  text-decoration: none;
  color: var(--text);
}

.site-nav {
  display: flex;
  gap: 20px;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.22s ease;
}

.site-nav a.active {
  color: #f4dcae;
  border-bottom: 1px solid #f4dcae;
}

.site-header.minimized .site-nav a {
  opacity: 0.9;
}

.menu-toggle {
  display: none;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
}

main {
  padding: 64px 0 48px;
  text-align: center;
}

section {
  margin-bottom: 72px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2.2px;
  font-size: 0.75rem;
  color: var(--accent-2);
  margin-bottom: 16px;
}

.hero h1 {
  font-family: "Josefin Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2.8rem, 10vw, 6.2rem);
  line-height: 0.95;
  max-width: 100%;
  margin-bottom: 20px;
}

.hero-photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(212, 188, 135, 0.7);
  box-shadow: 0 16px 34px rgba(5, 9, 18, 0.45);
  margin: 0 auto 22px;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-copy {
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 auto 26px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-bottom: 34px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 12px 20px;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}

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

.btn-primary {
  background: linear-gradient(120deg, #d4bc87, var(--accent));
  color: #1b1b1b;
  box-shadow: 0 14px 34px rgba(200, 169, 107, 0.28);
}

.btn-secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

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

.hero-metrics article {
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hero-metrics h3 {
  font-size: 1.8rem;
  margin-bottom: 2px;
}

.hero-metrics p {
  color: var(--muted);
  font-size: 0.95rem;
}

.section-head h2,
.about h2,
.contact h2 {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  margin-bottom: 20px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.card {
  min-height: 260px;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.06)
  );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transform-style: preserve-3d;
  transition: transform 0.2s ease;
  text-align: center;
}

.tag {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 1px;
  color: #1f1300;
  background: #f2d7a2;
  border: 1px solid #d0ad6f;
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 16px;
  font-weight: 700;
  text-shadow: none;
}

.tag-strong {
  background: #efc87f;
  color: #1a1104;
  font-weight: 700;
  border-color: #bf9451;
  box-shadow: 0 6px 16px rgba(191, 148, 81, 0.28);
}

.work .tag,
.work .tag-strong {
  color: rgba(6, 14, 27, 0.78);
  background: #e5d3ad;
  border-color: #c8b283;
  box-shadow: none;
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

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

.card ul {
  margin-top: 12px;
  list-style-position: inside;
  padding-left: 0;
  color: var(--muted);
}

.card li {
  margin-bottom: 6px;
}

.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.about p:last-child {
  color: var(--muted);
  font-size: 1.05rem;
}

.education-list {
  display: grid;
  gap: 14px;
  position: relative;
  text-align: center;
}

.edu-item {
  background: rgba(6, 14, 27, 0.78);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 16px;
  padding: 16px 18px;
}

.edu-item h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.edu-school {
  color: #e5d3ad;
  font-weight: 600;
}

.edu-meta {
  color: var(--accent-2);
  font-size: 0.95rem;
}

.contact {
  text-align: center;
  padding: 42px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.metric-interactive {
  padding: 0;
}

.metric-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 18px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.22s ease;
}

.metric-toggle:hover,
.metric-toggle[aria-expanded="true"] {
  background: rgba(200, 169, 107, 0.12);
}

.metric-toggle:focus-visible {
  outline: 2px solid #f4dcae;
  outline-offset: 2px;
}

.languages-panel {
  max-width: 760px;
  margin: 18px auto 0;
  padding: 22px;
  text-align: left;
  background: rgba(10, 19, 34, 0.75);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.languages-panel h2 {
  font-size: 1.45rem;
  margin-bottom: 10px;
}

.languages-panel ul {
  list-style-position: inside;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.skills-home {
  margin-top: 34px;
}

.skills-home h2 {
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  margin-bottom: 18px;
}

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

.skills-grid article {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}

.skills-grid h3 {
  margin-bottom: 8px;
  color: #f4dcae;
}

.skills-grid p {
  color: var(--muted);
}

@keyframes slideTop {
  0%,
  35% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-100%);
  }
}

@keyframes slideBottom {
  0%,
  35% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(100%);
  }
}

@keyframes textSplitTop {
  0%,
  35% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -150%);
  }
}

@keyframes textSplitBottom {
  0%,
  35% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 50%);
  }
}

@keyframes pageLeave {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

.contact a {
  color: #b9d0e4;
}

.theme-light .contact a {
  color: #2b5e87;
  font-weight: 600;
}

.site-footer {
  margin-top: auto;
  padding: 8px 0 28px;
  color: var(--muted);
}

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

@media (max-width: 900px) {
  .work-grid,
  .about,
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    border-radius: 18px;
    background: rgba(8, 16, 31, 0.96);
    border: 1px solid var(--border);
    display: none;
    flex-direction: column;
    padding: 12px;
  }

  .site-nav.open {
    display: flex;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .languages-panel {
    padding: 18px;
  }
}

.theme-light {
  --bg: #f4efe5;
  --bg-soft: #efe2cf;
  --text: #1a2432;
  --muted: #4e5c70;
  --accent: #a97f3f;
  --accent-2: #4a6f8f;
  --card: rgba(255, 255, 255, 0.62);
  --border: rgba(75, 88, 110, 0.3);
}

.theme-light .intro-half,
.theme-light .page-transition {
  background: rgba(234, 223, 206, 0.98);
}

.theme-light .intro-center-text {
  color: #243142;
}

.theme-light .site-header {
  background: rgba(248, 241, 231, 0.82);
}

.theme-light .site-header.minimized {
  background: rgba(248, 241, 231, 0.92);
  box-shadow: 0 10px 30px rgba(44, 55, 72, 0.14);
}

.theme-light .edu-item {
  background: rgba(255, 255, 255, 0.8);
}

.theme-light .edu-school {
  color: #7c5b2e;
}

.theme-light .edu-meta {
  color: #345a7b;
}

.theme-light .languages-panel {
  background: rgba(255, 255, 255, 0.78);
}

.theme-light .skills-grid h3 {
  color: #6f4f22;
}

.theme-light .site-nav a.active {
  color: #6a4a1f;
  border-bottom-color: #6a4a1f;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 16px;
}

.control-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.control-btn:hover {
  background: rgba(200, 169, 107, 0.18);
}

.toggle-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.toggle-btn:focus-visible {
  outline: 2px solid #f4dcae;
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .header-controls {
    order: 4;
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }

  .theme-light .site-nav {
    background: rgba(248, 241, 231, 0.98);
  }
}
