:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #eef2f7;
  --text: #0f172a;
  --muted: #5b6b80;
  --muted-2: #8392a7;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #ff9900;
  --accent-strong: #c46f00;
  --accent-soft: #fff4df;
  --navy: #232f3e;
  --on-navy: #ffffff;
  --success: #128a5f;
  --danger: #dc4c64;
  --shadow: 0 18px 55px rgba(15, 23, 42, .08);
  --shadow-lg: 0 28px 90px rgba(15, 23, 42, .18);
  --radius: 22px;
  --max: 1160px;
  --header: rgba(247, 249, 252, .86);
  --overlay: rgba(15, 23, 42, .56);
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111a2b;
  --surface-2: #162136;
  --surface-3: #1b2940;
  --text: #f8fafc;
  --muted: #a7b4c8;
  --muted-2: #7f8da3;
  --line: #27364d;
  --line-strong: #38506f;
  --accent: #ffad2f;
  --accent-strong: #ffad2f;
  --accent-soft: rgba(255, 153, 0, .11);
  --navy: #dbe8f7;
  --on-navy: #0b1220;
  --success: #55d6a4;
  --danger: #ff7f91;
  --shadow: 0 18px 55px rgba(0, 0, 0, .22);
  --shadow-lg: 0 30px 100px rgba(0, 0, 0, .42);
  --header: rgba(11, 18, 32, .83);
  --overlay: rgba(0, 0, 0, .68);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.68;
  word-break: keep-all;
  overflow-wrap: anywhere;
  transition: background-color .2s ease, color .2s ease;
}
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 10px; }
.hidden { display: none !important; }
ul.skills, ul.project-tags, .flow-nodes { list-style: none; margin: 0; padding: 0; }
.muted { color: var(--muted); }
.container { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  padding: 10px 14px; border-radius: 10px;
  background: var(--navy); color: var(--on-navy); font-weight: 800;
}
.skip-link:focus { top: 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: var(--header);
  backdrop-filter: blur(18px);
}
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 900; letter-spacing: -.025em; }
.brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
  background: var(--navy); color: var(--on-navy); font-size: 12px;
  box-shadow: inset 0 -3px 0 var(--accent);
}
.nav-right, .nav-links { display: flex; align-items: center; gap: 7px; }
.nav-links a { color: var(--muted); padding: 8px 10px; border-radius: 10px; font-size: 14px; font-weight: 650; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-2); }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface); min-height: 38px; border-radius: 11px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 11px; font-weight: 750; font-size: 13px; box-shadow: 0 6px 18px rgba(15,23,42,.03);
}
.icon-btn:hover { border-color: var(--line-strong); }
.menu-btn { display: none; width: 38px; padding: 0; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  display: block; width: 16px; height: 2px; border-radius: 2px; background: currentColor; position: relative; transition: transform .18s ease;
}
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -5px; }
.menu-btn span::after { top: 5px; }
.menu-btn[aria-expanded="true"] span { background: transparent; }
.menu-btn[aria-expanded="true"] span::before { transform: translateY(5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span::after { transform: translateY(-5px) rotate(-45deg); }

/* Shared */
section { padding: 76px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.section-head h2 { margin: 0; font-size: clamp(30px, 4vw, 42px); letter-spacing: -.045em; line-height: 1.13; }
.section-head p { max-width: 520px; margin: 7px 0 0; color: var(--muted); }
.eyebrow { color: var(--accent-strong); font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.card { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.chip, .mini-badge {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px;
  color: var(--muted); font-size: 12px; font-weight: 750; padding: 6px 9px; line-height: 1.3;
}
.mini-badge.accent { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); color: var(--accent-strong); }
.mini-badge.live { border-color: color-mix(in srgb, var(--success) 35%, var(--line)); background: color-mix(in srgb, var(--success) 10%, var(--surface)); color: var(--success); }
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 12px;
  padding: 11px 16px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; background: var(--navy); color: var(--on-navy); font-weight: 850;
  transition: transform .18s ease, filter .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn.accent { background: var(--accent); color: #2a1a00; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.danger { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent); }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; padding: 20px; text-align: center; }
.notice {
  padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--accent-soft); border-radius: 14px;
  color: color-mix(in srgb, var(--accent-strong) 60%, var(--text)); font-size: 13px;
}
.preview-banner { position: sticky; top: 0; z-index: 60; border-radius: 0; text-align: center; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 92px 0 64px; border-bottom: 1px solid var(--line); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.58), transparent 78%);
  opacity: .48;
}
.hero::after {
  content: ""; position: absolute; width: 480px; height: 480px; border-radius: 999px;
  right: -190px; top: -150px; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 21%, transparent), transparent 67%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.35fr .65fr; gap: 60px; align-items: center; }
.hero-kicker { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.hero h1 { margin: 0; font-size: clamp(44px, 6.2vw, 78px); line-height: 1.08; letter-spacing: -.06em; max-width: 860px; }
.hero h1 .accent-line { display: block; margin-top: 7px; color: var(--accent-strong); }
.hero-desc { color: var(--muted); font-size: clamp(16px, 1.7vw, 19px); max-width: 720px; margin: 25px 0 0; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.hero-side { display: grid; gap: 14px; }
.profile-card { padding: 14px; }
.profile-photo, .photo-placeholder {
  width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 17px;
  background: linear-gradient(145deg, var(--surface-2), var(--surface-3)); border: 1px solid var(--line);
}
.profile-photo { object-fit: cover; object-position: 50% 22%; }
.photo-placeholder { display: grid; place-items: center; font-size: 58px; font-weight: 950; color: var(--navy); letter-spacing: -.06em; }
.contact-mini { padding: 10px 4px 2px; display: grid; gap: 6px; }
.contact-mini strong { font-size: 16px; letter-spacing: -.02em; }
.contact-mini a { color: var(--muted); font-size: 13px; word-break: break-all; }
.contact-mini a:hover { color: var(--accent-strong); }
.cloud-note { padding: 18px; position: relative; overflow: hidden; }
.cloud-note::after { content: "AWS"; position: absolute; right: 13px; bottom: -16px; font-size: 62px; font-weight: 950; color: color-mix(in srgb, var(--line) 58%, transparent); letter-spacing: -.08em; pointer-events: none; }
.cloud-note strong { display: block; font-size: 14px; margin-bottom: 5px; position: relative; z-index: 1; }
.cloud-note span { color: var(--muted); font-size: 12px; position: relative; z-index: 1; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }
.about-card { padding: 30px; font-size: clamp(17px, 2vw, 21px); letter-spacing: -.015em; }
.about-card p { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { padding: 20px; }
.stat b { display: block; font-size: 28px; letter-spacing: -.04em; }
.stat span { color: var(--muted); font-size: 12px; }

/* Skills */
.skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.skill-group { padding: 24px; }
.skill-group-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 16px; }
.skill-group h3 { margin: 0; font-size: 18px; }
.skill-group p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.skill-group-head .mini-badge { flex-shrink: 0; }
.skills { display: flex; gap: 8px; flex-wrap: wrap; }
.skill-group.cloud { border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.skill-group.cloud .chip { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 24%, var(--line)); color: color-mix(in srgb, var(--accent-strong) 76%, var(--text)); }

/* Timeline */
.timeline { position: relative; display: grid; gap: 14px; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 20px; bottom: 20px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding: 21px 22px 21px 48px; display: grid; grid-template-columns: 170px 1fr; gap: 22px; }
.timeline-item::before { content: ""; position: absolute; left: 12px; top: 28px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); z-index: 1; }
.timeline-date { color: var(--accent-strong); font-weight: 900; font-size: 13px; }
.timeline-item h3 { margin: 0 0 2px; font-size: 18px; }
.timeline-item p { margin: 0; color: var(--muted); font-size: 14px; }

/* Projects */
.project-group + .project-group { margin-top: 46px; }
.project-group-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.project-group-head h3 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.project-group-head p { margin: 5px 0 0; color: var(--muted); }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.project-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 370px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.project-card:hover, .project-card:focus-within { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 24px 64px rgba(15,23,42,.11); }
.project-card.is-featured { border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.project-image-wrap { position: relative; height: 190px; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.project-image-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.project-image-placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(145deg, var(--surface-2), var(--surface-3)); }
.project-image-placeholder span { color: var(--muted-2); font-size: 13px; font-weight: 800; }
.project-category { position: absolute; top: 13px; left: 13px; display: flex; gap: 6px; flex-wrap: wrap; }
.project-category .mini-badge { background: var(--surface); box-shadow: 0 4px 14px rgba(15,23,42,.12); }
.project-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.project-title-row { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.project-card h3 { margin: 0; font-size: 22px; letter-spacing: -.035em; line-height: 1.3; }
.project-card p { color: var(--muted); margin: 11px 0 18px; }
.project-tags { display: flex; gap: 7px; flex-wrap: wrap; }
.project-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: auto; padding-top: 18px; }
.project-date { color: var(--muted-2); font-size: 12px; }
.project-open { background: transparent; border: 0; color: var(--accent-strong); cursor: pointer; font-weight: 900; padding: 6px 0; }
.project-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.project-open:focus-visible { box-shadow: none; }
.project-open:focus-visible::after { box-shadow: inset var(--focus); }
.project-card:hover .project-open { text-decoration: underline; text-underline-offset: 4px; }
.project-links { position: relative; z-index: 1; display: flex; gap: 12px; }
.project-links a { color: var(--muted); font-size: 12px; font-weight: 800; }
.project-links a:hover { color: var(--accent-strong); }
.highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.highlights li { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.highlights b { display: block; font-size: 18px; line-height: 1.25; letter-spacing: -.03em; color: var(--accent-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.highlights span { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.modal-hero .highlights { margin: 18px 0 0; }
.modal-hero .highlights b { font-size: 20px; }

/* Credentials */
.cert-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cert-card { padding: 24px; display: flex; gap: 16px; align-items: start; }
.cert-icon { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-weight: 950; font-size: 13px; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
.cert-card h3 { margin: 0 0 4px; font-size: 18px; }
.cert-card p { margin: 0; color: var(--muted); font-size: 13px; }
.cert-card a { display: inline-block; margin-top: 8px; color: var(--accent-strong); font-size: 13px; font-weight: 800; }
.achievements { margin-top: 30px; padding: 18px 20px; box-shadow: none; }
.achievement-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 10px; }
.achievement-head strong { font-size: 14px; }
.achievement-list { display: flex; gap: 8px; flex-wrap: wrap; }
.achievement-item { color: var(--muted); font-size: 13px; border-right: 1px solid var(--line); padding-right: 10px; }
.achievement-item:last-child { border-right: 0; }

/* Contact */
.contact-card {
  position: relative; overflow: hidden; padding: clamp(28px, 5vw, 48px);
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 30px; align-items: center;
}
.contact-card::after {
  content: ""; position: absolute; width: 360px; height: 360px; border-radius: 999px; right: -140px; bottom: -180px; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), transparent 67%);
}
.contact-card h2 { margin: 6px 0 10px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.045em; line-height: 1.18; }
.contact-card p { margin: 0; color: var(--muted); }
.contact-actions { position: relative; z-index: 1; display: grid; gap: 10px; }
.contact-actions .btn { justify-content: space-between; }
.copy-status { min-height: 18px; color: var(--success); font-size: 12px; font-weight: 750; }

footer { border-top: 1px solid var(--line); margin-top: 24px; padding: 34px 0 52px; color: var(--muted); font-size: 13px; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-row nav { display: flex; gap: 14px; }
.footer-row a:hover { color: var(--accent-strong); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; background: var(--overlay); backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 24px;
  opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s;
}
.modal-backdrop.open { opacity: 1; visibility: visible; transition: opacity .18s ease, visibility 0s; }
.project-modal {
  width: min(980px, 100%); max-height: 88vh; overflow: auto; border-radius: 26px;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(.985); transition: transform .18s ease;
}
.modal-backdrop.open .project-modal { transform: translateY(0) scale(1); }
.modal-top {
  position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 16px 18px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.modal-top-badges { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.modal-close { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: 18px; flex-shrink: 0; }
.modal-body { padding: 28px; }
.modal-hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; align-items: start; }
.modal-hero h2 { margin: 8px 0 12px; font-size: clamp(30px, 5vw, 48px); line-height: 1.1; letter-spacing: -.05em; }
.modal-summary { color: var(--muted); font-size: 17px; margin: 0; }
.modal-hero .project-tags { margin-top: 16px; }
.modal-facts { padding: 18px; border-radius: 17px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 12px; }
.fact { display: grid; grid-template-columns: 70px 1fr; gap: 10px; font-size: 13px; }
.fact span:first-child { color: var(--muted-2); font-weight: 800; }
.modal-cover { margin-top: 22px; width: 100%; max-height: 420px; object-fit: cover; object-position: top; border-radius: 18px; border: 1px solid var(--line); }
.modal-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 26px 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.modal-tab { appearance: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); padding: 9px 12px; border-radius: 10px; cursor: pointer; font-weight: 800; font-size: 13px; }
.modal-tab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.tab-panel:focus-visible { box-shadow: none; }
.case-section { padding: 22px 0; border-bottom: 1px solid var(--line); }
.case-section:first-child { padding-top: 4px; }
.case-section:last-child { border-bottom: 0; }
.case-section h3 { margin: 5px 0 10px; font-size: 20px; letter-spacing: -.025em; }
.case-section p { margin: 0; color: var(--muted); }
.case-label { display: inline-block; color: var(--accent-strong); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.flows { display: grid; gap: 12px; margin: 14px 0 18px; }
.flow { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.flow-label { font-size: 12px; font-weight: 900; color: var(--text); padding-top: 6px; }
.flow-nodes { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.flow-nodes li { display: inline-flex; align-items: center; gap: 6px; }
.flow-nodes li + li::before { content: "→"; color: var(--muted-2); font-weight: 900; }
.service { padding: 7px 10px; border-radius: 9px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); color: color-mix(in srgb, var(--accent-strong) 78%, var(--text)); font-size: 12px; font-weight: 850; }
.modal-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 22px; }

/* Gallery + viewer */
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.gallery-item { appearance: none; padding: 0; text-align: left; margin: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; transition: transform .18s ease, border-color .18s ease; }
.gallery-item img { width: 100%; height: 230px; object-fit: cover; object-position: top; background: var(--surface-3); }
.gallery-item span { display: block; padding: 10px 12px; color: var(--muted); font-size: 12px; font-weight: 700; }
.gallery-item:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.image-viewer {
  position: fixed; inset: 0; z-index: 100; background: rgba(3,7,18,.9);
  display: flex; align-items: center; justify-content: center; padding: 26px;
  opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s;
}
.image-viewer.open { opacity: 1; visibility: visible; transition: opacity .18s ease, visibility 0s; }
.image-viewer-inner { max-width: min(1180px, 92vw); max-height: 92vh; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.image-viewer img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 14px; background: #111827; }
.image-viewer p { margin: 0; color: #e5e7eb; font-size: 13px; text-align: center; }
.viewer-btn {
  position: absolute; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.22); background: rgba(15,23,42,.7); color: #fff; font-size: 22px; cursor: pointer;
}
.viewer-close { right: 24px; top: 20px; }
.viewer-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.viewer-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid, .about-grid, .modal-hero, .contact-card { grid-template-columns: 1fr; }
  .hero-grid { gap: 36px; }
  .hero-side { max-width: 560px; }
  .profile-card { display: flex; align-items: center; gap: 16px; }
  #photoBox { flex: 0 0 84px; }
  .profile-photo, .photo-placeholder { width: 84px; height: 84px; border-radius: 50%; }
  .photo-placeholder { font-size: 26px; }
  .contact-mini { padding: 0; min-width: 0; }
  .skill-grid, .project-grid, .cert-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 5px; }
}
@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 14px 16px;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav-links:not(.open) { display: none; }
  .nav-links a { padding: 12px; font-size: 15px; }
}
@media (max-width: 700px) {
  .container { width: min(var(--max), calc(100% - 32px)); }
  section { padding: 58px 0; }
  .hero { padding: 60px 0 48px; }
  .hero h1 { font-size: clamp(36px, 11vw, 56px); }
  .section-head { align-items: start; flex-direction: column; gap: 8px; }
  .project-group-head { align-items: flex-start; flex-direction: column; }
  .project-image-wrap { height: 170px; }
  .highlights { gap: 6px; }
  .highlights li { padding: 9px 10px; }
  .highlights b { font-size: 15px; white-space: normal; }
  .highlights span { font-size: 11px; }
  .modal-backdrop { padding: 10px; align-items: end; }
  .project-modal { max-height: 94vh; border-radius: 22px 22px 8px 8px; }
  .modal-body { padding: 21px; }
  .flow { grid-template-columns: 1fr; gap: 6px; }
  .flow-label { padding-top: 0; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item img { height: 210px; }
  .image-viewer { padding: 14px; }
  .viewer-close { right: 12px; top: 12px; }
  .viewer-prev, .viewer-next { top: auto; bottom: 16px; transform: none; }
  .viewer-prev { left: calc(50% - 54px); }
  .viewer-next { right: calc(50% - 54px); }
}
/* Motion: only active with html.motion (set in <head> unless reduced motion is preferred) */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes nodeIn { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes flowPulse {
  0%, 100% { color: var(--muted-2); text-shadow: none; }
  50% { color: var(--accent-strong); text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent); }
}
html.motion .hero:not(.hero-ready) .hero-grid { visibility: hidden; }
html.motion .hero.hero-ready :is(.hero-kicker, h1, .hero-desc, .hero-actions, .hero-side) { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
html.motion .hero.hero-ready h1 { animation-delay: .08s; }
html.motion .hero.hero-ready .hero-side { animation-delay: .18s; }
html.motion .hero.hero-ready .hero-desc { animation-delay: .26s; }
html.motion .hero.hero-ready .hero-actions { animation-delay: .36s; }
html.motion .reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--delay, 0ms); }
html.motion .reveal.is-visible { opacity: 1; transform: none; }
html.motion .flows.animate .flow-nodes li { animation: nodeIn .4s ease both; animation-delay: calc(var(--r) * 240ms + var(--i) * 110ms); }
html.motion .flows.animate .flow-nodes li + li::before { animation: flowPulse 2.4s ease-in-out infinite; animation-delay: calc(var(--r) * 240ms + var(--i) * 180ms + .6s); }

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