:root {
  --blue: #89cff0;
  --blue-strong: #59b7e6;
  --blue-soft: #eaf7fd;
  --gray: #d3d3d3;
  --gray-soft: #f4f6f8;
  --text: #2e3135;
  --muted: #6d737a;
  --surface: #ffffff;
  --surface-2: #f8fbfd;
  --border: #e6ebef;
  --shadow: 0 12px 30px rgba(31, 73, 97, .10);
  --shadow-soft: 0 6px 18px rgba(31, 73, 97, .08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max: 1220px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 12%, rgba(137,207,240,.13), transparent 24%),
    linear-gradient(180deg, #f9fbfc 0%, #eef2f5 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background .3s ease, color .3s ease;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
img { display: block; max-width: 100%; }

body.dark-mode,
html.theme-dark body {
  --blue: #89cff0;
  --blue-strong: #5cc8ff;
  --blue-soft: #10283a;
  --gray: #4b5964;
  --gray-soft: #10161d;
  --text: #f1f5f8;
  --muted: #aeb9c2;
  --surface: #0b1118;
  --surface-2: #0f1923;
  --border: #233646;
  --shadow: 0 14px 36px rgba(0,0,0,.38);
  --shadow-soft: 0 8px 22px rgba(0,0,0,.28);
  background:
    radial-gradient(circle at 15% 10%, rgba(48,149,200,.12), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(137,207,240,.08), transparent 22%),
    linear-gradient(180deg, #05090e 0%, #0a1118 100%);
}

.site-shell {
  width: min(calc(100% - 42px), 1320px);
  margin: 26px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}
.navbar {
  width: min(calc(100% - 54px), var(--max));
  min-height: 84px;
  margin: auto;
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 20px;
}
.brand-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-dots .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: block;
}
.brand-dots .red { background: #ff5f57; }
.brand-dots .yellow { background: #febc2e; }
.brand-dots .green { background: #28c840; }
.nav-links {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  position: relative;
  color: var(--text);
  padding: 30px 0 27px;
  font-size: .96rem;
  transition: color .2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--blue-strong); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  height: 2px;
  border-radius: 10px;
  background: var(--blue-strong);
}
.nav-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 18px;
  border-left: 1px solid var(--border);
}
.language-switch { display: flex; gap: 7px; align-items: center; font-size: .88rem; font-weight: 700; }
.language-switch .active { color: var(--blue-strong); }
.language-switch .inactive, .language-switch .divider { color: var(--muted); }
.language-switch [data-lang] { cursor: pointer; user-select: none; transition: color .2s ease; }

/* Keep the selected language indicator correct from the very first paint.
   theme-init.js sets <html lang> before this stylesheet loads, so the
   switch never briefly highlights EN when Indonesian is already selected. */
html[lang="en"] .language-switch [data-lang="en"],
html[lang="id"] .language-switch [data-lang="id"] {
  color: var(--blue-strong);
}
html[lang="en"] .language-switch [data-lang="id"],
html[lang="id"] .language-switch [data-lang="en"] {
  color: var(--muted);
}
.language-switch [data-lang]:focus-visible { outline: 2px solid var(--blue-strong); outline-offset: 3px; border-radius: 3px; }

/* Prevent a flash of the English fallback when Indonesian was previously selected. */
html.i18n-pending body > * { visibility: hidden; }

.theme-input { position: absolute; opacity: 0; pointer-events: none; }
.theme-toggle {
  width: 54px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--gray-soft);
  padding: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: .25s ease;
}
.theme-knob {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-strong);
  color: #04121a;
  font-size: 0;
  transition: transform .25s ease;
}
.theme-knob::before {
  content: "☾";
  font-size: .78rem;
  line-height: 1;
}
html.theme-dark .theme-knob::before { content: "☀"; }
#theme-toggle:checked + .theme-toggle .theme-knob,
html.theme-dark .theme-toggle .theme-knob { transform: translateX(22px); }

main {
  width: min(calc(100% - 38px), var(--max));
  margin: 22px auto 26px;
}

.hero, .page-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid color-mix(in srgb, var(--blue) 26%, var(--border));
  background:
    radial-gradient(circle at 78% 45%, rgba(137,207,240,.24), transparent 27%),
    linear-gradient(120deg, color-mix(in srgb, var(--blue-soft) 80%, var(--surface)) 0%, var(--surface-2) 74%);
}
.hero::before, .page-banner::before {
  content: "";
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  right: -80px;
  top: -120px;
  background: rgba(137,207,240,.14);
}
.hero::after, .page-banner::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 125px;
  left: -80px;
  bottom: -70px;
  border-radius: 50%;
  background: rgba(137,207,240,.11);
}
body.dark-mode .hero,
body.dark-mode .page-banner,
html.theme-dark body .hero,
html.theme-dark body .page-banner {
  background:
    radial-gradient(circle at 78% 45%, rgba(77,167,215,.16), transparent 27%),
    linear-gradient(120deg, #07121d 0%, #0d1d2b 100%);
}

.hero {
  min-height: 460px;
  padding: 68px 64px;
  display: grid;
  grid-template-columns: 1.18fr .82fr;
  align-items: center;
  gap: 34px;
}
.hero-copy { position: relative; z-index: 2; }
.eyebrow { color: var(--blue-strong); font-weight: 800; margin-bottom: 10px; }
.hero h1 {
  margin: 0;
  font-size: clamp(2.8rem, 5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.055em;
}
.hero h1 span, .accent { color: var(--blue-strong); }
.hero-subtitle {
  margin: 18px 0 16px;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  color: var(--muted);
  font-weight: 600;
}
.hero-text { max-width: 650px; color: var(--muted); font-size: 1.04rem; line-height: 1.8; }
.hero-actions { display: flex; gap: 16px; margin-top: 26px; flex-wrap: wrap; }
.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 21px;
  border-radius: 12px;
  border: 1px solid var(--blue-strong);
  font-weight: 750;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn.primary { background: var(--blue-strong); color: #06202e; }
.btn.outline { color: var(--blue-strong); background: transparent; }

.hero-portrait {
  position: relative;
  align-self: stretch;
  display: grid;
  place-items: end center;
  z-index: 1;
}
.portrait-halo {
  position: absolute;
  width: 390px;
  height: 390px;
  max-width: 100%;
  border-radius: 50%;
  background: rgba(137,207,240,.20);
  bottom: 20px;
}
.portrait-image {
  position: relative;
  z-index: 2;
  width: min(395px, 100%);
  max-height: 405px;
  object-fit: cover;
  object-position: center 32%;
  border-radius: 46% 46% 30px 30px;
  filter: saturate(.9);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}
.feature-card, .card, .skill-card, .project-card, .certificate-card, .contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.feature-card {
  padding: 24px;
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 16px;
}
.icon-bubble {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 1.7rem;
  border: 1px solid color-mix(in srgb, var(--blue) 28%, transparent);
}
.feature-card h3, .skill-card h3 { margin: 0 0 7px; font-size: 1.1rem; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .92rem; }

.page-banner {
  min-height: 185px;
  padding: 42px 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 18px;
}
.page-banner h1 { margin: 0 0 10px; font-size: clamp(2.2rem, 4vw, 3.4rem); letter-spacing: -.04em; }
.page-banner p { margin: 0; max-width: 690px; color: var(--muted); font-size: 1.02rem; line-height: 1.7; }

.about-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
}
.profile-card { padding: 22px; text-align: center; }
.profile-card .profile-frame {
  height: 320px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--blue-soft);
  margin-bottom: 18px;
}
.profile-card .profile-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.profile-card h2 { margin: 0; color: var(--blue-strong); }
.profile-card .role { margin: 6px 0 10px; color: var(--muted); }
.profile-meta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.profile-location { display: inline-flex; align-items: center; gap: 5px; }
.location-icon { width: 15px; height: 15px; fill: var(--accent-strong); flex: 0 0 auto; }
.social-row { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.social-circle {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue-strong); font-weight: 800; border: 1px solid var(--border);
}
.social-circle svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.about-content { display: grid; gap: 16px; }
.about-intro { padding: 28px 30px; }
.about-intro h2 { margin-top: 0; }
.about-intro p { color: var(--muted); line-height: 1.75; margin-bottom: 0; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.info-card { padding: 20px; }
.info-card h3 { margin: 0 0 8px; }
.info-card p, .info-card li { color: var(--muted); font-size: .91rem; line-height: 1.55; }
.info-card ul { padding-left: 18px; margin: 7px 0 0; }
.love-data { padding: 20px 22px; display: grid; grid-template-columns: 60px 1fr; gap: 14px; align-items: center; border-color: color-mix(in srgb, var(--blue) 55%, var(--border)); }
.love-data h3 { color: var(--blue-strong); margin: 0 0 5px; }
.love-data p { margin: 0; color: var(--muted); line-height: 1.55; }

.skills-grid { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 16px; }
.skill-card { padding: 26px 22px; text-align: center; }
.skill-card h3::after {
  content: ""; display: block; width: 54px; height: 2px; margin: 10px auto 20px; border-radius: 2px; background: var(--blue-strong);
}
.logo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(82px, 1fr)); gap: 15px 10px; }
.logo-item { display: grid; justify-items: center; gap: 8px; color: var(--muted); font-size: .88rem; }
.logo-badge {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue-soft); border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--border));
  color: var(--blue-strong); font-size: 1.08rem; font-weight: 850; letter-spacing: -.04em;
}
.logo-badge img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.project-toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0; }
.filter-pill { padding: 10px 16px; border-radius: 10px; border: 1px solid var(--blue-strong); color: var(--blue-strong); background: var(--surface); font-weight: 700; font-size: .9rem; cursor: pointer; user-select: none; }
.filter-pill.active { background: var(--blue-strong); color: #06202e; }
.projects-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.project-card { padding: 16px; display: flex; flex-direction: column; min-height: 430px; }
.project-card[hidden] { display: none !important; }
.project-thumb { height: 155px; border-radius: 15px; overflow: hidden; background: var(--blue-soft); border: 1px solid var(--border); }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-card h3 { margin: 16px 0 8px; font-size: 1.05rem; }
.project-card p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .9rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 18px; }
.tag { font-size: .72rem; color: var(--blue-strong); border: 1px solid color-mix(in srgb, var(--blue-strong) 65%, var(--border)); padding: 4px 7px; border-radius: 6px; background: color-mix(in srgb, var(--blue-soft) 62%, var(--surface)); }
.project-actions { display: flex; gap: 8px; margin-top: 14px; }
.project-actions .btn { min-height: 38px; padding: 0 12px; font-size: .8rem; flex: 1; }

.cert-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; }
.achievement-summary { padding: 22px; }
.achievement-summary h3 { margin-top: 0; }
.stat-row { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; padding: 17px 0; border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: 0; }
.stat-number { color: var(--blue-strong); font-size: 1.55rem; font-weight: 850; }
.stat-row p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.certificate-list { display: grid; gap: 12px; }
.certificate-card { padding: 16px 18px; display: grid; grid-template-columns: 155px 1fr auto; align-items: center; gap: 18px; }
.certificate-thumb { height: 104px; border-radius: 14px; overflow: hidden; background: var(--blue-soft); }
.certificate-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.certificate-card h3 { margin: 0 0 6px; font-size: 1.03rem; }
.issuer { color: var(--blue-strong); font-weight: 750; font-size: .9rem; }
.certificate-card p { color: var(--muted); font-size: .86rem; line-height: 1.5; margin: 6px 0 0; }
.cert-side { text-align: right; display: grid; justify-items: end; gap: 16px; }
.year-badge { padding: 6px 10px; border-radius: 8px; background: var(--blue-soft); color: var(--blue-strong); font-weight: 800; font-size: .82rem; }
.cert-side .btn { min-height: 40px; font-size: .8rem; padding: 0 13px; }

.contact-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 20px; align-items: stretch; }
.contact-intro { padding: 48px 34px; background: linear-gradient(145deg, var(--surface-2), var(--blue-soft)); }
.contact-intro h1 { margin: 0; font-size: 3rem; letter-spacing: -.04em; }
.contact-intro > p { color: var(--muted); margin: 10px 0 28px; }
.contact-list { display: grid; gap: 10px; }
.contact-item { padding: 14px 16px; display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 12px; }
.contact-item .icon-bubble { width: 44px; height: 44px; font-size: 1rem; }
.contact-item strong { display: block; margin-bottom: 2px; }
.contact-item span { color: var(--muted); font-size: .87rem; }
.contact-item[href] { color: inherit; text-decoration: none; transition: transform .2s ease, border-color .2s ease; }
.contact-item[href]:hover { transform: translateY(-2px); border-color: var(--accent-strong); }
.contact-icon svg { width: 23px; height: 23px; fill: currentColor; display: block; }
.contact-form { padding: 28px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 750; margin-bottom: 7px; font-size: .9rem; }
.form-control {
  width: 100%; min-height: 46px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); outline: none;
}
textarea.form-control { min-height: 112px; resize: vertical; }
.form-control:focus { border-color: var(--blue-strong); box-shadow: 0 0 0 3px rgba(137,207,240,.13); }
.send-btn { width: 100%; border: 0; cursor: pointer; margin-top: 3px; }
.send-btn:disabled { cursor: wait; opacity: .72; }
.form-honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.form-status { min-height: 20px; margin: 10px 2px 0; font-size: .86rem; color: var(--muted); text-align: center; }
.form-status.success { color: var(--blue-strong); }
.form-status.error { color: #e36a6a; }

.site-footer {
  min-height: 70px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--gray-soft) 72%, var(--surface));
  display: flex;
  align-items: center;
}
.footer-inner {
  width: min(calc(100% - 54px), var(--max));
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: .86rem;
}

.footer-views { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); }
.footer-views svg { width: 17px; height: 17px; fill: currentColor; display: block; color: var(--blue-strong); }
.footer-views strong { color: var(--blue-strong); font-weight: 850; min-width: 1.5ch; }

.footer-divider { width: 1px; height: 24px; background: var(--border); }
.footer-socials { display: flex; gap: 10px; }
.footer-socials a { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 850; color: var(--muted); }
.footer-socials a:hover { color: var(--blue-strong); background: var(--blue-soft); }
.footer-socials svg { width: 16px; height: 16px; fill: currentColor; display: block; }

@media (max-width: 1080px) {
  .navbar { grid-template-columns: 130px 1fr; }
  .nav-tools { grid-column: 1 / -1; justify-self: end; margin-top: -18px; margin-bottom: 14px; }
  .nav-links { gap: 18px; }
  .hero { padding: 50px 42px; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .site-shell { width: min(calc(100% - 18px), 1320px); margin: 9px auto; border-radius: 18px; }
  .navbar { width: calc(100% - 28px); grid-template-columns: 1fr auto; min-height: 70px; }
  .nav-links { grid-column: 1 / -1; justify-self: stretch; overflow-x: auto; padding-bottom: 3px; gap: 20px; }
  .nav-links a { padding: 10px 0 14px; white-space: nowrap; }
  .nav-links a.active::after { bottom: 6px; }
  .nav-tools { grid-column: auto; grid-row: 1; margin: 0; padding-left: 10px; }
  main { width: calc(100% - 24px); margin-top: 12px; }
  .hero { grid-template-columns: 1fr; padding: 38px 26px 0; text-align: left; }
  .hero-portrait { min-height: 320px; }
  .feature-grid, .about-layout, .info-grid, .cert-layout, .contact-layout { grid-template-columns: 1fr; }
  .certificate-card { grid-template-columns: 110px 1fr; }
  .cert-side { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; justify-items: start; text-align: left; }
  .page-banner { padding: 34px 28px; }
  .footer-inner { flex-wrap: wrap; padding: 15px 0; text-align: center; }
}

@media (max-width: 560px) {
  .language-switch { display: none; }
  .nav-tools { border-left: 0; }
  .hero h1 { font-size: 2.55rem; }
  .hero { padding: 34px 22px 0; }
  .feature-grid, .projects-grid { grid-template-columns: 1fr; }
  .feature-card { grid-template-columns: 58px 1fr; padding: 18px; }
  .icon-bubble { width: 52px; height: 52px; font-size: 1.35rem; }
  .about-layout { display: block; }
  .profile-card { margin-bottom: 15px; }
  .certificate-card { grid-template-columns: 1fr; }
  .certificate-thumb { height: 140px; }
  .cert-side { grid-column: auto; }
  .contact-intro h1 { font-size: 2.35rem; }
}

.page-banner.with-portrait { padding-right: 390px; min-height: 220px; }
.banner-mini-portrait {
  position: absolute;
  right: 45px;
  bottom: 0;
  width: 275px;
  height: 205px;
  object-fit: cover;
  object-position: center 28%;
  border-radius: 48% 48% 0 0;
  z-index: 1;
}
.page-banner > *:not(.banner-mini-portrait) { position: relative; z-index: 2; }
@media (max-width: 800px) {
  .page-banner.with-portrait { padding-right: 28px; min-height: 185px; }
  .banner-mini-portrait { display: none; }
}


/* Project detail page */
.project-detail-hero {
  border: 1px solid color-mix(in srgb, var(--blue) 26%, var(--border));
  border-radius: var(--radius-xl);
  padding: 34px 38px;
  background:
    radial-gradient(circle at 88% 18%, rgba(137,207,240,.18), transparent 24%),
    linear-gradient(120deg, color-mix(in srgb, var(--blue-soft) 72%, var(--surface)) 0%, var(--surface-2) 78%);
  margin-bottom: 18px;
}
body.dark-mode .project-detail-hero,
html.theme-dark body .project-detail-hero {
  background:
    radial-gradient(circle at 88% 18%, rgba(77,167,215,.14), transparent 24%),
    linear-gradient(120deg, #07121d 0%, #0d1d2b 100%);
}
.project-back {
  display: inline-flex;
  margin-bottom: 24px;
  color: var(--blue-strong);
  font-weight: 750;
  font-size: .9rem;
}
.project-detail-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
}
.project-detail-heading h1 {
  margin: 8px 0 8px;
  font-size: clamp(2.3rem, 4.5vw, 4rem);
  letter-spacing: -.045em;
}
.project-detail-heading p { margin: 0; color: var(--muted); font-size: 1.1rem; }
.project-category { display: flex; flex-wrap: wrap; gap: 8px; }
.project-category span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  border: 1px solid color-mix(in srgb, var(--blue) 36%, var(--border));
  font-weight: 750;
  font-size: .78rem;
}
.project-detail-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.project-detail-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 16px;
  margin-bottom: 16px;
}
.project-detail-card { padding: 24px 26px; }
.project-detail-card h2,
.project-insights h2,
.project-visual-section h2 { margin: 0 0 14px; font-size: 1.35rem; }
.project-detail-card p { margin: 0; color: var(--muted); line-height: 1.75; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-list { margin: 0; padding-left: 22px; color: var(--muted); line-height: 1.75; }
.workflow-line {
  color: var(--blue-strong) !important;
  font-weight: 700;
  line-height: 1.9 !important;
}
.project-insights { padding: 24px 26px; margin-bottom: 18px; }
.insight-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.insight-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.insight-item > span {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: .78rem; font-weight: 850;
}
.insight-item p { margin: 0; color: var(--muted); line-height: 1.6; font-size: .9rem; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.visual-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.visual-card { margin: 0; overflow: hidden; }
.visual-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.visual-card figcaption { padding: 13px 16px 15px; color: var(--muted); font-size: .88rem; }

@media (max-width: 800px) {
  .project-detail-heading { align-items: flex-start; flex-direction: column; }
  .project-detail-actions { justify-content: flex-start; }
  .project-detail-grid, .insight-grid, .visual-grid { grid-template-columns: 1fr; }
  .project-detail-hero { padding: 28px 24px; }
}


/* Certificate list: keep the page compact while allowing many credentials. */
.certificate-list {
  display: grid;
  gap: 12px;
  max-height: 472px;
  overflow-y: auto;
  padding-right: 8px;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: var(--blue-strong) transparent;
}
.certificate-list::-webkit-scrollbar { width: 8px; }
.certificate-list::-webkit-scrollbar-track { background: transparent; }
.certificate-list::-webkit-scrollbar-thumb { background: var(--blue-strong); border-radius: 999px; }
.certificate-card {
  grid-template-columns: 155px minmax(0, 1fr) auto;
  min-height: 142px;
}
@media (max-width: 800px) {
  .certificate-list { max-height: 520px; }
  .certificate-card { grid-template-columns: 1fr; }
  .cert-side { grid-column: auto; grid-template-columns: auto auto; justify-content: space-between; justify-items: start; width: 100%; }
}
@media (max-width: 560px) {
  .cert-side { grid-template-columns: 1fr; }
}

.icon-bubble svg { width: 24px; height: 24px; fill: currentColor; display: block; }


/* Mobile / Android refinement */
@media (max-width: 800px) {
  .site-shell {
    width: calc(100% - 12px);
    margin: 6px auto;
    border-radius: 16px;
  }

  .navbar {
    width: calc(100% - 24px);
    gap: 10px;
  }

  .nav-links {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }

  main {
    width: calc(100% - 16px);
    margin: 10px auto 18px;
  }

  .hero {
    min-height: 0;
    gap: 16px;
    padding: 30px 20px 0;
  }
  .hero-text { font-size: .96rem; line-height: 1.65; }
  .hero-portrait { min-height: 295px; }
  .portrait-halo { width: 300px; height: 300px; bottom: 8px; }
  .portrait-image { width: min(335px, 100%); max-height: 320px; }

  .page-banner { min-height: 150px; padding: 28px 22px; }

  .project-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0;
  }
  .filter-pill { text-align: center; padding: 10px 8px; }

  .project-card { min-height: 0; }
  .project-thumb { height: auto; aspect-ratio: 16 / 9; }

  .about-intro, .project-detail-card, .project-insights { padding: 22px 20px; }
  .contact-intro { padding: 30px 22px; }
  .contact-form { padding: 22px 20px; }

  .footer-inner {
    width: calc(100% - 24px);
    gap: 10px 14px;
  }
}

@media (max-width: 560px) {
  .navbar { padding-top: 7px; }
  .brand-dots { gap: 7px; }
  .brand-dots .dot { width: 12px; height: 12px; }
  .nav-tools { gap: 8px; padding-left: 6px; }
  .language-switch { display: flex; font-size: .76rem; gap: 5px; }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 8px;
    overflow: visible;
    border-top: 1px solid var(--border);
    padding: 5px 0 3px;
  }
  .nav-links a {
    text-align: center;
    font-size: .79rem;
    padding: 9px 2px 12px;
  }
  .nav-links a.active::after { left: 18%; right: 18%; bottom: 5px; }

  .hero { padding: 26px 17px 0; }
  .hero h1 { font-size: clamp(2rem, 10vw, 2.45rem); }
  .hero-subtitle { font-size: 1.04rem; margin: 13px 0 12px; }
  .hero-text { font-size: .91rem; }
  .hero-actions { gap: 9px; margin-top: 20px; }
  .hero-actions .btn { min-height: 44px; padding: 0 14px; font-size: .86rem; }
  .hero-portrait { min-height: 270px; }
  .portrait-image { width: min(300px, 100%); max-height: 290px; }
  .portrait-halo { width: 265px; height: 265px; }

  .page-banner { min-height: 135px; padding: 24px 18px; }
  .page-banner h1 { font-size: 2rem; }
  .page-banner p { font-size: .92rem; line-height: 1.55; }

  .profile-card { padding: 16px; }
  .profile-card .profile-frame { height: 285px; }
  .about-intro { padding: 20px 18px; }
  .info-card { padding: 17px; }
  .love-data { grid-template-columns: 52px 1fr; padding: 18px; }

  .skill-card { padding: 22px 16px; }
  .logo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .project-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-pill { font-size: .81rem; }
  .project-card { padding: 14px; }
  .project-card h3 { margin-top: 13px; }
  .project-actions { gap: 7px; }
  .project-actions .btn { padding: 0 9px; font-size: .76rem; }

  .certificate-list { max-height: 560px; padding-right: 4px; }
  .certificate-card { padding: 14px; gap: 12px; }
  .certificate-thumb { height: auto; aspect-ratio: 16 / 9; }

  .contact-intro { padding: 26px 18px; }
  .contact-intro h1 { font-size: 2.1rem; }
  .contact-form { padding: 20px 16px; }

  .project-detail-hero { padding: 23px 18px; }
  .project-detail-heading h1 { font-size: clamp(2rem, 10vw, 2.7rem); }
  .project-detail-heading p { font-size: .96rem; }
  .project-detail-card, .project-insights { padding: 20px 18px; }
  .insight-item { padding: 14px; grid-template-columns: 38px 1fr; gap: 10px; }

  .footer-inner > [data-i18n="footer.copy"] { flex-basis: 100%; }
  .footer-divider { height: 20px; }
}

@media (max-width: 390px) {
  .hero-actions .btn { flex: 1 1 100%; }
  .project-actions { flex-direction: column; }
  .project-actions .btn { width: 100%; }
  .footer-views { font-size: .8rem; }
}

/* Android certificate page fix: keep desktop behavior unchanged. */
@media (max-width: 800px) {
  .cert-layout {
    display: block;
  }

  .achievement-summary {
    margin-bottom: 14px;
  }

  /* Avoid nested scrolling on phones; use the normal page scroll instead. */
  .certificate-list {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .certificate-card {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
    min-height: 0;
  }

  .certificate-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .certificate-card > div:nth-child(2) {
    min-width: 0;
  }

  .certificate-card h3,
  .certificate-card p,
  .certificate-card .issuer {
    overflow-wrap: anywhere;
  }

  .cert-side {
    grid-column: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
    text-align: left;
  }

  .cert-side .btn {
    width: auto;
    min-height: 40px;
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  .achievement-summary {
    padding: 18px;
  }

  .stat-row {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 0;
  }

  .certificate-card {
    padding: 14px;
  }

  .certificate-card h3 {
    font-size: .98rem;
    line-height: 1.35;
  }

  .certificate-card p {
    font-size: .82rem;
  }

  .cert-side {
    grid-template-columns: none;
  }
}

/* Credential viewer: renders certificate PDFs inside the portfolio. */
.credential-viewer-hero {
  padding: 28px 32px;
  margin-bottom: 16px;
  background:
    radial-gradient(circle at 90% 12%, rgba(137,207,240,.18), transparent 28%),
    var(--surface);
}
.credential-viewer-back {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--blue-strong);
  font-weight: 750;
  font-size: .9rem;
}
.credential-viewer-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}
.credential-viewer-copy { min-width: 0; }
.credential-viewer-eyebrow {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--blue-strong);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.credential-viewer-heading h1 {
  margin: 0 0 9px;
  font-size: clamp(1.7rem, 3.8vw, 2.8rem);
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.credential-viewer-heading p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.credential-viewer-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
}
.credential-viewer-card {
  padding: 18px;
  min-height: 360px;
}
.pdf-status {
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
}
.pdf-status.error { color: #e36a6a; }
.pdf-pages {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 18px;
}
.pdf-page {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}
.pdf-page canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
  background: #fff;
}
.pdf-fallback {
  margin-top: 16px;
  padding: 18px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
}
.pdf-fallback p { margin: 0 0 12px; }

@media (max-width: 800px) {
  .credential-viewer-hero { padding: 23px 20px; }
  .credential-viewer-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .credential-viewer-actions { width: 100%; }
  .credential-viewer-actions .btn { width: 100%; }
  .credential-viewer-card { padding: 10px; min-height: 300px; }
  .pdf-pages { gap: 12px; }
  .pdf-page { border-radius: 9px; }
}

@media (max-width: 560px) {
  .credential-viewer-hero { padding: 20px 17px; }
  .credential-viewer-back { margin-bottom: 14px; }
  .credential-viewer-heading h1 { font-size: 1.65rem; }
  .credential-viewer-heading p { font-size: .88rem; }
  .credential-viewer-card { padding: 7px; }
  .pdf-page { border-radius: 7px; }
}

