/* CalonCEO portfolio — design tokens and global styles */
:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-soft: #10172a;
  --surface: #121b30;
  --surface-raised: #172238;
  --surface-glass: rgba(16, 23, 42, 0.82);
  --text: #f4f7ff;
  --text-soft: #c2cbde;
  --muted: #8b98b5;
  --faint: #65738f;
  --border: rgba(165, 184, 220, 0.15);
  --border-strong: rgba(165, 184, 220, 0.27);
  --accent: #80a8ff;
  --accent-strong: #a59aff;
  --accent-soft: rgba(128, 168, 255, 0.12);
  --good: #75dfc1;
  --gold: #efca83;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --content: 1120px;
  --header-height: 76px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-soft: #eef2fa;
  --surface: #ffffff;
  --surface-raised: #f6f8fd;
  --surface-glass: rgba(255, 255, 255, 0.9);
  --text: #10182b;
  --text-soft: #3a4862;
  --muted: #65738c;
  --faint: #77849a;
  --border: rgba(31, 51, 86, 0.13);
  --border-strong: rgba(31, 51, 86, 0.24);
  --accent: #315fd4;
  --accent-strong: #6653d8;
  --accent-soft: rgba(49, 95, 212, 0.09);
  --good: #137d62;
  --gold: #93621d;
  --shadow: 0 24px 70px rgba(38, 55, 89, 0.1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 18px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 180ms ease, color 180ms ease;
}
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.21;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}
img, video { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
::selection { color: #fff; background: #496fd0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }

.container { width: min(var(--content), calc(100% - 48px)); margin-inline: auto; }
.section { padding-block: 112px; position: relative; }
.section-shell { position: relative; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--muted); }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: 0.16em; line-height: 1.5; margin: 0 0 22px; }
.eyebrow-divider { color: var(--faint); padding-inline: 7px; }
.section-heading h2 { font-size: clamp(2.15rem, 4.5vw, 3.7rem); font-weight: 650; letter-spacing: -0.055em; line-height: 1.1; margin: 0; }
.section-intro { max-width: 430px; color: var(--muted); margin: 20px 0 0; font-size: 15px; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 1000; padding: 10px 14px; border-radius: 8px; color: #fff; background: #315fd4; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

/* Header and navigation */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-height); border-bottom: 1px solid var(--border); background: var(--surface-glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; position: relative; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 19px; font-weight: 800; letter-spacing: -0.08em; background: var(--surface); }
.brand-mark span { color: var(--accent); margin-left: -2px; }
.brand-name { font-size: 17px; font-weight: 750; letter-spacing: -0.045em; }
.brand-period { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: clamp(14px, 2.1vw, 27px); margin-left: auto; }
.site-nav a { color: var(--muted); font-size: 12px; font-weight: 620; transition: color 160ms ease; white-space: nowrap; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--text); }
.icon-button { width: 42px; height: 42px; padding: 0; display: inline-grid; place-items: center; flex-shrink: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease; }
.icon-button:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.menu-toggle { display: none; }
.theme-icon-sun { display: none; }
html[data-theme="light"] .theme-icon-moon { display: none; }
html[data-theme="light"] .theme-icon-sun { display: block; }

/* Hero */
.hero { overflow: hidden; padding: 82px 0 24px; }
.hero::after { content: ""; position: absolute; z-index: -1; width: 520px; height: 520px; right: -150px; top: -80px; border-radius: 50%; background: radial-gradient(circle, rgba(98, 119, 231, 0.12), transparent 67%); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: 52px; min-height: 440px; }
.hero-copy { position: relative; z-index: 2; }
.hero-copy .eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 24px; }
.status-dot { display: inline-block; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 13%, transparent); }
.hero h1 { font-size: clamp(3.4rem, 6.8vw, 5.85rem); line-height: 0.99; letter-spacing: -0.085em; font-weight: 730; margin: 0; }
.hero-description { max-width: 510px; color: var(--text-soft); font-size: 16px; line-height: 1.85; margin: 26px 0 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.button { min-height: 48px; padding: 0 18px; display: inline-flex; justify-content: center; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 12px; font-size: 13px; font-weight: 700; transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #091126; background: var(--accent); }
.button-primary:hover { background: color-mix(in srgb, var(--accent) 84%, white); }
.button-secondary { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
.button-secondary:hover { border-color: var(--accent); }
.hero-note { display: flex; align-items: center; gap: 11px; margin-top: 34px; color: var(--muted); font-size: 11px; letter-spacing: 0.02em; }
.note-line { width: 28px; height: 1px; background: var(--accent); }
.hero-art { min-height: 415px; position: relative; display: grid; place-items: center; isolation: isolate; }
.art-glow { position: absolute; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(96, 118, 247, 0.18), rgba(116, 92, 210, 0.06) 48%, transparent 72%); z-index: -1; }
.art-orbit { position: absolute; border: 1px solid var(--border); border-radius: 50%; transform: rotate(-26deg); }
.orbit-one { width: 390px; height: 230px; }
.orbit-two { width: 340px; height: 290px; transform: rotate(38deg); border-color: color-mix(in srgb, var(--accent) 20%, transparent); }
.code-window { position: relative; z-index: 1; width: min(100%, 390px); overflow: hidden; border: 1px solid var(--border-strong); border-radius: 17px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow); transform: rotate(-2deg); }
.window-topbar { display: flex; height: 45px; align-items: center; gap: 12px; padding-inline: 15px; border-bottom: 1px solid var(--border); color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.window-dots { display: flex; gap: 5px; }
.window-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); opacity: 0.65; }
.window-dots i:first-child { background: #e28d98; opacity: 1; }
.window-dots i:nth-child(2) { background: #e9c476; opacity: 1; }
.window-dots i:nth-child(3) { background: #76d4b4; opacity: 1; }
.window-lock { margin-left: auto; font-size: 18px; }
.code-content { padding: 22px 14px 23px; font: 11.5px/2.15 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }
.code-content p { margin: 0; }
.code-number { display: inline-block; width: 30px; color: var(--faint); user-select: none; }
.code-keyword { color: #c4a4ff; }
.code-variable { color: var(--accent); }
.code-function { color: #72d6c5; }
.code-comment { color: var(--muted); }
.code-boolean { color: #efbd78; }
.code-gap { height: 8px; }
.window-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 15px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.window-footer span:first-child { display: flex; align-items: center; gap: 9px; }
.window-footer .status-dot { width: 5px; height: 5px; }
.floating-chip { position: absolute; z-index: 2; display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-glass); box-shadow: 0 12px 30px rgba(0,0,0,0.13); color: var(--text-soft); font-size: 9px; line-height: 1.45; font-weight: 650; backdrop-filter: blur(12px); }
.chip-top { top: 60px; right: -3px; }
.chip-bottom { bottom: 54px; left: 0; }
.chip-symbol { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: var(--accent-soft); font: 800 10px ui-monospace, monospace; }
.chip-spark { color: var(--accent-strong); font-size: 17px; }
.art-cross { position: absolute; color: var(--accent); opacity: 0.75; font-size: 17px; font-weight: 300; }
.cross-one { top: 37px; left: 72px; }
.cross-two { right: 48px; bottom: 42px; }
.hero-bottom { display: flex; align-items: center; gap: 13px; margin-top: 45px; color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: 0.14em; }
.hero-bottom-line { flex: 1; height: 1px; background: var(--border); }
.hero-bottom-index { letter-spacing: 0.08em; }

/* About */
.section-about { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg-soft) 74%, transparent); }
.about-layout { display: grid; grid-template-columns: 0.82fr 1.18fr; gap: clamp(36px, 8vw, 116px); }
.about-copy { max-width: 620px; }
.about-copy p { color: var(--muted); font-size: 14px; line-height: 1.9; margin: 0 0 18px; }
.about-copy .about-lead { color: var(--text); font-size: clamp(18px, 2vw, 23px); line-height: 1.55; letter-spacing: -0.025em; margin-bottom: 24px; }
.about-values { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.about-values span { color: var(--text-soft); padding: 7px 11px; border: 1px solid var(--border); border-radius: 7px; font-size: 10px; font-weight: 650; }

/* Projects */
.section-heading-row { display: flex; justify-content: space-between; align-items: end; gap: 36px; margin-bottom: 42px; }
.section-heading-row .section-intro { max-width: 405px; margin: 0 0 4px; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.project-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease; }
.project-card:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow); }
.project-card-featured { grid-column: span 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); }
.project-visual { min-height: 230px; position: relative; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.project-card-featured .project-visual { min-height: 330px; border-right: 1px solid var(--border); border-bottom: 0; }
.visual-label { position: absolute; right: 15px; bottom: 13px; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: 0.15em; }
.project-body { padding: 23px 24px 24px; display: flex; flex-direction: column; align-items: flex-start; }
.project-meta { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 15px; }
.project-type { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: 0.13em; }
.status-tag { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 9px; font-weight: 650; }
.status-progress { color: var(--good); }
.status-progress > span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-awarded { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 30%, transparent); }
.project-body h3 { margin: 0 0 11px; font-size: 19px; line-height: 1.35; letter-spacing: -0.035em; font-weight: 680; }
.project-body p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.85; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 19px; }
.tag-list span { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--text-soft); font-size: 9px; }
.project-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: auto; padding-top: 20px; }
.link-muted { color: var(--faint); font-size: 10px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; padding: 0; color: var(--accent); border: 0; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.text-link:disabled { color: var(--faint); cursor: not-allowed; }
.poster-missing-note { display: block; width: 100%; font-size: 10px; }
.poster-missing-note:empty { display: none; }
.section-footnote { display: flex; align-items: flex-start; gap: 10px; margin: 23px 0 0; color: var(--muted); font-size: 11px; }
.section-footnote > span { color: var(--accent); }

/* Decorative project visuals are CSS illustrations, not claims about a live product UI. */
.project-visual-store { background: radial-gradient(ellipse at 50% 38%, rgba(78, 105, 218, 0.19), transparent 58%), var(--bg-soft); }
.store-screen { width: min(78%, 335px); min-height: 232px; border: 1px solid rgba(160, 180, 255, 0.3); border-radius: 12px; background: #111b33; box-shadow: 0 25px 45px rgba(0,0,0,0.28); transform: rotate(-3deg); color: #edf2ff; overflow: hidden; }
.mini-screen-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 15px; border-bottom: 1px solid rgba(190,205,255,0.12); font-size: 8px; letter-spacing: 0.03em; }
.mini-brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 750; }
.mini-brand-icon { width: 21px; height: 21px; display: inline-grid; place-items: center; border-radius: 6px; color: #0e1530; background: #87adff; font-size: 11px; }
.mini-menu-lines { color: #8fa1cc; font-size: 17px; }
.mini-screen-content { padding: 20px 19px; }
.mini-pill { display: inline-block; color: #a9c2ff; border: 1px solid rgba(137,167,255,0.3); border-radius: 5px; padding: 4px 7px; font-size: 7px; letter-spacing: 0.12em; }
.mini-screen-content strong { display: block; margin-top: 13px; font-size: 23px; line-height: 1.07; letter-spacing: -0.04em; }
.mini-product-row { display: flex; gap: 7px; margin-top: 17px; }
.mini-product-row i { display: block; flex: 1; height: 27px; border-radius: 5px; border: 1px solid rgba(160,180,255,0.17); background: linear-gradient(135deg, rgba(109,141,236,0.15), rgba(133,115,224,0.04)); }
.mini-button { display: block; width: 62px; height: 5px; margin-top: 12px; border-radius: 9px; background: #86aaff; }
.project-visual-poster { aspect-ratio: 4 / 3; padding: 24px; background: linear-gradient(135deg, #202c47, #12192b 74%); }
.poster-fallback { width: min(56%, 180px); min-height: 185px; aspect-ratio: 3 / 4; padding: 14px 12px; position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: #f6f1df; background: #5a80b9; border: 1px solid rgba(255,255,255,0.28); box-shadow: 0 18px 36px rgba(0,0,0,0.28); transform: rotate(3deg); }
.poster-fallback::before, .poster-fallback::after { content: ""; position: absolute; border: 1px solid rgba(246,241,223,0.35); border-radius: 50%; width: 160px; height: 160px; right: -80px; top: 20px; }
.poster-fallback::after { width: 112px; height: 112px; right: -56px; top: 44px; }
.poster-fallback-mark { position: relative; z-index: 1; font-size: 8px; letter-spacing: 0.1em; }
.poster-fallback-overline { font-size: 6px; letter-spacing: 0.12em; }
.poster-fallback strong { display: block; position: relative; z-index: 1; margin-top: 8px; font-size: clamp(13px, 2vw, 20px); line-height: 1.07; letter-spacing: -0.05em; }
.poster-fallback p { position: relative; z-index: 1; margin: 7px 0 0; font-size: 8px; line-height: 1.4; color: #eef3ff; }
.poster-fallback-foot { font-size: 5px; line-height: 1.4; letter-spacing: 0.07em; }
.poster-image { visibility: hidden; opacity: 0; transition: opacity 240ms ease; position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: contain; padding: 16px; background: #101626; }
.poster-image.is-loaded { visibility: visible; opacity: 1; }
.poster-fallback.is-hidden { display: none; }
.project-visual-lab { background: radial-gradient(ellipse at 50% 45%, rgba(99, 137, 240, 0.2), transparent 60%), var(--bg-soft); }
.lab-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 20px 20px; mask-image: radial-gradient(ellipse, black, transparent 78%); }
.lab-browser { position: relative; width: 71%; aspect-ratio: 1.4; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; transform: rotate(3deg); }
.lab-browser-top { height: 25px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 4px; padding: 0 8px; }
.lab-browser-top i { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.lab-browser-top span { margin-left: 5px; font-size: 7px; color: var(--muted); }
.lab-browser-lines { position: absolute; left: 13px; top: 45px; display: grid; gap: 7px; width: 45%; }
.lab-browser-lines b { height: 4px; border-radius: 5px; background: var(--border-strong); }
.lab-browser-lines b:nth-child(2) { width: 70%; background: color-mix(in srgb, var(--accent) 65%, transparent); }
.lab-browser-lines b:nth-child(3) { width: 89%; }
.lab-browser-lines b:nth-child(4) { width: 53%; background: color-mix(in srgb, var(--accent-strong) 55%, transparent); }
.lab-browser-lines b:nth-child(5) { width: 75%; }
.lab-sphere { position: absolute; right: 14%; top: 31%; width: 29%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 32% 27%, #b8c8ff, #657fe0 34%, #3b4c8c 66%, #1c2449); box-shadow: 0 0 30px rgba(111,137,255,0.24); }
.lab-cursor { position: absolute; right: 10%; bottom: 13%; color: var(--accent); font-size: 21px; }

/* Skills */
.section-skills { background: color-mix(in srgb, var(--bg-soft) 55%, transparent); border-block: 1px solid var(--border); }
.section-skills .section-heading { max-width: 580px; }
.section-skills .section-intro { max-width: 450px; }
.skills-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 43px; }
.skill-panel { display: flex; flex-direction: column; min-width: 0; min-height: 310px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.skill-panel-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 24px; }
.skill-icon { display: inline-grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.skill-icon-used { color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); }
.skill-icon-next { color: var(--muted); background: var(--bg-soft); }
.skill-panel h3 { margin: 0 0 5px; font-size: 15px; letter-spacing: -0.025em; }
.skill-panel-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.skill-list { display: flex; align-content: flex-start; flex-wrap: wrap; gap: 7px; }
.skill-list span { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--text-soft); font-size: 10px; line-height: 1.35; }
.skill-list-muted span { color: var(--muted); }
.skill-panel-note { margin: auto 0 0; padding-top: 23px; color: var(--faint); font-size: 10px; line-height: 1.6; }

/* Photography and videography */
.section-visual { overflow: hidden; }
.section-visual .section-heading-row { align-items: end; }
.gallery-tabs { display: flex; gap: 6px; width: fit-content; max-width: 100%; padding: 5px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 24px; }
.gallery-tab { min-height: 40px; display: inline-flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.gallery-tab.is-active { color: var(--text); border-color: var(--border); background: var(--surface-raised); }
.tab-count { min-width: 21px; height: 21px; display: inline-grid; place-items: center; padding-inline: 5px; border-radius: 6px; background: var(--bg-soft); color: var(--muted); font-size: 10px; }
.gallery-panel { min-height: 205px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gallery-card { min-width: 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.gallery-media { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.gallery-media img, .gallery-media video { display: block; width: 100%; max-height: 380px; object-fit: contain; background: #070b15; }
.gallery-media button.gallery-image-button { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.gallery-media button.gallery-image-button img { height: auto; max-height: 380px; margin-inline: auto; }
.gallery-video-fallback { min-height: 190px; display: grid; place-items: center; color: var(--muted); }
.gallery-video-fallback span { width: 45px; height: 45px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--accent); font-size: 18px; }
.gallery-card-body { padding: 16px; }
.gallery-category { display: block; color: var(--accent); font-size: 9px; font-weight: 750; letter-spacing: 0.12em; margin-bottom: 7px; }
.gallery-card h3 { margin: 0 0 7px; font-size: 15px; line-height: 1.35; }
.gallery-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.gallery-details { margin-top: 12px !important; color: var(--faint) !important; font-size: 10px !important; }
.gallery-watch { display: inline-flex; margin-top: 13px; color: var(--accent); font-size: 11px; font-weight: 700; }
.gallery-empty { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 22px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); text-align: center; }
.empty-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--accent); border: 1px solid var(--border); border-radius: 12px; font-size: 22px; background: var(--surface); }
.gallery-empty h3 { margin: 16px 0 7px; font-size: 15px; font-weight: 650; }
.gallery-empty p { max-width: 470px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.gallery-empty code, .contact-config-hint code { color: var(--accent); font-size: 0.95em; }
.gallery-guidance { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; color: var(--muted); font-size: 10px; }
.guidance-mark { display: inline-grid; flex: 0 0 auto; width: 17px; height: 17px; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; font-size: 10px; }

/* Achievements */
.section-achievements { border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg-soft) 62%, transparent); }
.achievement-layout { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(34px, 8vw, 110px); }
.achievement-layout .section-intro { max-width: 350px; }
.achievement-list { min-width: 0; }
.achievement-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) 42px; gap: 18px; align-items: start; padding: 25px 0 30px; border-bottom: 1px solid var(--border); }
.achievement-number { color: var(--faint); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; padding-top: 5px; }
.achievement-label { margin: 0 0 9px; color: var(--accent); font-size: 9px; font-weight: 750; letter-spacing: 0.13em; }
.achievement-content h3 { margin: 0 0 9px; font-size: 19px; line-height: 1.4; letter-spacing: -0.035em; }
.achievement-content p:last-child { max-width: 480px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.achievement-mark { width: 40px; height: 40px; display: flex; justify-content: center; align-items: center; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 12px; color: var(--gold); font-size: 21px; font-weight: 750; }
.achievement-mark span { font-size: 8px; align-self: flex-start; padding-top: 7px; }
.achievement-future { display: flex; align-items: flex-start; gap: 14px; padding-top: 25px; color: var(--muted); }
.achievement-future > span { display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 auto; border: 1px dashed var(--border-strong); border-radius: 9px; font-size: 18px; }
.achievement-future strong { display: block; color: var(--text-soft); font-size: 12px; }
.achievement-future p { margin: 4px 0 0; font-size: 11px; }

/* Contact and footer */
.section-contact { padding-top: 105px; padding-bottom: 105px; }
.contact-panel { min-height: 330px; position: relative; overflow: hidden; padding: clamp(28px, 5.5vw, 62px); display: flex; justify-content: space-between; gap: 30px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.contact-pattern { position: absolute; width: 420px; height: 420px; right: -70px; top: -140px; border: 1px solid var(--border); border-radius: 50%; pointer-events: none; }
.contact-pattern::before, .contact-pattern::after { content: ""; position: absolute; inset: 35px; border: 1px solid var(--border); border-radius: 50%; }
.contact-pattern::after { inset: 85px; border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.contact-content { position: relative; z-index: 1; max-width: 590px; }
.contact-content .eyebrow { margin-bottom: 17px; }
.contact-content h2 { font-size: clamp(2.4rem, 5.3vw, 4.1rem); line-height: 1.04; letter-spacing: -0.07em; margin: 0; }
.contact-content > p:not(.eyebrow) { max-width: 500px; margin: 22px 0 0; color: var(--muted); font-size: 13px; }
.contact-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.contact-link { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--bg-soft); font-size: 11px; font-weight: 650; transition: border-color 160ms ease; }
.contact-link:hover { border-color: var(--accent); }
.contact-link-arrow { color: var(--accent); }
.contact-config-hint { color: var(--faint) !important; font-size: 10px !important; margin-top: 13px !important; }
.contact-side-note { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 10px; align-self: flex-end; white-space: nowrap; color: var(--muted); font-size: 10px; }
.contact-side-line { width: 24px; height: 1px; margin-bottom: 9px; background: var(--accent); }
.site-footer { border-top: 1px solid var(--border); }
.footer-inner { min-height: 100px; display: flex; align-items: center; gap: 25px; }
.footer-brand .brand-mark { width: 30px; height: 30px; font-size: 17px; }
.footer-brand .brand-name { font-size: 14px; }
.footer-inner > p { color: var(--faint); font-size: 10px; margin: 0; }
.footer-right { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.footer-right nav { display: flex; align-items: center; gap: 17px; }
.footer-right nav a { color: var(--muted); font-size: 10px; }
.footer-right nav a:hover { color: var(--text); }
.copyright { color: var(--faint); font-size: 10px; white-space: nowrap; }

/* Personal journey blog — follows the existing surface, border and accent system. */
.section-journey { position: relative; }
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.blog-card { min-width: 0; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease; }
.blog-card:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow); }
.blog-card-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.blog-card-cover-placeholder { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; color: var(--accent); background: radial-gradient(ellipse at 50% 38%, var(--accent-soft), transparent 70%), var(--bg-soft); border-bottom: 1px solid var(--border); font-size: 36px; }
.blog-card-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 21px; }
.blog-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 13px; }
.blog-category { display: inline-flex; align-items: center; color: var(--accent); font-size: 9px; font-weight: 780; letter-spacing: .12em; text-transform: uppercase; }
.blog-date { margin: 0; color: var(--faint); font-size: 10px; }
.blog-card h3 { margin: 0 0 10px; font-size: 18px; line-height: 1.35; letter-spacing: -.035em; }
.blog-card-summary { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.85; }
.blog-card-open { display: inline-flex; align-items: center; gap: 7px; margin-top: auto; padding: 19px 0 0; border: 0; color: var(--text); background: transparent; font: inherit; font-size: 11px; font-weight: 720; cursor: pointer; text-align: left; }
.blog-card-open span { color: var(--accent); transition: transform 160ms ease; }
.blog-card-open:hover span { transform: translate(3px, -2px); }
.blog-empty { min-height: 210px; display: grid; justify-items: center; align-content: center; padding: 32px 22px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--bg-soft); text-align: center; }
.blog-empty[hidden], .blog-article-view[hidden], .featured-video-player[hidden], .featured-video-placeholder[hidden], .blog-article-cover[hidden], .blog-date[hidden] { display: none !important; }
.blog-empty .empty-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; margin-bottom: 9px; border: 1px solid var(--border); border-radius: 13px; color: var(--accent); background: var(--surface); font-size: 21px; }
.blog-empty h3 { margin: 0; font-size: 16px; letter-spacing: -.025em; }
.blog-empty p { max-width: 510px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.blog-empty code, .featured-video-copy code { color: var(--text-soft); font-size: .95em; }
.blog-article-view { max-width: 790px; margin-inline: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); padding: clamp(20px, 4vw, 42px); }
.blog-back-button { min-height: 40px; padding: 6px 0; border: 0; background: transparent; cursor: pointer; }
.blog-article-header { padding: 27px 0 20px; }
.blog-article-header h3 { margin: 11px 0 12px; font-size: clamp(1.8rem, 4.5vw, 2.8rem); line-height: 1.12; letter-spacing: -.06em; overflow-wrap: anywhere; }
.blog-article-header > p:last-child { margin: 0; max-width: 650px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.blog-article-cover { display: block; width: 100%; max-height: 540px; margin: 0 0 26px; border: 1px solid var(--border); border-radius: 13px; object-fit: contain; background: var(--bg-soft); }
.blog-article-content { max-width: 680px; margin-inline: auto; color: var(--text-soft); font-size: 15px; line-height: 1.95; overflow-wrap: anywhere; }
.blog-article-content p { margin: 0 0 1.25em; }
.blog-article-content h4 { margin: 1.8em 0 .55em; color: var(--text); font-size: 1.25rem; line-height: 1.4; letter-spacing: -.025em; }
.blog-article-content blockquote { margin: 1.5em 0; padding: 5px 0 5px 18px; border-left: 2px solid var(--accent); color: var(--text); }
.blog-article-content ul { padding-left: 1.35em; margin: 0 0 1.3em; }
.blog-article-content li + li { margin-top: .4em; }
.blog-back-bottom { margin-top: 20px; }

/* One featured HTML5 MP4 video. Empty state remains visible until a direct URL is set. */
.featured-video-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(230px, .65fr); gap: 26px; align-items: start; }
.featured-video-frame { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: #070b15; box-shadow: var(--shadow); }
.featured-video-player { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 72vh; background: #05070d; object-fit: contain; }
.featured-video-placeholder { width: 100%; min-width: 0; min-height: 220px; aspect-ratio: 16 / 9; display: grid; justify-items: center; align-content: center; padding: 28px; color: #dce5fb; text-align: center; background: radial-gradient(ellipse at 50% 35%, rgba(128, 168, 255, .16), transparent 68%), #080d19; }
.video-placeholder-icon { display: grid; place-items: center; width: 51px; height: 51px; margin-bottom: 14px; padding-left: 3px; border: 1px solid rgba(165, 184, 220, .3); border-radius: 50%; color: #a9c0ff; font-size: 19px; }
.featured-video-placeholder p, .video-placeholder-note { max-width: 100%; overflow-wrap: anywhere; }
.featured-video-placeholder h3 { margin: 0; font-size: 16px; }
.featured-video-placeholder p { margin: 8px 0 0; color: #98a7c4; font-size: 12px; line-height: 1.7; }
.featured-video-placeholder code { color: #dce5fb; font-size: 11px; }
.video-placeholder-note { display: block; margin-top: 12px; color: #7788a9; font-size: 10px; }
.featured-video-copy { padding-top: 9px; }
.featured-video-copy > .eyebrow { margin-bottom: 12px; }
.featured-video-copy h3 { margin: 0; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -.045em; }
.featured-video-copy > p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.9; }
.featured-video-note { display: flex; gap: 9px; align-items: flex-start; padding-top: 14px; border-top: 1px solid var(--border); font-size: 11px !important; }
.featured-video-note span { display: inline-grid; flex: 0 0 19px; place-items: center; width: 19px; height: 19px; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--accent); font-size: 10px; }

/* Audio control is in normal document flow, so it never covers navigation/video controls. */
.section-bgm { padding: 8px 0 12px; }
.bgm-player { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 22px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.bgm-track-info { min-width: 0; display: flex; align-items: center; gap: 14px; }
.bgm-icon { display: grid; flex: 0 0 42px; place-items: center; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 13px; color: var(--accent); background: var(--bg-soft); font-size: 22px; }
.bgm-track-copy { min-width: 0; display: grid; gap: 2px; }
.bgm-eyebrow { margin: 0; color: var(--faint); font-size: 9px; font-weight: 780; letter-spacing: .12em; }
.bgm-track-copy strong { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.bgm-status { color: var(--muted); font-size: 10px; line-height: 1.55; }
.bgm-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 18px; }
.bgm-toggle { min-height: 42px; padding-inline: 15px; font-size: 11px; }
.bgm-toggle:disabled { opacity: .55; cursor: not-allowed; }
.bgm-volume-label { display: grid; gap: 3px; color: var(--muted); font-size: 10px; }
.bgm-volume-label input { width: 104px; max-width: 100%; accent-color: var(--accent); cursor: pointer; }
.bgm-volume-label input:disabled { cursor: not-allowed; }

/* Image preview dialog */
.lightbox { width: min(94vw, 1100px); max-width: 1100px; max-height: 92vh; padding: 18px; border: 1px solid var(--border-strong); border-radius: 16px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.lightbox::backdrop { background: rgba(3, 7, 17, 0.86); backdrop-filter: blur(6px); }
.lightbox-close-form { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.lightbox-close { font-size: 25px; line-height: 1; }
.lightbox > img { max-height: calc(92vh - 100px); width: auto; height: auto; object-fit: contain; margin: 0 auto; }
.lightbox > p { color: var(--muted); text-align: center; font-size: 11px; margin: 10px 0 0; }
.noscript-note { margin: 0; padding: 12px 20px; background: var(--surface-raised); color: var(--text-soft); font-size: 12px; text-align: center; }

/* Reveal-on-scroll is enabled only when motion is allowed and JS support is ready. */
.motion-ready .reveal { opacity: 0; transform: translateY(14px); transition: opacity 520ms ease, transform 520ms ease; }
.motion-ready .reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  :root { --header-height: 70px; }
  .site-nav { gap: 13px; }
  .site-nav a { font-size: 11px; }
  .header-inner { gap: 15px; }
  .hero { padding-top: 65px; }
  .hero-grid { gap: 25px; }
  .hero h1 { font-size: clamp(3.1rem, 7vw, 4.8rem); }
  .hero-art { min-height: 370px; }
  .orbit-one { width: 335px; }
  .orbit-two { width: 300px; }
  .chip-top { right: -5px; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .skill-panel:last-child { grid-column: span 2; min-height: auto; }
  .skill-panel:last-child .skill-panel-note { margin-top: 18px; }
  .contact-side-note { display: none; }
  .footer-inner { flex-wrap: wrap; padding-block: 22px; }
  .footer-right { gap: 14px; }
}

@media (min-width: 761px) and (max-width: 900px) {
  .site-nav { gap: 8px; }
  .site-nav a { font-size: 10px; }
  .header-inner { gap: 9px; }
  .brand-name { font-size: 15px; }
}

@media (max-width: 760px) {
  :root { --header-height: 66px; }
  .container { width: min(var(--content), calc(100% - 36px)); }
  .section { padding-block: 78px; }
  .header-inner { gap: 10px; }
  .brand { gap: 8px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand-name { font-size: 16px; }
  .menu-toggle { display: inline-grid; margin-left: auto; order: 2; }
  .theme-toggle { order: 3; }
  .site-nav { position: absolute; top: calc(100% + 1px); left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 8px 18px 15px; border-bottom: 1px solid var(--border); background: var(--surface-glass); backdrop-filter: blur(18px); }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 11px 5px; border-bottom: 1px solid var(--border); font-size: 13px; }
  .site-nav a:last-child { border-bottom: 0; }
  .hero { padding-top: 62px; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero h1 { font-size: clamp(3.35rem, 13vw, 5rem); }
  .hero-description { font-size: 14px; line-height: 1.8; }
  .hero-art { min-height: 350px; margin-top: 8px; }
  .code-window { max-width: 360px; }
  .orbit-one { width: min(90%, 350px); }
  .orbit-two { width: min(84%, 315px); }
  .chip-top { top: 27px; right: 1%; }
  .chip-bottom { bottom: 27px; left: 0; }
  .cross-one { left: 10%; top: 10px; }
  .hero-bottom { margin-top: 24px; }
  .about-layout { grid-template-columns: 1fr; gap: 25px; }
  .section-heading-row { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 30px; }
  .section-heading-row .section-intro { margin: 0; }
  .project-grid { grid-template-columns: 1fr; gap: 14px; }
  .project-card-featured { grid-column: auto; grid-template-columns: 1fr; }
  .project-card-featured .project-visual { min-height: 280px; border-right: 0; border-bottom: 1px solid var(--border); }
  .project-visual { min-height: 225px; }
  .project-body { padding: 20px; }
  .project-body h3 { font-size: 18px; }
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured-video-layout { grid-template-columns: 1fr; gap: 16px; }
  .featured-video-copy { padding-top: 0; }
  .bgm-player { align-items: flex-start; flex-direction: column; gap: 14px; padding: 17px; }
  .bgm-controls { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .skills-grid { grid-template-columns: 1fr; gap: 12px; }
  .skill-panel, .skill-panel:last-child { grid-column: auto; min-height: auto; padding: 20px; }
  .skill-panel-note { padding-top: 20px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gallery-card-body { padding: 12px; }
  .gallery-card h3 { font-size: 13px; }
  .gallery-empty { min-height: 210px; }
  .achievement-layout { grid-template-columns: 1fr; gap: 22px; }
  .contact-panel { padding: 28px 23px; min-height: auto; }
  .contact-pattern { right: -275px; top: -100px; }
  .contact-content h2 { font-size: clamp(2.65rem, 11vw, 3.8rem); }
  .footer-inner { gap: 12px 20px; }
  .footer-inner > p { order: 3; width: 100%; }
  .footer-right { width: 100%; margin-left: 0; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
  .footer-right nav { gap: 13px; flex-wrap: wrap; }
}

@media (max-width: 390px) {
  .container { width: calc(100% - 28px); }
  .hero-copy .eyebrow { letter-spacing: 0.1em; font-size: 9px; }
  .hero h1 { font-size: 3.05rem; }
  .hero-art { min-height: 315px; }
  .code-window { width: 97%; }
  .code-content { padding-inline: 9px; font-size: 10px; }
  .chip-top { right: -2px; }
  .floating-chip { padding: 8px; }
  .chip-symbol { width: 23px; height: 23px; }
  .project-meta { align-items: flex-start; flex-direction: column; }
  .gallery-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-card-body { padding: 18px; }
  .blog-article-view { padding: 18px; }
  .featured-video-placeholder { min-height: 205px; padding: 20px 15px; }
  .bgm-controls { gap: 12px; }
  .bgm-volume-label { margin-left: auto; }
  .bgm-volume-label input { width: 100px; }
  .gallery-tabs { width: 100%; }
  .gallery-tab { flex: 1; justify-content: center; padding-inline: 7px; }
  .achievement-item { grid-template-columns: 25px minmax(0, 1fr) 35px; gap: 10px; }
  .achievement-mark { width: 35px; height: 35px; }
  .contact-content h2 { font-size: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
