@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;600;700;800&display=swap');

:root {
  --bg: #f4f2ee;
  --surface: rgba(255, 255, 255, .72);
  --ink: #202329;
  --muted: #6e727b;
  --accent: #9a7455;
  --line: rgba(32, 35, 41, .12);
  --nav-bg: rgba(255, 255, 255, .88);
  --shadow: 0 18px 50px rgba(38, 35, 30, .10);
}

* {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth
}

body {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
  background: radial-gradient(ellipse at 15% 10%, #fff 0, transparent 38%), radial-gradient(ellipse at 90% 85%, #d9d0c5 0, transparent 35%), var(--bg);
  min-height: 100vh
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px clamp(16px, 4vw, 56px);
  max-width: 1600px;
  margin: auto
}

.site-header {
  position: relative;
  z-index: 5
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 28px #29231b0a
}

.logo,
.footer-logo {
  font: 800 1.5rem Manrope;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -.06em
}

.logo span,
.footer-logo span {
  color: var(--accent)
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 28px);
  list-style: none;
  margin: 0;
  padding: 0
}

.nav-links a {
  font-size: .9rem;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  transition: color .2s
}

.nav-links a:hover,
.nav-links a[aria-current=page] {
  color: var(--ink)
}

.theme-toggle,
.menu-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 8px 11px;
  cursor: pointer;
  color: var(--ink)
}

.menu-toggle {
  display: none
}

.page-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vh, 50px) 0
}

.page-content {
  width: 100%;
  max-width: 1250px
}

.hero-grid,
.about-layout {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: clamp(28px, 5vw, 70px)
}

.eyebrow {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--accent);
  text-transform: uppercase
}

.status-dot,
.tag-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #7e9d7d;
  border-radius: 50%;
  margin-right: 8px
}

.hero-copy h1,
.page-title h1 {
  font: 800 clamp(2.6rem, 5.4vw, 5.5rem)/1.02 Manrope;
  letter-spacing: -.065em;
  margin: 18px 0
}

.hero-copy h1 span,
.page-title h1 span {
  color: var(--accent)
}

.hero-copy h2 {
  font: 600 clamp(1.15rem, 2vw, 1.6rem) Manrope;
  margin: 0 0 18px
}

.hero-description,
.about-story p,
.section-subtitle {
  color: var(--muted);
  line-height: 1.75;
  max-width: 62ch
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin: 28px 0
}

.button {
  padding: 13px 18px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
  transition: transform .2s, box-shadow .2s
}

.button:hover {
  transform: translateY(-3px)
}

.button-primary {
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow)
}

.button-outline {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface)
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: .82rem
}

.note-line {
  height: 1px;
  width: 28px;
  background: var(--accent)
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 430px;
  perspective: 900px
}

.photo-frame,
.profile-panel,
.timeline-card,
.quality-card,
.contact-card,
.family-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: 26px
}

.photo-frame {
  width: min(100%, 370px);
  padding: 12px;
  transform: rotateY(-5deg) rotateX(2deg);
  transition: transform .35s
}

.photo-frame:hover {
  transform: rotateY(0) rotateX(0) translateY(-5px)
}

.photo-placeholder {
  height: 370px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(145deg, #d8c9b8, #eee8df);
  position: relative;
  display: grid;
  place-items: center
}

.photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.placeholder-initials {
  position: absolute;
  font: 800 4rem Manrope;
  color: #8b725d;
  pointer-events: none
}

.photo-caption {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 7px 5px
}

.photo-caption strong,
.photo-caption small {
  display: block
}

.photo-caption small {
  color: var(--muted);
  margin-top: 3px
}

.caption-mark {
  color: var(--accent)
}

.orbit {
  position: absolute;
  border: 1px solid #a88b7040;
  border-radius: 50%;
  pointer-events: none
}

.orbit-one {
  width: 440px;
  height: 440px
}

.orbit-two {
  width: 500px;
  height: 500px;
  border-style: dashed
}

.floating-tag {
  position: absolute;
  background: #fffdf9e8;
  border: 1px solid var(--line);
  padding: 11px 15px;
  border-radius: 14px;
  box-shadow: 0 12px 30px #30251a12;
  font-size: .8rem;
  font-weight: 700
}

.tag-top {
  top: 12%;
  right: 0
}

.tag-bottom {
  bottom: 12%;
  left: 0
}

.page-title {
  margin-bottom: 28px
}

.page-title.centered {
  text-align: center
}

.page-title h1 {
  font-size: clamp(2.2rem, 4vw, 4rem)
}

.section-subtitle {
  margin: 0 auto
}

.profile-panel {
  padding: clamp(20px, 3vw, 34px)
}

.panel-top {
  display: flex;
  justify-content: space-between;
  color: var(--accent);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em
}

.profile-panel h2 {
  font: 700 1.4rem Manrope
}

.info-list {
  margin: 0
}

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line)
}

.info-list dt {
  color: var(--muted);
  font-size: .82rem
}

.info-list dd {
  text-align: right;
  margin: 0;
  font-weight: 600;
  font-size: .85rem
}

.qualities,
.education-grid,
.contact-grid,
.family-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px
}

.quality-card {
  padding: 20px
}

.quality-card span {
  color: var(--accent);
  font-size: .75rem
}

.quality-card strong {
  display: block;
  margin: 12px 0;
  font: 700 1.1rem Manrope
}

.quality-card p,
.timeline-card p,
.family-card p {
  color: var(--muted);
  line-height: 1.6;
  font-size: .88rem
}

.education-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr))
}

.timeline-card {
  padding: 20px;
  display: flex;
  flex-direction: column
}

.timeline-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center
}

.timeline-marker {
  background: #e8ded3;
  color: var(--accent);
  border-radius: 10px;
  padding: 8px;
  font-weight: 800
}

.timeline-label,
.family-role {
  font-size: .65rem;
  letter-spacing: .12em;
  color: var(--accent);
  font-weight: 800
}

.timeline-card h2 {
  font: 700 1.1rem Manrope
}

.school-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  font-size: .78rem
}

.school-detail span {
  color: var(--muted)
}

.school-detail strong {
  font-weight: 600
}

.current {
  border-color: #b69a7c
}

.family-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr))
}

.family-card {
  overflow: hidden
}

.family-image {
  height: 190px;
  background: linear-gradient(135deg, #ddd0c2, #f2eae1);
  position: relative;
  display: grid;
  place-items: center
}

.family-image img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.family-image span {
  position: absolute;
  font: 800 3rem Manrope;
  color: #9a7455;
  pointer-events: none
}

.family-card-copy {
  padding: 20px
}

.family-card h2 {
  font: 700 1.1rem Manrope
}

.contact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 900px;
  margin: 40px auto
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  transition: transform .2s
}

.contact-card:hover {
  transform: translateY(-5px)
}

.contact-symbol {
  font-size: 1.3rem;
  color: var(--accent)
}

.contact-text {
  flex: 1;
  min-width: 0
}

.contact-text small,
.contact-text strong,
.contact-text em {
  display: block
}

.contact-text small {
  font-size: .65rem;
  letter-spacing: .12em;
  color: var(--accent)
}

.contact-text strong {
  margin: 7px 0
}

.contact-text em {
  font-style: normal;
  color: var(--muted);
  font-size: .78rem;
  overflow-wrap: anywhere
}

.contact-reminder,
.family-note {
  color: var(--muted);
  font-size: .8rem;
  text-align: center
}

.page-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: .7rem;
  margin-top: 25px
}

.page-indicator span {
  width: 35px;
  height: 1px;
  background: var(--accent)
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 18px 2px;
  color: var(--muted);
  font-size: .75rem
}

.site-footer p {
  margin: 0
}

.footer-hint {
  font-size: .65rem;
  letter-spacing: .1em
}

.footer-hint b {
  color: var(--accent)
}

.modal {
  position: fixed;
  inset: 0;
  background: #17191dcc;
  backdrop-filter: blur(12px);
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s
}

.modal.open {
  opacity: 1;
  visibility: visible
}

.modal-card {
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  background: #f8f5f0;
  border-radius: 24px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .7fr);
  gap: 20px;
  transform: scale(.96);
  transition: transform .25s
}

.modal.open .modal-card {
  transform: scale(1)
}

.modal img {
  width: 100%;
  height: min(65vh, 600px);
  object-fit: contain;
  background: #e7ded4;
  border-radius: 16px
}

.modal-copy {
  align-self: center
}

.modal-copy h2 {
  font: 700 1.5rem Manrope
}

.modal-copy p {
  line-height: 1.7;
  color: #64666c
}

.modal-close {
  border: 0;
  background: #e8ded3;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  float: right;
  cursor: pointer;
  font-size: 1.2rem
}

@media(max-width:900px) {

  .hero-grid,
  .about-layout {
    grid-template-columns: 1fr
  }

  .hero-copy {
    order: 1
  }

  .hero-visual {
    order: 0;
    min-height: 350px
  }

  .photo-placeholder {
    height: 300px
  }

  .photo-frame {
    width: min(80%, 320px)
  }

  .orbit-one {
    width: 350px;
    height: 350px
  }

  .orbit-two {
    width: 390px;
    height: 390px
  }

  .education-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .qualities {
    grid-template-columns: 1fr
  }

  .site-footer {
    flex-wrap: wrap
  }

  .contact-grid {
    grid-template-columns: 1fr;
    max-width: 560px
  }

  .family-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}

@media(max-width:600px) {
  .site-shell {
    padding: 12px
  }

  .navbar {
    padding: 12px 14px
  }

  .menu-toggle {
    display: block
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 12px;
    right: 12px;
    padding: 15px;
    background: #fffdf9f5;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    gap: 4px
  }

  .nav-links.open {
    display: flex
  }

  .nav-links a {
    display: block;
    padding: 10px
  }

  .nav-links li:last-child {
    text-align: center
  }

  .page-main {
    padding: 24px 0
  }

  .hero-visual {
    min-height: 320px
  }

  .photo-placeholder {
    height: 260px
  }

  .photo-frame {
    width: 76%
  }

  .orbit-one {
    width: 300px;
    height: 300px
  }

  .orbit-two {
    width: 330px;
    height: 330px
  }

  .floating-tag {
    font-size: .68rem;
    padding: 8px 10px
  }

  .tag-top {
    right: -2px
  }

  .tag-bottom {
    left: -2px
  }

  .hero-copy h1 {
    font-size: clamp(2.5rem, 12vw, 4rem)
  }

  .hero-actions {
    flex-wrap: wrap
  }

  .page-title h1 {
    font-size: 2.4rem
  }

  .education-grid,
  .family-grid {
    grid-template-columns: 1fr
  }

  .info-list div {
    align-items: flex-start
  }

  .info-list dd {
    max-width: 58%;
  }

  .site-footer {
    justify-content: center;
    text-align: center
  }

  .footer-hint {
    width: 100%
  }

  .modal-card {
    grid-template-columns: 1fr;
    max-height: 88vh
  }

  .modal img {
    height: 42vh
  }

  .modal-copy h2 {
    margin-top: 8px
  }
}

@media(prefers-reduced-motion:reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important
  }
}


/* Persistent theme palettes and stronger navigation contrast */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17191d;
  --surface: rgba(38, 41, 47, .88);
  --ink: #f3f1ed;
  --muted: #b0b4bc;
  --line: rgba(255, 255, 255, .14);
  --nav-bg: rgba(35, 38, 44, .94);
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

html[data-theme="dark"] body {
  background: radial-gradient(ellipse at 15% 10%, rgba(125, 119, 112, .24) 0, transparent 38%), radial-gradient(ellipse at 90% 85%, rgba(154, 116, 85, .20) 0, transparent 35%), var(--bg);
}

html[data-theme="dark"] .navbar {
  border-color: var(--line);
}

html[data-theme="dark"] .nav-links a,
html[data-theme="dark"] .logo {
  color: var(--ink);
}

html[data-theme="dark"] .nav-links a:hover,
html[data-theme="dark"] .nav-links a[aria-current="page"] {
  color: #d6ad87;
}

html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .menu-toggle {
  background: rgba(255, 255, 255, .10);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .floating-tag {
  background: rgba(38, 41, 47, .92);
  color: var(--ink);
}

html[data-theme="dark"] .timeline-marker {
  background: rgba(154, 116, 85, .22);
}

.placeholder-initials[hidden],
.image-fallback[hidden] {
  display: none !important;
}

.achievement-image {
  height: 118px;
  overflow: hidden;
  border-radius: 16px;
  margin: 16px 0 4px;
  background: #e7ded4;
}

.achievement-image.image-upload-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  background: linear-gradient(135deg, rgba(154, 116, 85, .10), rgba(255, 255, 255, .025));
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.achievement-image.image-upload-placeholder span {
  text-align: center;
  padding: 12px;
}

.achievement-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}

.timeline-card:hover .achievement-image img {
  transform: scale(1.045);
}

.family-image {
  overflow: hidden;
  border-radius: 20px 20px 0 0;
}

.family-image img {
  display: block;
}

@media (max-width:600px) {
  .nav-links {
    background: var(--nav-bg);
    color: var(--ink);
  }

  .nav-links a {
    color: var(--ink);
  }
}


/* Subtle transitions between portfolio pages */
@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(9px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

body.page-ready {
  animation: pageFadeIn .42s cubic-bezier(.2, .7, .2, 1) both;
}

body.page-leaving {
  animation: pageFadeOut .22s ease both;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {

  body.page-ready,
  body.page-leaving {
    animation: none !important;
  }
}


/* Refined home hero, image sizing, universal image zoom and page switcher */
.home-main {
  padding-top: clamp(16px, 2.5vh, 30px);
}

.home-greeting {
  max-width: 760px;
  font-size: clamp(2.8rem, 6vw, 6rem) !important;
  line-height: 1.04 !important;
}

.home-greeting span {
  display: inline-block;
}

.hero-visual {
  min-height: 500px;
}

.photo-frame {
  width: min(100%, 430px);
}

.photo-placeholder {
  height: 430px;
}

.photo-placeholder img {
  cursor: zoom-in;
}

.family-image img,
.achievement-image img {
  cursor: zoom-in;
}

.family-image {
  height: 220px;
}

.achievement-image {
  height: 145px;
}

.family-image.image-placeholder::after {
  content: "ADD YOUR PHOTO";
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .14em;
  color: #80664f;
}

.family-image.image-placeholder .image-fallback {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.page-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 24px auto 0;
  padding: 12px 14px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.switcher-label {
  color: var(--accent);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.switcher-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.switcher-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background .22s ease, color .22s ease, transform .22s ease, border-color .22s ease;
}

.switcher-links a:hover {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  transform: translateY(-2px);
}

.switcher-links a[aria-current="page"] {
  color: var(--ink);
  background: rgba(154, 116, 85, .15);
  border-color: rgba(154, 116, 85, .28);
}

.home-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  background: var(--bg);
  transition: opacity .45s ease, visibility .45s ease;
}

.home-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-mark {
  font: 800 3rem Manrope, sans-serif;
  letter-spacing: -.08em;
  color: var(--ink);
  animation: loaderPulse 1s ease-in-out infinite alternate;
}

.loader-mark span {
  color: var(--accent);
}

.loader-track {
  width: 150px;
  height: 3px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--line);
}

.loader-track span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: 9px;
  background: var(--accent);
  animation: loaderProgress .9s ease-in-out infinite;
}

.home-loader small {
  color: var(--muted);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .22em;
}

@keyframes loaderProgress {
  from {
    transform: translateX(-110%);
  }

  to {
    transform: translateX(340%);
  }
}

@keyframes loaderPulse {
  from {
    opacity: .65;
    transform: scale(.97);
  }

  to {
    opacity: 1;
    transform: scale(1.03);
  }
}

/* Clicked images open in an animated, accessible lightbox. */
.family-image img,
.achievement-image img,
.photo-placeholder img {
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), filter .35s ease;
}

.family-image:hover img,
.achievement-image:hover img,
.photo-placeholder:hover img {
  transform: scale(1.035);
}

.modal-card {
  animation: modalPop .3s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.94);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

html[data-theme="dark"] .page-switcher {
  background: var(--surface);
}

html[data-theme="dark"] .switcher-links a {
  color: var(--muted);
}

html[data-theme="dark"] .switcher-links a[aria-current="page"] {
  color: var(--ink);
}

@media(max-width:900px) {
  .hero-visual {
    min-height: 440px;
  }

  .photo-placeholder {
    height: 380px;
  }
}

@media(max-width:600px) {
  .home-greeting {
    font-size: clamp(2.5rem, 11vw, 4rem) !important;
  }

  .hero-visual {
    min-height: 340px;
  }

  .photo-frame {
    width: min(82%, 340px);
  }

  .photo-placeholder {
    height: 320px;
  }

  .family-image {
    height: 210px;
  }

  .page-switcher {
    margin-top: 18px;
    padding: 10px;
  }

  .switcher-links {
    gap: 5px;
  }

  .switcher-links a {
    padding: 8px 9px;
    font-size: .72rem;
  }
}

@media(prefers-reduced-motion:reduce) {

  .home-loader,
  .loader-mark,
  .loader-track span {
    animation: none !important;
    transition: none !important;
  }
}

.modal img.image-pop {
  animation: expandedImage .38s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes expandedImage {
  from {
    opacity: .5;
    transform: scale(.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Polished image viewer, homepage identity and welcome sequence */
.home-greeting .greeting-line {
  color: var(--ink);
}

.typing-name {
  display: inline-block;
  min-height: 1.08em;
  color: var(--accent);
}

.typing-name::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: .78em;
  margin-left: 5px;
  vertical-align: -.02em;
  background: var(--accent);
  animation: typingCaret .8s steps(1) infinite;
}

@keyframes typingCaret {
  50% {
    opacity: 0;
  }
}

.student-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-top: 17px;
  padding-left: 15px;
  border-left: 2px solid var(--accent);
}

.student-identity span {
  line-height: 1.35;
}

.identity-section {
  color: var(--ink);
  font: 800 .98rem Manrope, sans-serif;
  letter-spacing: .025em;
}

.identity-class {
  color: var(--muted);
  font-weight: 700;
  font-size: .88rem;
}

.identity-track {
  color: var(--muted);
  font-size: .82rem;
}

.home-loader {
  padding: 24px;
  text-align: center;
}

.loader-welcome {
  margin: 0;
  color: var(--ink);
  font: 800 clamp(1.35rem, 3vw, 1.8rem)/1.25 Manrope, sans-serif;
  letter-spacing: -.035em;
}

.loader-subtitle {
  margin: -7px 0 3px;
  color: var(--muted);
  font-size: clamp(.88rem, 1.6vw, 1rem);
}

.home-loader small {
  font-size: .66rem;
  letter-spacing: .18em;
}

.loader-track {
  width: 190px;
  height: 3px;
}

.loader-track span {
  animation-duration: 1.15s;
}

/* The same image viewer treatment is used for profile, family and achievement photos. */
.modal {
  padding: clamp(14px, 3vw, 34px);
  background: rgba(10, 12, 15, .78);
}

.modal-card {
  position: relative;
  width: min(1080px, 100%);
  max-height: min(88vh, 820px);
  overflow: hidden;
  grid-template-columns: minmax(0, 1.12fr) minmax(250px, .78fr);
  align-items: stretch;
  gap: clamp(20px, 3vw, 38px);
  padding: clamp(18px, 2.5vw, 30px);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 28px;
  background: linear-gradient(145deg, #fffdfa, #f1ece5);
  box-shadow: 0 32px 100px rgba(0, 0, 0, .38);
}

.modal-image-wrap {
  min-width: 0;
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(145deg, #e9e1d7, #f7f3ee);
}

.modal img {
  display: block;
  width: 100%;
  height: min(68vh, 650px);
  max-height: 650px;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
}

.modal-copy {
  align-self: center;
  padding: clamp(8px, 2vw, 24px) clamp(4px, 1vw, 14px);
}

.modal-kicker {
  display: inline-block;
  margin-bottom: 15px;
  color: #9a7455;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .18em;
}

.modal-copy h2 {
  margin: 0 0 14px;
  color: #25272c;
  font: 800 clamp(1.45rem, 2.5vw, 2.1rem)/1.2 Manrope, sans-serif;
  letter-spacing: -.04em;
}

.modal-copy p {
  margin: 0;
  color: #626771;
  font-size: clamp(.95rem, 1.4vw, 1.08rem);
  line-height: 1.8;
}

.modal-hint {
  display: block;
  margin-top: 28px;
  color: #92949a;
  font-size: .72rem;
  line-height: 1.5;
}

.modal-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  float: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(40, 40, 40, .08);
  background: #e9e0d6;
  color: #393a3e;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .10);
  font-size: 1.35rem;
  transition: transform .2s ease, background .2s ease;
}

.modal-close:hover {
  transform: rotate(90deg);
  background: #dfd2c4;
}

.modal.open .modal-card {
  animation: modalPresent .42s cubic-bezier(.2, .8, .2, 1) both;
}

.modal.open .modal-image-wrap img {
  animation: modalImageReveal .55s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes modalPresent {
  from {
    opacity: 0;
    transform: translateY(20px) scale(.975);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalImageReveal {
  from {
    opacity: .5;
    transform: scale(.965);
    filter: blur(3px);
  }

  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

html[data-theme="dark"] .modal-card {
  background: linear-gradient(145deg, #292c32, #202329);
  border-color: rgba(255, 255, 255, .16);
}

html[data-theme="dark"] .modal-image-wrap {
  background: linear-gradient(145deg, #343840, #25282e);
}

html[data-theme="dark"] .modal-copy h2 {
  color: #f3f1ed;
}

html[data-theme="dark"] .modal-copy p {
  color: #c0c3ca;
}

html[data-theme="dark"] .modal-hint {
  color: #969ba5;
}

html[data-theme="dark"] .modal-close {
  color: #f3f1ed;
  background: #41454d;
  border-color: rgba(255, 255, 255, .12);
}

@media(max-width:720px) {
  .modal-card {
    grid-template-columns: 1fr;
    gap: 14px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 14px;
    border-radius: 22px;
  }

  .modal-image-wrap {
    min-height: 220px;
    max-height: 48vh;
  }

  .modal img {
    height: 45vh;
    max-height: 440px;
  }

  .modal-copy {
    padding: 4px 8px 10px;
  }

  .modal-kicker {
    margin-bottom: 8px;
  }

  .modal-copy h2 {
    font-size: 1.35rem;
    margin-bottom: 8px;
  }

  .modal-copy p {
    font-size: .92rem;
    line-height: 1.6;
  }

  .modal-hint {
    margin-top: 14px;
  }

  .modal-close {
    top: 10px;
    right: 10px;
  }
}

@media(prefers-reduced-motion:reduce) {
  .typing-name::after {
    animation: none;
  }

  .modal.open .modal-card,
  .modal.open .modal-image-wrap img {
    animation: none !important;
  }
}


/* Family photo slots: add father.jpg, mother.jpg and family.jpg to images/. */
.family-image {
  position: relative;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(154, 116, 85, .20), rgba(40, 43, 49, .92));
}

.family-image.image-placeholder {
  outline: 1px dashed rgba(154, 116, 85, .55);
  outline-offset: -10px;
}

.family-image.image-placeholder .image-fallback {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(154, 116, 85, .22);
  color: var(--ink);
  font: 800 1.35rem Manrope, sans-serif;
}

.family-image.image-placeholder::before {
  content: "Add your photo";
  position: absolute;
  top: calc(50% + 42px);
  left: 0;
  right: 0;
  text-align: center;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.family-image.image-placeholder::after {
  content: "images/father.jpg  ·  mother.jpg  ·  family.jpg";
  bottom: 12px;
  font-size: .56rem;
  letter-spacing: .03em;
  color: var(--muted);
}

.family-image:not(.image-placeholder) {
  cursor: zoom-in;
}

/* The Senior High School milestone intentionally has no stock/broken image. */
.education-grid .timeline-card:nth-child(3)>h2 {
  margin-top: 32px;
}


/* ACHIEVEMENTS: compact one-screen desktop layout */
@media (min-width: 1000px) {

  html,
  body {
    min-height: 100%;
  }

  body {
    overflow-x: hidden;
  }

  body:has(.education-page) .site-shell {
    height: 100svh;
    min-height: 680px;
    overflow: hidden;
    padding-top: 12px;
    padding-bottom: 8px;
  }

  .education-page {
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
  }

  .education-page .page-title {
    margin: 0 0 4px;
  }

  .education-page .page-title .eyebrow {
    margin: 0 0 5px;
    font-size: .62rem;
  }

  .education-page .page-title h1 {
    margin: 4px 0 5px;
    font-size: clamp(1.8rem, 2.5vw, 2.55rem);
    line-height: 1.05;
  }

  .education-page .section-subtitle {
    font-size: .82rem;
    line-height: 1.35;
  }

  .education-page .education-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
    margin: 4px 0;
    min-height: 0;
  }

  .education-page .timeline-card {
    min-width: 0;
    padding: 13px;
    border-radius: 19px;
  }

  .education-page .timeline-marker {
    padding: 6px 8px;
    font-size: .82rem;
  }

  .education-page .timeline-label {
    font-size: .55rem;
  }

  .education-page .achievement-image {
    height: clamp(78px, 12vh, 112px);
    margin: 10px 0 2px;
    flex: 0 0 auto;
  }

  .education-page .timeline-card h2 {
    font-size: clamp(.86rem, 1.05vw, 1rem);
    line-height: 1.25;
    margin: 9px 0 5px;
  }

  .education-page .timeline-card p {
    font-size: clamp(.68rem, .82vw, .78rem);
    line-height: 1.42;
    margin: 5px 0;
  }

  .education-page .school-detail {
    margin-top: 7px;
    gap: 3px;
    font-size: .68rem;
    line-height: 1.25;
  }

  .education-page .page-switcher {
    margin: 5px auto 0;
    padding: 7px 10px;
    gap: 8px;
  }

  .education-page .switcher-links a {
    padding: 6px 9px;
    font-size: .7rem;
  }

  .education-page .page-indicator {
    display: none;
  }

  body:has(.education-page) .site-footer {
    padding: 8px 2px;
    font-size: .65rem;
  }
}

/* At narrow widths, preserve readable cards and allow natural scrolling. */
@media (max-width: 999px) {
  body:has(.education-page) .site-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .education-page .education-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .education-page .education-grid {
    grid-template-columns: 1fr;
  }
}