/* ============================================================
   Site — hero, sections, cards, timeline, contact, footer
   ============================================================ */

/* --- Hero ----------------------------------------------------- */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(2.5rem, 7vw, 5.5rem));
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
  overflow: clip;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-copy > * + * { margin-top: 1.4rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.hero-title .line { display: block; overflow: hidden; }
.hero-desc { font-size: clamp(1.02rem, 1.7vw, 1.18rem); color: var(--muted); max-width: 56ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }

.hero-socials { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; }
.social-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-ink);
  background: var(--surface-glass);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  transition: all var(--dur-fast) var(--ease-out);
}
.social-chip svg { width: 16px; height: 16px; }
.social-chip:hover { color: var(--cobalt); border-color: var(--cobalt); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* Entrance animation for hero copy */
.hero-anim { opacity: 0; transform: translateY(22px); animation: hero-in 760ms var(--ease-out) forwards; animation-delay: var(--d, 0ms); }
@keyframes hero-in { to { opacity: 1; transform: none; } }

/* While the splash is on screen, hold the hero entrance until it fades out */
html.splash-ok .hero-anim { animation-play-state: paused; }
.splash[hidden] { display: none !important; }
html:not(.splash-ok) .splash { display: none !important; }

/* Profile composition */
.hero-visual { position: relative; }

.profile-frame {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  background: var(--surface-glass);
  animation: hero-in 900ms 180ms var(--ease-out) both;
}
.profile-frame img { width: 100%; height: 100%; object-fit: cover; }

.profile-frame .liquid-ring {
  position: absolute;
  inset: -14%;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from 120deg, var(--cobalt), var(--lavender), var(--coral), var(--cobalt));
  filter: blur(46px);
  opacity: 0.5;
  animation: slow-spin 26s linear infinite;
}
@keyframes slow-spin { to { transform: rotate(1turn); } }

.float-card {
  position: absolute;
  z-index: 2;
  padding: 0.85rem 1rem;
  border-radius: var(--r-md);
  background: var(--surface-glass-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  max-width: 250px;
  animation: float-soft 6s ease-in-out infinite alternate;
}
.float-card.fc-quote { top: 6%; left: -8%; animation-delay: -1.4s; }
.float-card.fc-interests { bottom: 14%; right: -6%; animation-delay: -3.2s; }
.float-card.fc-meta { bottom: -5%; left: 4%; animation-delay: -4.6s; }

.float-card .fc-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cobalt);
  margin-bottom: 0.3rem;
}
.float-card .fc-text { font-size: 0.84rem; line-height: 1.5; color: var(--ink); }
.float-card .fc-list { display: flex; flex-wrap: wrap; gap: 0.32rem; }
.float-card .fc-list span {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: var(--r-pill);
  background: var(--cobalt-soft);
  color: var(--cobalt);
}
.float-card .fc-list span:nth-child(2n) { background: var(--lavender-soft); color: color-mix(in srgb, var(--lavender) 60%, var(--ink)); }
.float-card .fc-list span:nth-child(3n) { background: var(--coral-soft); color: color-mix(in srgb, var(--coral) 66%, var(--ink)); }

.hero-term { margin-top: 1.6rem; }

/* --- Stats strip ---------------------------------------------- */
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat-card { padding: 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 0.35rem; }
.stat-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  background: var(--stat-soft, var(--cobalt-soft));
  color: var(--stat-color, var(--cobalt));
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-value {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-label { font-size: 0.84rem; color: var(--muted); }
.stat-card.accent-cobalt { --stat-soft: var(--cobalt-soft); --stat-color: var(--cobalt); }
.stat-card.accent-lavender { --stat-soft: var(--lavender-soft); --stat-color: color-mix(in srgb, var(--lavender) 55%, var(--ink)); }
.stat-card.accent-coral { --stat-soft: var(--coral-soft); --stat-color: color-mix(in srgb, var(--coral) 74%, var(--ink)); }
.stat-card.accent-lime { --stat-soft: var(--lime-soft); --stat-color: color-mix(in srgb, var(--lime) 55%, var(--ink)); }

/* --- About ----------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: clamp(1.6rem, 4.5vw, 3.4rem); align-items: start; }
.about-side { position: sticky; top: calc(var(--nav-h) + 1.2rem); display: grid; justify-items: center; gap: 1.1rem; }
.about-portrait {
  position: relative;
  width: min(100%, 290px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--cobalt) 10%, transparent), var(--shadow-lg);
}
.about-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-portrait .img-ph { height: 100%; }
.about-side-meta { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.88rem; }
.about-side-meta svg { width: 15px; height: 15px; flex: none; }

.about-name-block { margin-bottom: 1.3rem; }
.about-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.55rem, 3.6vw, 2.25rem);
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-transform: uppercase;
}
.about-typed {
  display: flex;
  align-items: center;
  min-height: 1.55em;
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.9vw, 1rem);
  letter-spacing: 0.04em;
  color: var(--cobalt);
}
.typed-cursor { margin-left: 2px; font-weight: 400; animation: caret-blink 1.05s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
.about-role { margin-top: 0.5rem; color: var(--muted); font-size: 0.92rem; }

.about-bio { color: var(--muted); line-height: 1.75; font-size: 0.98rem; }
.about-bio p + p { margin-top: 1rem; }
.about-main .info-stack { margin-top: 1.4rem; }

.info-stack { display: grid; gap: 1rem; }
.info-card { padding: 1.15rem 1.25rem; }
.info-card .ic-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.6rem; }
.info-card .ic-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--cobalt-soft);
  color: var(--cobalt);
  flex: none;
}
.info-card .ic-icon svg { width: 18px; height: 18px; }
.info-card h3 { font-size: 1rem; }
.info-card .ic-body { font-size: 0.92rem; color: var(--muted); line-height: 1.6; }
.info-card .ic-body strong { color: var(--ink); font-weight: 600; }
.info-card ul.bullets li { position: relative; padding-left: 1.1rem; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--muted); }
.info-card ul.bullets li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--grad-brand); }

.social-list { display: grid; gap: 0.5rem; }
.social-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-ink);
  background: var(--surface-glass);
  font-size: 0.88rem;
  transition: all var(--dur-fast) var(--ease-out);
}
.social-row svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.social-row .sr-name { font-weight: 600; }
.social-row .sr-value { color: var(--muted); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: auto; max-width: 55%; }
.social-row:hover { border-color: var(--cobalt); transform: translateX(4px); }
.social-row:hover svg { color: var(--cobalt); }

/* --- Projects --------------------------------------------------- */
.projects-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.6rem;
}
.projects-toolbar .search-box { min-width: min(320px, 100%); }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: clamp(1.1rem, 2.6vw, 1.7rem); }

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  animation: card-in 560ms var(--ease-out) both;
  animation-delay: var(--d, 0ms);
}
@keyframes card-in { from { opacity: 0; transform: translateY(22px) scale(0.985); } to { opacity: 1; transform: none; } }

.project-card.is-featured { grid-column: span 2; }
.project-card.is-featured .pc-media { aspect-ratio: 21 / 9; }

.pc-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}
.pc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.project-card:hover .pc-media img { transform: scale(1.06); }
.pc-media .pc-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.9rem 1.1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: linear-gradient(180deg, transparent, rgba(10, 11, 22, 0.68));
}
.pc-media .pc-overlay .status-pill { background: rgba(255,255,255,0.16); color: #fff; backdrop-filter: blur(6px); }

.pc-body { padding: 1.25rem 1.35rem 1.35rem; display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }
.pc-cat { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cobalt); }
.pc-title { font-size: 1.24rem; font-weight: 800; }
.pc-desc { font-size: 0.92rem; color: var(--muted); line-height: 1.6; }
.pc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; padding-top: 0.4rem; }
.pc-links { display: flex; gap: 0.4rem; }
.pc-links a {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-ink);
  color: var(--muted);
  transition: all var(--dur-fast) var(--ease-out);
}
.pc-links a:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pc-links a svg { width: 16px; height: 16px; }

/* Project detail modal content */
.pd-hero { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 21 / 9; margin-bottom: 1.6rem; border: 1px solid var(--border); }
.pd-hero img { width: 100%; height: 100%; object-fit: cover; }
.pd-title-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.pd-sections { display: grid; gap: 1.3rem; margin-top: 1.6rem; }
.pd-block { padding: 1.25rem 1.4rem; }
.pd-block h3 { display: flex; align-items: center; gap: 0.6rem; font-size: 1.05rem; margin-bottom: 0.7rem; }
.pd-block h3 .num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--cobalt); background: var(--cobalt-soft); border-radius: 8px; padding: 0.15rem 0.5rem; }
.pd-block p { font-size: 0.95rem; color: var(--muted); line-height: 1.7; }
.pd-block ul.bullets { display: grid; gap: 0.45rem; }
.pd-block ul.bullets li { position: relative; padding-left: 1.35rem; font-size: 0.94rem; color: var(--muted); }
.pd-block ul.bullets li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px; border-radius: 3px; background: var(--grad-brand); }
.pd-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.9rem; }
.pd-gallery img { border-radius: var(--r-md); border: 1px solid var(--border-ink); aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.6rem; }

/* --- Skills ------------------------------------------------------ */
.skill-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: clamp(1.1rem, 2.6vw, 1.6rem); }
.skill-group { padding: 1.4rem 1.5rem; }
.skill-group h3 { display: flex; align-items: center; gap: 0.65rem; font-size: 1.05rem; margin-bottom: 1rem; }
.skill-group h3 .sg-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--cobalt-soft); color: var(--cobalt); }
.skill-group h3 .sg-icon svg { width: 17px; height: 17px; }
.skill-group h3 .sg-count { margin-left: auto; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); font-weight: 500; }

.skill-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.62rem 0.4rem;
  border-radius: var(--r-sm);
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.skill-item + .skill-item { border-top: 1px solid var(--border-ink); }
.skill-item:hover { background: var(--cobalt-soft); transform: translateX(4px); }
.skill-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.82rem;
  background: var(--avatar-bg, var(--cobalt-soft));
  color: var(--avatar-fg, var(--cobalt));
  flex: none;
  overflow: hidden;
}
.skill-avatar img { width: 100%; height: 100%; object-fit: cover; }
.skill-name { font-weight: 600; font-size: 0.94rem; }
.skill-meta { font-size: 0.76rem; color: var(--muted); }
.skill-level { margin-left: auto; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); flex: none; }

/* --- Timeline / Journey ------------------------------------------ */
.timeline { position: relative; padding-left: clamp(1.6rem, 4vw, 2.6rem); }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--cobalt), var(--lavender) 45%, var(--coral) 85%, transparent);
  border-radius: 2px;
}
.tl-item { position: relative; padding-bottom: clamp(1.6rem, 3.5vw, 2.4rem); }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: calc(-1 * clamp(1.6rem, 4vw, 2.6rem) + 1px);
  top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--dot-bg, var(--cobalt));
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot-bg, var(--cobalt)) 30%, transparent);
}
.tl-item.tl-education { --dot-bg: var(--cobalt); }
.tl-item.tl-experience { --dot-bg: var(--lavender); }
.tl-item.tl-project { --dot-bg: var(--coral); }
.tl-item.tl-certificate, .tl-item.tl-competition { --dot-bg: var(--lime); }
.tl-item.tl-milestone, .tl-item.tl-learning { --dot-bg: var(--cobalt); }

.tl-card { padding: 1.2rem 1.35rem; }
.tl-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; justify-content: space-between; margin-bottom: 0.35rem; }
.tl-title { font-size: 1.06rem; font-weight: 700; }
.tl-org { font-size: 0.87rem; color: var(--cobalt); font-weight: 600; }
.tl-date { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.05em; }
.tl-desc { font-size: 0.92rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.65; }
.tl-tags { margin-top: 0.75rem; }

/* --- Credentials -------------------------------------------------- */
.cred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: clamp(1.1rem, 2.6vw, 1.6rem); }
.cred-card { overflow: hidden; cursor: pointer; }
.cred-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.cred-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.cred-card:hover .cred-media img { transform: scale(1.05); }
.cred-body { padding: 1.1rem 1.25rem 1.3rem; }
.cred-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.2rem; }
.cred-issuer { font-size: 0.84rem; color: var(--cobalt); font-weight: 600; }
.cred-date { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); margin-top: 0.5rem; letter-spacing: 0.05em; }

.achv-list { display: grid; gap: 1rem; }
.achv-item {
  display: flex; gap: 1.05rem; padding: 1.2rem 1.4rem; align-items: flex-start;
  transition: transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out);
}
.achv-item:hover { transform: translateX(6px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.achv-item > div { min-width: 0; }
.achv-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--lime-soft); color: color-mix(in srgb, var(--lime) 50%, var(--ink)); flex: none; }
.achv-icon svg { width: 20px; height: 20px; }

/* --- Coding profiles ----------------------------------------------- */
.code-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: clamp(1rem, 2.4vw, 1.5rem); }
.code-card { padding: 1.3rem 1.35rem; display: flex; flex-direction: column; gap: 0.8rem; }
.code-head { display: flex; align-items: center; gap: 0.8rem; }
.code-logo {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--brand-color, var(--cobalt-soft));
  color: var(--brand-fg, #fff);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1rem;
  flex: none;
  overflow: hidden;
}
.code-logo img { width: 100%; height: 100%; object-fit: cover; }
.code-name { font-weight: 700; font-size: 1rem; }
.code-user { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); }
.code-stats { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.code-stat { padding: 0.4rem 0.7rem; border-radius: var(--r-sm); background: var(--surface-2); font-size: 0.76rem; }
.code-stat b { font-family: var(--font-head); font-size: 0.95rem; display: block; }
.code-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; font-size: 0.76rem; color: var(--muted); }
.code-foot > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.code-foot .btn { flex: 0 0 auto; }

/* --- Resume -------------------------------------------------------- */
.resume-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(230px, 300px); gap: clamp(1.2rem, 3vw, 2.2rem); align-items: start; }
.resume-copy { padding: clamp(1.4rem, 3vw, 2.1rem); }
.resume-kicker {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: 0.66rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cobalt); margin-bottom: 0.9rem;
}
.resume-kicker svg { width: 15px; height: 15px; flex: none; }
.resume-summary { color: var(--muted); line-height: 1.75; font-size: 0.98rem; }
.resume-summary p + p { margin-top: 0.9rem; }
.resume-meta-row { margin: 1.1rem 0 1.4rem; }
.resume-meta-row .tag svg { width: 14px; height: 14px; flex: none; }
.resume-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* floating document preview card */
.resume-doc {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  padding: 1.05rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface-glass);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  text-align: left;
  animation: float-soft 7s ease-in-out infinite alternate;
  transition: transform var(--dur-med) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out),
              border-color var(--dur-med) var(--ease-out);
}
.resume-doc:hover, .resume-doc:focus-visible {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--cobalt);
  animation-play-state: paused;
}
.rd-page {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-sm);
  background: #fff;
  border: 1px solid var(--border-ink);
  padding: 1.05rem 0.95rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.rd-head { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.85rem; }
.rd-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--grad-brand); flex: none; }
.rd-lines { display: grid; gap: 0.34rem; }
.rd-lines + .rd-lines { margin-top: 0.6rem; }
.rd-lines b { display: block; height: 6px; border-radius: 3px; background: rgba(36, 38, 58, 0.14); }
.rd-lines b.short { width: 58%; }
.rd-head .rd-lines b:first-child { width: 82%; }
.rd-tag {
  position: absolute;
  top: 0.7rem; right: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.16rem 0.45rem;
  border-radius: 6px;
  background: #FF876C;
  color: #fff;
}
.rd-caption { display: grid; gap: 0.15rem; font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.rd-caption small { font-weight: 500; font-size: 0.76rem; color: var(--muted); }

/* resume zoom modal */
.resume-modal-panel { width: min(980px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; }
.resume-modal-body { flex: 1; padding: 0; min-height: 0; }
.resume-frame { display: block; width: 100%; height: min(76vh, 820px); border: 0; background: var(--surface-2); }

/* --- Contact -------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(1.3rem, 3vw, 2.2rem); align-items: start; }
.contact-channels { display: grid; gap: 0.8rem; margin-top: 1.6rem; }
.contact-card { padding: 1.5rem; }
.contact-form-card { padding: clamp(1.4rem, 3vw, 2.2rem); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.2rem; }
.form-status { margin-top: 0.9rem; font-size: 0.9rem; font-weight: 600; }
.form-status.is-ok { color: var(--success); }
.form-status.is-err { color: var(--danger); }
.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.availability {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1rem;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 34%, transparent);
  color: var(--success);
  font-size: 0.83rem;
  font-weight: 700;
}
.availability .pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.8); } }

/* --- Footer ---------------------------------------------------------- */
.site-footer {
  position: relative;
  margin-top: clamp(2rem, 6vw, 4rem);
  padding: clamp(2.4rem, 6vw, 4rem) 0 2rem;
  border-top: 1px solid var(--border-ink);
  background: color-mix(in srgb, var(--surface-glass) 50%, transparent);
}
.footer-grid { display: flex; flex-wrap: wrap; gap: 1.6rem; align-items: flex-start; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.footer-links a { font-size: 0.9rem; color: var(--muted); transition: color var(--dur-fast); }
.footer-links a:hover { color: var(--cobalt); }
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--border-ink);
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
}

/* --- Section visibility (from settings) ------------------------------ */
[data-section-hidden="true"] { display: none !important; }

/* --- Responsive ------------------------------------------------------ */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 460px; margin-inline: auto; width: 100%; }
  .float-card.fc-quote { left: -3%; }
  .float-card.fc-interests { right: -3%; }
  .about-grid { grid-template-columns: 1fr; }
  .about-side { position: static; }
  .contact-grid { grid-template-columns: 1fr; }
  .resume-layout { grid-template-columns: minmax(0, 1fr) minmax(200px, 250px); }
  .project-card.is-featured { grid-column: span 1; }
  .project-card.is-featured .pc-media { aspect-ratio: 16 / 9; }
}

@media (max-width: 720px) {
  :root { --nav-h: 64px; }
  .brand-name small { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .project-grid, .cred-grid, .skill-groups, .code-grid { grid-template-columns: 1fr; }
  .resume-layout { grid-template-columns: 1fr; }
  .resume-doc { max-width: 320px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .float-card { position: static; max-width: none; margin-top: 0.9rem; animation: none; }
  .hero-visual .profile-frame { margin-bottom: 0.2rem; }
  .terminal { right: 0.5rem; left: 0.5rem; width: auto; height: 60vh; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head { flex-direction: column; align-items: flex-start; }
}

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

/* Reduced motion: kill floats/parallax */
html[data-motion="reduced"] .float-card,
html[data-motion="reduced"] .profile-frame .liquid-ring,
html[data-motion="reduced"] .splash-orb,
html[data-motion="reduced"] .hero-anim { animation: none !important; opacity: 1 !important; transform: none !important; }
html[data-motion="reduced"] .resume-doc { animation: none !important; }
html[data-motion="reduced"] .typed-cursor { animation: none !important; }

/* ============================================================
   v2 — hero background image, layout controls, image shapes
   ============================================================ */
.hero > .container { position: relative; z-index: 1; }

.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
  background: var(--bg-elevated);
}
.hero-bg[hidden] { display: none !important; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg .hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg) 62%, transparent) 0%,
    color-mix(in srgb, var(--bg) 88%, transparent) 55%,
    var(--bg) 100%);
}
html[data-theme="dark"] .hero-bg .hero-scrim {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg) 55%, transparent) 0%,
    color-mix(in srgb, var(--bg) 82%, transparent) 55%,
    var(--bg) 100%);
}
html[data-theme="dark"] .hero-bg { background: var(--bg-elevated); }

/* layout variants (Admin → Hero & splash → Layout) */
.hero-layout-centered .hero-grid {
  grid-template-columns: minmax(0, 1fr);
  max-width: 860px;
  margin-inline: auto;
  text-align: center;
}
.hero-layout-centered .hero-visual { max-width: 460px; margin-inline: auto; width: 100%; }
.hero-align-center .hero-copy { text-align: center; }
.hero-align-center .hero-badges,
.hero-align-center .hero-actions,
.hero-align-center .hero-socials { justify-content: center; }
.hero-align-center .hero-desc { margin-inline: auto; }
.hero-text-narrow .hero-title, .hero-text-narrow .hero-desc { max-width: 24ch; }
.hero-align-center.hero-text-narrow .hero-title,
.hero-align-center.hero-text-narrow .hero-desc { margin-inline: auto; }
.hero-text-wide .hero-desc { max-width: 72ch; }
.hero-noanim .hero-anim { animation: none !important; opacity: 1 !important; transform: none !important; }

/* highlighted-phrase styles */
.text-underline {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--cobalt) 60%, transparent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.12em;
}

/* availability badge accent colours */
.badge.badge-accent-cobalt .dot { background: var(--cobalt); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalt) 25%, transparent); }
.badge.badge-accent-coral .dot { background: var(--coral); box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 30%, transparent); }
.badge.badge-accent-lavender .dot { background: var(--lavender); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lavender) 35%, transparent); }
.badge.badge-accent-lime .dot { background: var(--lime); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 40%, transparent); }

/* profile photo shapes + object positioning */
.profile-frame.pf-circle { border-radius: 50%; aspect-ratio: 1 / 1; }
.profile-frame.pf-rounded { border-radius: var(--r-lg); }
.profile-frame img, .about-portrait img { object-position: var(--photo-pos, 50% 40%); }
.about-portrait { position: relative; }
.about-portrait.pf-circle { border-radius: 50%; aspect-ratio: 1 / 1; }
.about-portrait.pf-rounded { border-radius: var(--r-xl); }

/* custom CMS sections */
.custom-section { padding: clamp(1.4rem, 3vw, 2.2rem); }
.custom-section h2 { font-family: var(--font-head); font-size: var(--fs-h3); letter-spacing: -0.02em; margin-bottom: .4rem; }
.custom-section .lede { color: var(--muted); margin-bottom: .8rem; }
.custom-section p { color: var(--muted); line-height: 1.75; }
.custom-section p + p { margin-top: .9rem; }
.custom-section.cs-split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.2rem, 3vw, 2rem); align-items: center; }
.custom-section .cs-media img { width: 100%; height: 100%; max-height: 340px; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--border); }
@media (max-width: 780px) {
  .custom-section.cs-split { grid-template-columns: 1fr; }
  .custom-section.cs-split .cs-media { order: -1; }
}

/* brand logo image inside the monogram slot */
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; }


/* Custom sections: each published record is an independent, visible card. */
#custom-sections.custom-sections-host {
  display: block;
  width: 100%;
  min-height: 0;
  visibility: visible;
  opacity: 1;
}
#custom-sections.custom-sections-host > .custom-sections-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2rem);
}
#custom-sections .custom-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  min-width: 0;
  width: 100%;
  position: relative;
}
#custom-sections .custom-section.cs-split:has(.cs-media) {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
}
#custom-sections .custom-section .cs-copy {
  min-width: 0;
}
#custom-sections .custom-section .cs-copy-centered {
  text-align: center;
  max-width: 66ch;
  margin-inline: auto;
}
#custom-sections .custom-section .cs-media {
  min-width: 0;
  overflow: hidden;
}
#custom-sections .custom-section .cs-media img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
}
#custom-sections .custom-section .cs-action { margin-top: 1.2rem; }
@media (max-width: 780px) {
  #custom-sections .custom-section.cs-split:has(.cs-media) {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* ============================================================
   Responsive layout pass — desktop, tablet, and narrow phones
   Keeps existing components and behavior; layout-only overrides.
   ============================================================ */
@media (max-width: 1080px) {
  .container { width: min(100% - 2.5rem, var(--container, 1180px)); }
  .section { padding-block: clamp(3.25rem, 7vw, 5rem); }
  .section-head { gap: 1rem; flex-wrap: wrap; }
  .code-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-panel, .dialog-panel { width: min(94vw, 980px); max-width: 94vw; }
}

@media (max-width: 720px) {
  *, *::before, *::after { min-width: 0; }
  html { scroll-padding-top: calc(var(--nav-h, 64px) + 1rem); }
  body { overflow-x: clip; }
  .container { width: calc(100% - 2rem); }
  .section { padding-block: 3.25rem; }
  .section-head { align-items: flex-start; margin-bottom: 1.5rem; }
  .section-title { font-size: clamp(1.65rem, 7vw, 2.35rem); line-height: 1.12; overflow-wrap: anywhere; }
  .section-subtitle { max-width: 100%; }
  .hero { padding-top: calc(var(--nav-h, 64px) + 2rem); }
  .hero-grid { gap: 2rem; }
  .hero-copy, .hero-visual, .about-copy, .contact-copy { min-width: 0; }
  .hero-title { font-size: clamp(2.35rem, 11vw, 4rem); line-height: 1.02; overflow-wrap: anywhere; }
  .hero-actions, .resume-actions { width: 100%; }
  .hero-actions .btn, .resume-actions .btn { min-height: 44px; }
  .float-card { max-width: 100%; }
  .profile-frame { max-width: 100%; }
  .project-grid, .cred-grid, .skill-groups, .code-grid,
  .grid-2, .grid-3, .grid-4, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .project-card, .code-card, .info-card, .skill-group, .tl-card { min-width: 0; }
  .code-card { padding: 1rem; gap: .75rem; }
  .code-head { align-items: flex-start; }
  .code-head > div:last-child { min-width: 0; overflow-wrap: anywhere; }
  .code-name, .code-user { overflow-wrap: anywhere; }
  .code-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .code-stat { min-width: 0; overflow-wrap: anywhere; }
  .code-foot { align-items: stretch; flex-direction: column; }
  .code-foot .btn { width: 100%; justify-content: center; }
  .form-row, .form-grid { grid-template-columns: minmax(0, 1fr); }
  input, select, textarea { max-width: 100%; }
  .resume-layout { grid-template-columns: minmax(0, 1fr); }
  .resume-copy { padding: 1.15rem; }
  .resume-doc { max-width: 280px; margin-inline: auto; }
  .resume-modal-panel { width: calc(100vw - 1rem); max-width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); }
  .resume-frame { height: 68dvh; }
  .terminal { max-width: calc(100vw - 1rem); }
  .footer-grid > * { min-width: 0; }
  .footer-bottom { gap: .75rem; flex-wrap: wrap; }
  #custom-sections .custom-section,
  #custom-sections .custom-section.cs-split:has(.cs-media) { grid-template-columns: minmax(0, 1fr); }
  #custom-sections .custom-section .cs-media { order: -1; }
}

@media (max-width: 420px) {
  .container { width: calc(100% - 1.25rem); }
  .section { padding-block: 2.75rem; }
  .hero-title { font-size: clamp(2rem, 12vw, 3rem); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .code-stats { grid-template-columns: minmax(0, 1fr); }
  .code-stat { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
  .code-stat b { display: inline; }
  .modal-panel, .dialog-panel { width: calc(100vw - 1rem); max-width: calc(100vw - 1rem); margin: .5rem; }
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 721px) and (max-width: 960px) {
  .project-grid, .cred-grid, .skill-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .code-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resume-layout { grid-template-columns: minmax(0, 1fr) minmax(180px, 230px); }
}
