/* ============================================================
   Homepage v4 ("Portfolio Website Re-design").
   Values follow Homepage v4.dc.html; its inline styles and its
   script-driven hover states are written as CSS here.
   ============================================================ */
:root {
  --bg: #F2F1EE;
  --surface: #FFFFFF;
  --soft: #F7F6F3;
  --ink: #16161A;
  --ink-2: #3A3A42;
  --ink-3: #4A4A52;
  --muted: #5A5A62;
  --faint: #6E6E76;
  --line: rgba(22, 22, 26, 0.08);
  --blue: #3047E0;
  --blue-dark: #1F33B8;
  --blue-soft: #EAEDFD;
  --orange: #D65C1E;
  --green: #15803D;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, figure, dl, dd { margin: 0; }
img { display: block; max-width: 100%; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.page { min-height: 100vh; padding: 16px clamp(12px, 2.5vw, 32px) 24px; }
.main { max-width: 1240px; margin: 0 auto; }

/* Small shared pieces ---------------------------------------- */
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot--green { background: #22A35A; box-shadow: 0 0 0 4px rgba(34, 163, 90, 0.16); }
.tag .dot--green { box-shadow: none; background: var(--green); }
.dot--blue { background: var(--blue); }
.dot--orange { background: var(--orange); }
.dot--live { background: #3DD27A; }

.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px 7px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  font-size: 15px; font-weight: 500; color: var(--ink-3);
}
.pill strong { font-weight: 600; color: var(--ink); }
.pill__keep { white-space: nowrap; }
@media (max-width: 420px) { .hero .pill { font-size: 13px; gap: 8px; padding: 7px 12px 7px 10px; } }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 24px; border-radius: 999px;
  font: inherit; font-size: 16px; font-weight: 500;
  text-decoration: none; cursor: pointer; border: 0;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn--dark { background: var(--ink); color: #FFFFFF; }
.btn--dark:hover { background: #33333A; color: #FFFFFF; }
.btn--light { background: #FFFFFF; color: var(--ink); overflow-wrap: anywhere; }
.btn--light:hover { background: #E9E8E4; color: var(--ink); }
.btn--ghost { padding: 15px 22px; background: transparent; color: #FFFFFF; border: 1px solid rgba(255, 255, 255, 0.2); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }

/* Nav: floating pill ----------------------------------------- */
.nav-wrap { position: sticky; top: 16px; z-index: 20; display: flex; justify-content: center; }
.nav {
  display: flex; align-items: center; gap: 4px; padding: 6px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: box-shadow 0.3s ease;
}
.nav.is-scrolled { box-shadow: 0 8px 30px rgba(22, 22, 26, 0.08); }
.nav__brand {
  display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px;
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
}
.nav__brand:hover { color: var(--ink); }
.nav__brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #E4E2DC; }
.nav__link { padding: 9px 14px; border-radius: 999px; font-size: 15px; color: var(--ink-3); text-decoration: none; }
.nav__link:hover { background: var(--bg); color: var(--ink); }
.nav__cta {
  margin-left: 4px; padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: #FFFFFF; font-size: 15px; font-weight: 500; text-decoration: none;
}
.nav__cta:hover { background: #33333A; color: #FFFFFF; }

/* Hero ------------------------------------------------------- */
.hero {
  display: flex; flex-wrap: wrap; align-items: center; gap: clamp(24px, 4vw, 64px);
  padding: clamp(40px, 7vh, 88px) 0 clamp(72px, 11vh, 128px);
}
.hero__text { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.hero__title {
  margin-top: 28px;
  font-size: clamp(40px, 5.2vw, 78px); font-weight: 600; line-height: 1.02; letter-spacing: -0.04em;
  color: var(--ink); text-wrap: balance;
}
.hero__accent { color: var(--green); }
.hero__sub {
  margin-top: 24px; max-width: 44ch;
  font-size: clamp(17px, 1.35vw, 20px); line-height: 1.55; color: var(--muted); text-wrap: pretty;
}
.kw { font-weight: 600; }
.kw--blue { color: var(--blue); }
.kw--orange { color: var(--orange); }
.kw--green { color: var(--green); }
.hero__actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero__art-wrap { flex: 1 1 380px; min-width: 0; display: flex; justify-content: center; }
.hero__art { position: relative; width: min(100%, 560px); aspect-ratio: 1; }
.hero__canvas { position: absolute; inset: 0; }
.tag {
  position: absolute; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap;
}
.tag--tl { left: 2%; top: 4%; }
.tag--tr { right: 2%; top: 4%; }
.tag--b { left: 50%; bottom: 1%; transform: translateX(-50%); }

/* Sections --------------------------------------------------- */
.section { scroll-margin-top: 96px; padding-bottom: clamp(96px, 12vw, 160px); }
.section--contact { padding-bottom: 0; }
.section__head {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  margin-bottom: clamp(32px, 4vw, 56px);
}
.section__title { font-size: clamp(32px, 3.6vw, 52px); font-weight: 600; line-height: 1.05; letter-spacing: -0.03em; }
.section__lead { max-width: 44ch; font-size: 18px; line-height: 1.5; color: var(--muted); text-wrap: balance; }

/* Work cards ------------------------------------------------- */
.cards { display: flex; flex-direction: column; gap: clamp(20px, 2.4vw, 32px); }
.card {
  display: flex; flex-wrap: wrap; gap: 12px; padding: 12px;
  background: var(--surface); border: 1px solid rgba(22, 22, 26, 0.06); border-radius: 32px;
  color: var(--ink); text-decoration: none;
  box-shadow: 0 1px 2px rgba(22, 22, 26, 0.04);
  transition: transform 0.4s var(--ease), box-shadow 0.4s ease, opacity 0.8s ease, translate 0.8s var(--ease);
}
.card:hover, .card:focus-visible {
  color: var(--ink);
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(22, 22, 26, 0.10);
}
.card__media {
  flex: 1.3 1 480px; min-width: 0; overflow: hidden;
  border-radius: 22px; background: #F3EFE3; aspect-ratio: 4 / 3;
}
.card__media picture { display: block; width: 100%; height: 100%; }
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.card:hover .card__media img, .card:focus-visible .card__media img { transform: scale(1.035); }
.card__body {
  flex: 1 1 340px; min-width: 0;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: clamp(16px, 2vw, 28px);
}
.card__top { display: flex; flex-direction: column; gap: 14px; }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--faint); }
.badge { padding: 6px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 600; line-height: 1; }
.card__title { font-size: clamp(34px, 3.2vw, 46px); font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
.card__lede { font-size: 19px; line-height: 1.45; color: var(--ink-3); text-wrap: pretty; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 6px 11px; border-radius: 999px; background: var(--bg); font-size: 13px; line-height: 1; color: var(--ink-3); white-space: nowrap; }
.facts { display: flex; flex-direction: column; gap: 10px; }
.fact { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: 18px; background: var(--soft); }
.fact dt { font-size: 13px; font-weight: 600; color: var(--faint); }
.fact dd { font-size: 16px; line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.fact b { font-weight: 600; color: var(--blue); }
.fact__pair { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.card__cta {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 20px; border-radius: 999px;
  background: var(--ink); color: #FFFFFF; font-size: 15px; font-weight: 500;
  transition: background 0.3s ease;
}
.card__arrow {
  width: 32px; height: 32px; border-radius: 50%; background: #FFFFFF; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s ease;
}
.card:hover .card__cta, .card:focus-visible .card__cta { background: var(--blue); }
.card:hover .card__arrow, .card:focus-visible .card__arrow { transform: translateX(3px); }

/* About ------------------------------------------------------ */
.about { display: flex; flex-wrap: wrap; gap: clamp(12px, 1.6vw, 20px); }
.about__photo { flex: 1 1 300px; min-width: 0; min-height: 420px; overflow: hidden; border-radius: 28px; background: #E4E2DC; }
.about__photo img { width: 100%; height: 100%; object-fit: cover; }
.about__right { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: clamp(12px, 1.6vw, 20px); }
.about__copy {
  display: flex; flex-direction: column; gap: 16px; padding: clamp(24px, 3vw, 40px);
  background: var(--surface); border-radius: 28px;
  font-size: 17px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty;
}
.about__row { flex: 1; display: flex; flex-wrap: wrap; gap: clamp(12px, 1.6vw, 20px); }
.about__dark {
  flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 12px;
  padding: clamp(24px, 2.6vw, 32px); background: var(--ink); color: #FFFFFF; border-radius: 28px;
}
.about__label { font-size: 13px; font-weight: 600; color: #A6A6AE; }
.about__dark p { font-size: 17px; line-height: 1.55; color: #E8E8EC; text-wrap: pretty; }
.about__facts {
  flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column;
  padding: 8px clamp(20px, 2.4vw, 28px); background: var(--surface); border-radius: 28px;
  font-size: 15px; line-height: 1.45;
}
.about__facts > div { display: flex; flex-direction: column; gap: 3px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.about__facts > div:last-child { border-bottom: 0; }
.about__facts dt { font-size: 13px; font-weight: 600; color: var(--faint); }
.about__facts dd { color: var(--ink); }
.about__facts .about__certs { flex-direction: column; align-items: flex-start; gap: 12px; }
.about__certs > div { display: flex; flex-direction: column; gap: 3px; }
.btn-soft {
  flex: none; padding: 9px 14px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue); font-size: 14px; font-weight: 600; text-decoration: none;
}
.btn-soft:hover { background: #DCE1FC; color: var(--blue); }

/* Contact ---------------------------------------------------- */
.contact {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(56px, 8vw, 112px) clamp(20px, 4vw, 64px);
  background: var(--ink); color: #FFFFFF; border-radius: 36px;
}
.contact__pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px;
  background: rgba(255, 255, 255, 0.08); border-radius: 999px; font-size: 14px; color: #D0D0D6;
}
.contact__title {
  margin-top: 24px; max-width: 12em;
  font-size: clamp(40px, 5.6vw, 80px); font-weight: 600; line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance;
}
.contact__title span { color: #8FA0FF; }
.contact__actions { margin-top: 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.foot {
  max-width: 1240px; margin: 0 auto; padding: 28px 8px 8px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  font-size: 13px; color: var(--faint);
}

/* Certifications dialog -------------------------------------- */
.certs-dlg {
  width: min(100% - 24px, 1040px); max-height: min(100% - 24px, 820px);
  padding: 0; border: 0; border-radius: 28px;
  background: #FFFFFF; color: var(--ink);
  box-shadow: 0 30px 80px rgba(22, 22, 26, 0.3);
}
.certs-dlg[open] { display: flex; flex-direction: column; overflow: hidden; }
.certs-dlg::backdrop { background: rgba(22, 22, 26, 0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.certs-dlg__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 20px 20px clamp(20px, 3vw, 32px); border-bottom: 1px solid var(--line);
}
.certs-dlg__head h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.certs-dlg__head p { margin-top: 2px; font-size: 14px; color: var(--faint); }
.certs-dlg__close {
  width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: var(--bg); font-size: 18px; color: var(--ink); cursor: pointer;
}
.certs-dlg__close:hover { background: #E4E2DC; }
.certs-dlg__list {
  margin: 0; padding: clamp(16px, 3vw, 32px); list-style: none; overflow: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.certs-dlg__item {
  height: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 6px 12px;
  padding: 16px 18px; border-radius: 16px; background: var(--bg);
  color: var(--ink); text-decoration: none; transition: background 0.2s ease;
}
.certs-dlg__item:hover { background: #E9E8E4; color: var(--ink); }
.certs-dlg__name { font-size: 15px; font-weight: 600; line-height: 1.35; }
.certs-dlg__date { grid-row: 2; font-size: 13px; color: var(--faint); }
.certs-dlg__arrow { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--blue); }

/* Transport website preview dialog --------------------------- */
.about__site { align-self: flex-start; margin-top: 4px; }
.site-dlg { width: min(100% - 24px, 1320px); height: min(100% - 24px, 920px); max-height: none; }
.site-dlg__head { flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }
.site-dlg__head h2 { font-size: 22px; }
.site-dlg__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.site-dlg__tools .btn-soft { display: inline-flex; align-items: center; min-height: 44px; }
.site-dlg__toggle { display: inline-flex; padding: 4px; gap: 4px; background: var(--bg); border-radius: 999px; }
.site-dlg__toggle button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink-3); cursor: pointer;
}
.site-dlg__toggle button[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; }
.site-dlg__screen { flex: 1; min-height: 0; display: flex; justify-content: center; background: var(--soft); }
.site-dlg__screen iframe { display: block; width: 100%; height: 100%; border: 0; background: #FFFFFF; transition: width 0.3s var(--ease); }
.site-dlg__screen.is-phone iframe { width: 390px; max-width: 100%; box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 700px) {
  .site-dlg__head { position: relative; padding-right: 72px; }
  .site-dlg__toggle { display: none; }
  .site-dlg__head .certs-dlg__close { position: absolute; top: 12px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) { .site-dlg__screen iframe { transition: none; } }

/* Scroll reveal (home.js adds .is-hidden only to things below the fold) */
[data-reveal].is-hidden { opacity: 0; translate: 0 20px; }
[data-reveal] { transition: opacity 0.8s ease, translate 0.8s var(--ease); }

@media (max-width: 560px) {
  .nav__brand span { display: none; }
  .nav__brand { padding-right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .card:hover, .card:focus-visible { transform: none; }
  .card:hover .card__media img { transform: none; }
}
