/* =============================================================
   Alamgir Hossain — portfolio
   Single stylesheet. No framework, no downloaded webfonts.
   ============================================================= */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;

  --accent:        #0d9488;
  --accent-strong: #0f766e;
  --accent-soft:   #ccfbf1;
  --accent-ink:    #ffffff;
  --highlight:     #f59e0b;

  --bg:        #ffffff;
  --bg-alt:    #f6f8f9;
  --surface:   #ffffff;
  --surface-2: #f1f5f6;
  --border:    #e3e8ec;
  --border-2:  #cfd8de;

  --text:      #0f1b24;
  --text-soft: #45596a;
  --text-mute: #6b8090;

  --shadow-sm: 0 1px 2px rgb(15 27 36 / .05);
  --shadow-md: 0 6px 20px -8px rgb(15 27 36 / .16);
  --shadow-lg: 0 24px 60px -24px rgb(15 27 36 / .28);

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --container: 1140px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 9vw, 7.5rem);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);   /* easeOutExpo: fast start, long soft landing */
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --accent:        #2dd4bf;
  --accent-strong: #5eead4;
  --accent-soft:   #113b39;
  --accent-ink:    #04201d;
  --highlight:     #fbbf24;

  --bg:        #0b1118;
  --bg-alt:    #0f1720;
  --surface:   #121b25;
  --surface-2: #17222e;
  --border:    #22303e;
  --border-2:  #2f4152;

  --text:      #e8eef4;
  --text-soft: #b3c3d1;
  --text-mute: #8698a8;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow-md: 0 6px 22px -8px rgb(0 0 0 / .6);
  --shadow-lg: 0 24px 60px -24px rgb(0 0 0 / .8);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1rem, .96rem + .18vw, 1.0625rem);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 {
  margin: 0 0 .6em;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 1.4rem + 3.6vw, 3.9rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.75rem, 1.25rem + 2.1vw, 2.7rem); letter-spacing: -.03em; }
h3 { font-size: clamp(1.15rem, 1.02rem + .55vw, 1.4rem); }
h4 { font-size: 1rem; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }

ul { margin: 0; padding: 0; list-style: none; }

button, input, textarea, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-alt); }
.section--tint {
  background:
    radial-gradient(1100px 480px at 12% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--bg-alt);
}

/* Anchor offset for the sticky header */
[id] { scroll-margin-top: 88px; }

.skip-link {
  position: absolute;
  left: 50%;
  translate: -50% -150%;
  z-index: 200;
  padding: .7rem 1.15rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: translate .2s var(--ease);
}
.skip-link:focus-visible { translate: -50% 0; color: var(--accent-ink); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Section heading ---------- */
.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2.25rem, 4vw, 3.5rem);
}
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  padding: .34rem .8rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: .755rem;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.section-lead {
  color: var(--text-soft);
  font-size: 1.06em;
  margin-bottom: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .78rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 100px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .95rem;
  font-weight: 620;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover {
  background: var(--accent-strong);
  color: var(--accent-ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn:active { transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--ghost {
  background: transparent;
  border-color: var(--border-2);
  color: var(--text);
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: none;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease),
              background .25s var(--ease);
}
@supports (backdrop-filter: blur(1px)) {
  .header { backdrop-filter: saturate(180%) blur(14px); }
}
.header.is-stuck {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-right: auto;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
  white-space: nowrap;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--highlight)));
  color: var(--accent-ink);
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: -.03em;
}
.brand:hover { color: var(--text); }

.nav__list {
  display: flex;
  align-items: center;
  gap: .1rem;
}
.nav__link {
  display: block;
  position: relative;
  padding: .5rem .68rem;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: .885rem;
  font-weight: 560;
  text-decoration: none;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav__link:hover { color: var(--text); background: var(--surface-2); }
.nav__link[aria-current="true"] { color: var(--accent-strong); }
.nav__link[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: .68rem; right: .68rem; bottom: .18rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.header__tools { display: flex; align-items: center; gap: .4rem; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.icon-btn:hover { color: var(--accent-strong); border-color: var(--accent); }
.icon-btn svg { width: 19px; height: 19px; }

.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle { display: none; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open  { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 960px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed;
    inset: 68px 0 auto;
    max-height: calc(100dvh - 68px);
    padding: .6rem var(--gutter) 1.4rem;
    overflow-y: auto;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    translate: 0 -8px;
    transition: opacity .2s var(--ease), translate .2s var(--ease), visibility .2s;
  }
  .nav.is-open { opacity: 1; visibility: visible; translate: 0; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__link { padding: .8rem .4rem; font-size: 1rem; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav__link[aria-current="true"]::after { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3.5rem, 8vw, 6.5rem);
  overflow: hidden;
  background:
    radial-gradient(760px 460px at 82% 6%,  color-mix(in srgb, var(--accent)    18%, transparent), transparent 68%),
    radial-gradient(680px 420px at 6%  78%, color-mix(in srgb, var(--highlight) 13%, transparent), transparent 66%),
    var(--bg);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right,  color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 60% at 50% 34%, #000 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 34%, #000 20%, transparent 100%);
  pointer-events: none;
}
.hero > * { position: relative; }

.hero__grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; max-width: 340px; margin-inline: auto; }
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1.4rem;
  padding: .4rem .9rem .4rem .55rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: .82rem;
  font-weight: 560;
  color: var(--text-soft);
}
.pulse {
  position: relative;
  width: 9px; height: 9px;
  margin-left: .2rem;
  border-radius: 50%;
  background: var(--accent);
}
.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: .55;
  animation: pulse 2.2s var(--ease) infinite;
}
@keyframes pulse {
  0%   { transform: scale(.55); opacity: .7; }
  70%  { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}

.hero h1 { margin-bottom: .35em; }
.hero h1 .accent {
  background: linear-gradient(100deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #22c55e));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__role {
  margin-bottom: 1rem;
  font-size: clamp(1.05rem, .95rem + .6vw, 1.35rem);
  font-weight: 620;
  color: var(--text);
}
.hero__role .sep { color: var(--border-2); margin-inline: .45rem; font-weight: 400; }

.hero__text {
  max-width: 40rem;
  color: var(--text-soft);
  font-size: 1.06em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.9rem;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.1rem;
  margin-top: 2.6rem;
  padding-top: 1.9rem;
  border-top: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; }
.stat__num {
  display: block;
  font-size: clamp(1.55rem, 1.2rem + 1.2vw, 2rem);
  font-weight: 750;
  letter-spacing: -.03em;
  line-height: 1.1;
  color: var(--text);
}
.stat__num .plus { color: var(--accent); }
.stat__label {
  font-size: .8rem;
  font-weight: 560;
  color: var(--text-mute);
  letter-spacing: .01em;
}

/* Hero portrait.
   The photo is cut out on a white matte, so the card stays white in both
   themes — otherwise the matte reads as a white box on a tinted card. */
.hero__media { position: relative; }
.hero__media::before {
  content: "";
  position: absolute;
  inset: 12% -6% -4% -6%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 34%, transparent), transparent);
  filter: blur(38px);
  pointer-events: none;
}
.portrait {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 928 / 1033;
}
.portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
}
.portrait::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 26%;
  background: linear-gradient(to top, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
  pointer-events: none;
}

.badge-float {
  position: absolute;
  left: -12px;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.badge-float svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.badge-float b { display: block; font-size: .9rem; line-height: 1.3; }
.badge-float span { font-size: .76rem; color: var(--text-mute); }
@media (max-width: 900px) { .badge-float { left: -6px; } }

/* ---------- About ---------- */
.about__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 900px) { .about__grid { grid-template-columns: 1fr; } }

.prose { color: var(--text-soft); }
.prose strong { color: var(--text); font-weight: 620; }

.about__aside {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 92px;
}
@media (max-width: 900px) { .about__aside { position: static; } }

.fact-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.fact-list { display: grid; gap: .95rem; }
.fact {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: .85rem;
  align-items: start;
}
.fact svg { width: 34px; height: 34px; padding: 7px; border-radius: 9px; background: var(--surface-2); color: var(--accent); }
.fact dt { font-size: .76rem; font-weight: 640; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); }
.fact dd { margin: 0; font-size: .94rem; font-weight: 560; }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  padding: .35rem .75rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface-2);
  font-size: .82rem;
  font-weight: 560;
  color: var(--text-soft);
}

.lang-list { display: grid; gap: 1rem; }
.lang__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: .4rem;
}
.lang__top b { font-size: .92rem; font-weight: 620; }
.lang__top span { font-size: .78rem; color: var(--text-mute); }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1rem;
}
.skill {
  padding: 1.35rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.skill:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.skill__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: .75rem;
}
.skill__name { font-size: .98rem; font-weight: 620; }
.skill__val {
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 7px;
  border-radius: 100px;
  background: var(--surface-2);
  overflow: hidden;
}
:root[data-theme="dark"] .bar { background: var(--border); }
.bar__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--highlight)));
  transition: width 1.1s var(--ease);
}

/* ---------- Interests ---------- */
.interests {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}
.interest {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  padding: 1.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  transition: border-color .2s var(--ease), transform .2s var(--ease), background .2s var(--ease);
}
.interest:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  transform: translateY(-3px);
}
.interest svg { width: 26px; height: 26px; color: var(--accent); }
.interest span { font-size: .9rem; font-weight: 570; }

/* ---------- Timeline (experience) ---------- */
.timeline {
  display: grid;
  gap: 1.1rem;
  position: relative;
  padding-left: 2.1rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: .6rem; bottom: .6rem;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--accent), color-mix(in srgb, var(--accent) 12%, transparent));
}
.tl-item { position: relative; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -2.1rem; top: 1.65rem;
  width: 16px; height: 16px;
  border-radius: 50%;
  /* Filled rather than a ring, so it works over any section background */
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent);
}

.card {
  padding: clamp(1.35rem, 2.6vw, 1.9rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.card:hover { border-color: var(--border-2); box-shadow: var(--shadow-md); }

.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-bottom: .3rem;
}
.tl-head h3 { margin: 0; }
.tag {
  padding: .3rem .7rem;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: .76rem;
  font-weight: 640;
  letter-spacing: .02em;
  white-space: nowrap;
}
.tag--muted { background: var(--surface-2); color: var(--text-mute); }

.tl-role {
  margin-bottom: .9rem;
  font-size: .93rem;
  font-weight: 570;
  color: var(--accent-strong);
}

.bullets { display: grid; gap: .5rem; margin-bottom: 1.1rem; color: var(--text-soft); }
.bullets li {
  position: relative;
  padding-left: 1.35rem;
  font-size: .95rem;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: .3rem; top: .72em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.meta-line {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding-top: .95rem;
  border-top: 1px solid var(--border);
  font-size: .85rem;
  color: var(--text-mute);
}
.meta-line svg { width: 16px; height: 16px; flex: none; margin-top: .28em; }

/* ---------- Education ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.1rem;
}

.edu { display: flex; gap: 1.1rem; }
.edu__icon {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  flex: none;
  border-radius: 12px;
  background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--highlight)));
  color: var(--accent-ink);
}
.edu__icon svg { width: 24px; height: 24px; }
.edu h3 { margin-bottom: .15rem; font-size: 1.12rem; }
.edu__degree { margin-bottom: .5rem; font-size: .92rem; font-weight: 600; color: var(--accent-strong); }
.edu dl { display: grid; gap: .3rem; margin: 0; font-size: .875rem; color: var(--text-soft); }
.edu dl div { display: flex; gap: .4rem; }
.edu dt { color: var(--text-mute); font-weight: 560; }
.edu dd { margin: 0; }

/* ---------- Projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.4rem;
}
.project {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.project__media { position: relative; background: var(--surface-2); }

/* CSS scroll-snap carousel — replaces the slick.js slider */
.shots {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  aspect-ratio: 16 / 9;
}
.shots::-webkit-scrollbar { display: none; }
.shots img {
  flex: 0 0 100%;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  scroll-snap-align: center;
  cursor: zoom-in;
}

.shots-nav {
  position: absolute;
  inset: auto 0 .6rem;
  display: flex;
  justify-content: center;
  gap: .35rem;
}
.dot {
  width: 7px; height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / .55);
  box-shadow: 0 0 0 1px rgb(0 0 0 / .18);
  cursor: pointer;
  transition: width .22s var(--ease), background .22s var(--ease);
}
.dot[aria-current="true"] { width: 20px; border-radius: 100px; background: #fff; }

.shots-arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / .82);
  color: #0f1b24;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s var(--ease), background .2s var(--ease);
}
.shots-arrow svg { width: 18px; height: 18px; }
.shots-arrow--prev { left: .5rem; }
.shots-arrow--next { right: .5rem; }
.project__media:hover .shots-arrow,
.shots-arrow:focus-visible { opacity: 1; }
.shots-arrow:hover { background: #fff; }

.project__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.35rem 1.4rem 1.5rem;
}
.project__body h3 { margin-bottom: .45rem; }
.project__body p { color: var(--text-soft); font-size: .93rem; }
.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: auto;
  padding-top: 1.1rem;
}
.project__tags .chip { font-size: .76rem; padding: .28rem .62rem; }

/* ---------- Gallery: 3D coverflow deck ----------
   The deck is a JS component: its slides carry data-src so only the cards
   near the front are ever fetched. It stays hidden until main.js adds
   .is-ready, and the <noscript> masonry below stands in when there is no
   JS at all. */
.deck { position: relative; display: none; }
.deck.is-ready { display: block; }

.deck__track { margin: 0; padding: 0; list-style: none; }
.deck__card {
  display: block;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}

/* No-JS fallback: the same photos as a plain masonry grid */
.gallery-fallback {
  column-count: 3;
  column-gap: .85rem;
}
@media (max-width: 900px) { .gallery-fallback { column-count: 2; } }
@media (max-width: 540px) { .gallery-fallback { column-count: 1; } }
.gallery-fallback img {
  width: 100%;
  height: auto;
  margin-bottom: .85rem;
  border-radius: var(--radius-sm);
  break-inside: avoid;
}

/* ---- Enhanced state ---- */
.deck.is-ready .deck__stage {
  position: relative;
  /* Cards are sized by height, so the height has to track the viewport
     width or a landscape photo overflows on small screens. */
  height: clamp(230px, 52vw, 520px);
  perspective: 1500px;
  perspective-origin: 50% 50%;
  /* room for the rotated neighbours to spill past the container */
  margin-inline: calc(var(--gutter) * -1);
  overflow: hidden;
  touch-action: pan-y;
}
.deck.is-ready .deck__track {
  display: block;
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

/* Feather the fan into the section background instead of cutting it off.
   Kept as gradients rather than a mask so the 3D context stays intact. */
.deck.is-ready .deck__stage::before,
.deck.is-ready .deck__stage::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: clamp(30px, 7%, 100px);
  z-index: 60;
  pointer-events: none;
}
.deck.is-ready .deck__stage::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-alt), transparent);
}
.deck.is-ready .deck__stage::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-alt), transparent);
}

/* transform and opacity are written by main.js so the fan geometry can be
   derived from the measured stage width rather than guessed in CSS. */
.deck.is-ready .deck__slide {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 100%;
  width: auto;
  transform-origin: 50% 50%;
  /* A long decelerating tail reads as weight settling rather than a slide
     stopping dead. */
  transition: transform .62s var(--ease-out), opacity .62s var(--ease-out);
  backface-visibility: hidden;
}
/* Mid-drag the position is driven frame by frame, so the transition has to
   be out of the way or every frame would fight the last one. */
.deck.is-dragging .deck__slide { transition: none; }

/* Promote only while it matters. Leaving will-change on all 23 slides would
   hold 23 compositor layers alive for the life of the page. */
.deck.is-dragging .deck__slide:not([data-far]) { will-change: transform, opacity; }

/* Slides beyond the visible window are parked and inert */
.deck.is-ready .deck__slide[data-far] { pointer-events: none; }

.deck.is-ready .deck__card {
  width: auto;
  height: 100%;
  border-radius: var(--radius);
  box-shadow: 0 24px 50px -18px rgb(6 18 24 / .5);
  cursor: pointer;
  transition: box-shadow .4s var(--ease);
}
.deck.is-ready .deck__card img {
  width: auto;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

/* Neighbours are dimmed and slightly desaturated so the front photo leads */
.deck.is-ready .deck__slide:not([data-current]) .deck__card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 38%, transparent);
  transition: background .45s var(--ease);
}
.deck.is-ready .deck__card { position: relative; }
.deck.is-ready .deck__slide:not([data-current]) .deck__card:hover::after {
  background: color-mix(in srgb, var(--bg) 12%, transparent);
}

/* The front photo: lifted, undimmed, zoomable */
.deck.is-ready .deck__slide[data-current] .deck__card {
  cursor: zoom-in;
  box-shadow: 0 40px 80px -24px rgb(6 18 24 / .62);
}

/* ---- Arrows ---- */
.deck.is-ready .deck__arrow {
  position: absolute;
  top: clamp(150px, 23vw, 260px);
  translate: 0 -50%;
  z-index: 70;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), transform .18s var(--ease);
}
@supports (backdrop-filter: blur(1px)) {
  .deck.is-ready .deck__arrow { backdrop-filter: blur(8px); }
}
.deck__arrow--prev { left: 0; }
.deck__arrow--next { right: 0; }
.deck.is-ready .deck__arrow:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: scale(1.07);
}
.deck.is-ready .deck__arrow:disabled { opacity: .35; cursor: default; transform: none; }
.deck__arrow svg { width: 21px; height: 21px; }

/* ---- Counter ---- */
.deck.is-ready .deck__count {
  display: block;
  margin: 1.4rem 0 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-mute);
}
.deck__count b { color: var(--text); font-weight: 700; }

/* ---- Thumbnail rail ---- */
.deck.is-ready .deck__rail {
  display: flex;
  gap: .4rem;
  justify-content: flex-start;
  margin-top: .9rem;
  padding: .3rem .2rem;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  /* Feather the ends so the strip reads as scrollable, not chopped off */
  mask-image: linear-gradient(to right, transparent, #000 3.5%, #000 96.5%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 3.5%, #000 96.5%, transparent);
}
.deck__rail::-webkit-scrollbar { display: none; }
.deck.is-ready .deck__thumb {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
  opacity: .5;
  filter: saturate(.65);
  transition: opacity .25s var(--ease), filter .25s var(--ease),
              outline-color .25s var(--ease), transform .25s var(--ease);
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.deck__thumb img { width: 100%; height: 100%; object-fit: cover; }
.deck.is-ready .deck__thumb:hover { opacity: .85; filter: none; transform: translateY(-2px); }
.deck.is-ready .deck__thumb[aria-selected="true"] {
  opacity: 1;
  filter: none;
  outline-color: var(--accent);
}

@media (max-width: 640px) {
  .deck.is-ready .deck__arrow { width: 40px; height: 40px; }
  .deck.is-ready .deck__thumb { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .deck.is-ready .deck__rail { scroll-behavior: auto; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(.75rem, 3vw, 2.5rem);
  background: rgb(6 12 16 / .93);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s var(--ease), visibility .25s;
}
@supports (backdrop-filter: blur(1px)) {
  .lightbox { backdrop-filter: blur(6px); }
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__img {
  max-width: 100%;
  max-height: 86dvh;
  border-radius: var(--radius-sm);
  object-fit: contain;
  box-shadow: 0 30px 90px -30px rgb(0 0 0 / .9);
}
.lightbox__bar {
  position: absolute;
  top: clamp(.75rem, 3vw, 1.5rem);
  right: clamp(.75rem, 3vw, 1.5rem);
  display: flex;
  gap: .5rem;
}
.lb-btn {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid rgb(255 255 255 / .22);
  border-radius: 50%;
  background: rgb(255 255 255 / .1);
  color: #fff;
  cursor: pointer;
  transition: background .18s var(--ease);
}
.lb-btn:hover { background: rgb(255 255 255 / .22); }
.lb-btn svg { width: 20px; height: 20px; }
.lb-nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
}
.lb-nav--prev { left: clamp(.5rem, 3vw, 1.75rem); }
.lb-nav--next { right: clamp(.5rem, 3vw, 1.75rem); }
.lightbox__count {
  position: absolute;
  bottom: clamp(.75rem, 3vw, 1.5rem);
  left: 50%;
  translate: -50% 0;
  padding: .35rem .85rem;
  border-radius: 100px;
  background: rgb(255 255 255 / .12);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- Contact ---------- */
.contact__grid {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}

.field { margin-bottom: 1.05rem; }
.field label {
  display: block;
  margin-bottom: .4rem;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text-soft);
}
.field label .req { color: #e11d48; }
.field input,
.field textarea {
  width: 100%;
  padding: .8rem .95rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: .95rem;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-mute); opacity: .75; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field textarea { min-height: 132px; resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 1rem;
}
.form-note { margin-top: .9rem; font-size: .82rem; color: var(--text-mute); }

.contact-list { display: grid; gap: .8rem; margin-bottom: 1.2rem; }
.contact-item {
  display: flex;
  gap: .95rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
a.contact-item:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  transform: translateX(3px);
  color: inherit;
}
.contact-item svg { width: 20px; height: 20px; flex: none; margin-top: .2em; color: var(--accent); }
.contact-item dt { font-size: .75rem; font-weight: 640; letter-spacing: .07em; text-transform: uppercase; color: var(--text-mute); }
.contact-item dd { margin: 0; font-size: .92rem; font-weight: 560; line-height: 1.55; }

/* Map facade — the real iframe is only fetched on click */
.map {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(600px 300px at 30% 20%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--surface-2);
}
.map iframe { width: 100%; height: 100%; border: 0; }
.map__facade {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: .88rem;
  cursor: pointer;
}
.map__facade svg { width: 30px; height: 30px; color: var(--accent); }
.map__facade b { color: var(--text); font-size: .96rem; }

/* ---------- Footer ---------- */
.footer {
  padding-block: 2.4rem;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.1rem;
}
.footer p { margin: 0; font-size: .86rem; color: var(--text-mute); }
.footer p b { color: var(--text); font-weight: 620; }
.socials { display: flex; gap: .5rem; }
.socials a {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  transition: color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.socials a:hover { color: var(--accent-strong); border-color: var(--accent); transform: translateY(-2px); }
.socials svg { width: 17px; height: 17px; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: clamp(.9rem, 3vw, 1.6rem);
  bottom: clamp(.9rem, 3vw, 1.6rem);
  z-index: 90;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  translate: 0 12px;
  transition: opacity .25s var(--ease), translate .25s var(--ease), visibility .25s, color .18s var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; translate: 0; }
.to-top:hover { color: var(--accent-strong); }
.to-top svg { width: 19px; height: 19px; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  translate: 0 18px;
  transition: opacity .6s var(--ease), translate .6s var(--ease);
}
.reveal.is-in { opacity: 1; translate: 0; }

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

@media print {
  .header, .to-top, .lightbox, .shots-nav, .shots-arrow, .map, .socials { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding-block: 1.5rem; }
}

.deck__hint {
  margin: .85rem 0 0;
  text-align: center;
  font-size: .8rem;
  color: var(--text-mute);
}

/* ---------- Contact form feedback ---------- */
.form-flash {
  margin-bottom: 1.1rem;
  padding: .8rem 1.05rem;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: .9rem;
}
.form-flash.is-good {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent-strong);
}
.form-flash.is-bad {
  border-color: color-mix(in srgb, #e11d48 45%, var(--border));
  background: color-mix(in srgb, #e11d48 8%, var(--surface));
  color: #be123c;
}
:root[data-theme="dark"] .form-flash.is-bad { color: #fda4af; }

.field-error {
  display: block;
  margin-top: .35rem;
  font-size: .8rem;
  color: #e11d48;
}
:root[data-theme="dark"] .field-error { color: #fda4af; }
.field input.input-validation-error,
.field textarea.input-validation-error { border-color: #e11d48; }

/* Honeypot: off-screen rather than display:none, because some bots skip
   hidden inputs but happily fill one they can still "see" in the DOM. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
