/* ---------- tokens ---------- */
:root {
  --bg: #0a0a0b;
  --bg-1: #131216;
  --bg-2: #1c1a1e;
  --line: #29262b;
  --line-soft: #201e22;
  --text: #f4f2ec;
  --text-dim: #c8c4bd;
  --muted: #8d8983;
  --accent: #e2703f;
  --accent-ink: #180d06;
  --accent-dim: rgba(226, 112, 63, 0.14);
  --accent-line: rgba(226, 112, 63, 0.45);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --maxw: 1180px;
  --nav-h: 72px;

  /* viewport-fit=cover lets fixed layers reach under the iOS status bar and
     home indicator; these keep content out of those areas (0 elsewhere) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Sora", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

/* Anchors land with the section's top edge exactly under the nav; sections
   bring their own top padding. Any extra offset leaves the stats band's
   bottom border peeking out right under the nav when jumping to #work. */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--safe-top));
}

html, body { margin: 0; background: var(--bg); }

body {
  position: relative;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 15% 0%, #19171a 0%, transparent 45%),
    radial-gradient(circle at 85% 10%, #171316 0%, transparent 40%),
    var(--bg);
}

/* Grain overlay. Keep it below .nav (50) and #mobile-nav (45): iOS 26 Safari
   picks the status bar / toolbar tint by hit-testing the middle of each screen
   edge, pointer-events: none included. A hit on this pseudo-element counts as
   <body> (not fixed), so while it sat on top Safari found no bar to tint from
   and both strips showed the page scrolling through. */
body::before {
  content: "";
  position: fixed;
  inset: -10%;
  pointer-events: none;
  z-index: 40;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-left: max(clamp(20px, 5vw, 48px), var(--safe-left));
  padding-right: max(clamp(20px, 5vw, 48px), var(--safe-right));
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

section { position: relative; }

.section-head {
  max-width: 640px;
  margin-bottom: 44px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin-bottom: 12px;
}

.section-head p {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 52ch;
}

/* ---------- reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

#scroll-sentinel { position: absolute; top: 0; height: 1px; width: 1px; }

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: top 0.2s ease;
}

.skip-link:focus { top: calc(16px + var(--safe-top)); }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  height: calc(var(--nav-h) + var(--safe-top));
  padding-top: var(--safe-top);
  z-index: 50;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  background: transparent;
  transform: translateZ(0);
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* iOS 26 Safari paints the status bar strip with the background-color of the
   fixed element at the top edge: at full alpha if it's >= 0.75, otherwise
   blended with the page background. */
.nav.is-scrolled {
  background: rgba(10, 10, 11, 0.97);
  border-bottom-color: var(--line);
}

.nav .wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-toggle {
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease;
}

.lang-toggle:hover { border-color: var(--accent-line); }

.lang-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--text);
  align-items: center;
  justify-content: center;
}

.nav-toggle svg { width: 20px; height: 20px; }

.mobile-nav { display: none; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }

  .mobile-nav {
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    padding: calc(var(--nav-h) + var(--safe-top)) var(--safe-right) var(--safe-bottom) var(--safe-left);
    z-index: 45;
    /* Frosted glass. With a backdrop-filter iOS 26 Safari fills the status
       bar / toolbar strips with the page background (--bg) instead of this
       colour, so the glass fades into --bg at both ends to meet them without
       a hard edge. */
    background:
      linear-gradient(var(--bg), transparent calc(var(--nav-h) + var(--safe-top)), transparent calc(100% - 96px), var(--bg)),
      rgba(10, 10, 11, 0.72);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    /* display flips to none only after the fade-out. Safari keeps painting
       the toolbar strip with the last edge element's look for as long as
       that element is still rendered, so an opacity: 0 menu left the strip
       tinted after closing; display: none drops it straight away. */
    transition: opacity 0.25s ease, transform 0.25s ease, display 0.25s;
    transition-behavior: allow-discrete;
  }
  .mobile-nav.is-open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  @starting-style {
    .mobile-nav.is-open {
      opacity: 0;
      transform: translateY(-8px);
    }
  }
  .mobile-nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .mobile-nav-links a { font-size: 1.3rem; color: var(--text); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.94rem;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), border-color 0.2s ease, background 0.2s ease;
}

.btn:active { transform: scale(0.97); }

.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover { transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--accent-line); }

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-h) + var(--safe-top) + 24px);
  padding-bottom: 48px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  width: 100%;
}

.hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.5rem);
  line-height: 1.1;
}

.hero-sub {
  margin-top: 22px;
  max-width: 46ch;
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.hero-cta {
  display: flex;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.phone-stack {
  position: relative;
  height: 520px;
}

.phone {
  position: absolute;
  width: 220px;
  border-radius: 34px;
  padding: 8px;
  background: #050506;
  border: 1px solid #2c2a2d;
  box-shadow: 0 30px 70px -25px rgba(0, 0, 0, 0.75);
  transition: transform 0.5s var(--ease);
}

.phone::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 18px;
  background: #050506;
  border-radius: var(--radius-pill);
  z-index: 2;
}

.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26px;
}

.phone-boosty {
  right: 4%;
  top: 8%;
  width: 240px;
  z-index: 3;
}

.phone-city {
  left: 0;
  top: 0;
  width: 190px;
  transform: rotate(-9deg);
  z-index: 2;
}

.phone-fintuity {
  right: 0;
  bottom: 0;
  width: 190px;
  transform: rotate(8deg);
  z-index: 1;
}

.phone-stack:hover .phone-boosty { transform: translateY(-6px); }
.phone-stack:hover .phone-city { transform: rotate(-11deg) translateY(4px); }
.phone-stack:hover .phone-fintuity { transform: rotate(10deg) translateY(4px); }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .phone-stack { height: 380px; margin-inline: auto; max-width: 320px; }
}

@media (max-width: 560px) {
  .phone-city, .phone-fintuity { display: none; }
  .phone-boosty { position: static; width: 220px; margin-inline: auto; transform: none !important; }
  .phone-stack { height: auto; }
}

/* ---------- stats ---------- */
.stats {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-block: 32px;
}

.stats .wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat-num {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  color: var(--text);
  font-weight: 500;
}

.stat-label {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

@media (max-width: 720px) {
  .stats .wrap { grid-template-columns: repeat(2, 1fr); row-gap: 28px; }
}

/* ---------- work / bento ---------- */
#work, #experience, #skills, #connect { padding-block: clamp(72px, 10vw, 120px); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas:
    "boosty boosty boosty city"
    "boosty boosty boosty city"
    "fin fin vl vl";
  gap: 18px;
}

.work-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.work-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(220px circle at var(--x, 50%) var(--y, 50%), var(--accent-dim), transparent 70%);
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.work-card:hover::before { opacity: 1; }
.work-card:hover { border-color: var(--accent-line); }

.card-boosty { grid-area: boosty; }
.card-city { grid-area: city; }
.card-fintuity { grid-area: fin; }
.card-verslibre { grid-area: vl; }

.work-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.work-icon {
  width: 46px;
  height: 46px;
  border-radius: 30%;
  object-fit: cover;
  border: 1px solid var(--line);
  flex: none;
}

.work-title { font-size: 1.05rem; font-weight: 600; }

.work-role {
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 2px;
}

.work-shot {
  position: relative;
  display: block;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  padding: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  aspect-ratio: 16 / 9;
}

/* Landscape promo art fills one shared 16:9 frame so side-by-side cards line
   up; Citymobil's card still uses a portrait App Store screenshot, so that
   one keeps its own ratio and is cropped to its top. */
.card-city .work-shot { aspect-ratio: auto; max-height: 260px; }

.work-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

.work-shot::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 9, 11, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.work-shot-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: scale(0.9);
  color: var(--text);
}

.work-shot-hint svg {
  width: 22px;
  height: 22px;
  padding: 12px;
  border-radius: 50%;
  background: rgba(10, 9, 11, 0.6);
  border: 1px solid rgba(244, 242, 236, 0.25);
  box-sizing: content-box;
}

.work-shot:hover::before,
.work-shot:focus-visible::before {
  opacity: 1;
}

.work-shot:hover .work-shot-hint,
.work-shot:focus-visible .work-shot-hint {
  opacity: 1;
  transform: scale(1);
}

.work-shot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.work-desc {
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-dim);
}

.work-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.work-tags {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.work-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.work-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
}

.work-link svg { width: 15px; height: 15px; }

.work-inactive {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

.work-icon-plate {
  width: 46px;
  height: 46px;
  border-radius: 30%;
  background: #efe8d8;
  border: 1px solid var(--line);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.work-icon-plate img { width: 100%; height: 100%; object-fit: contain; }

@media (max-width: 860px) {
  .work-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "boosty"
      "city"
      "fin"
      "vl";
  }
}

/* ---------- experience timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
  margin-left: 6px;
}

.timeline-item {
  position: relative;
  padding: 22px 0 22px 32px;
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  border-top: 1px solid var(--line-soft);
}

.timeline-item:first-child { border-top: none; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 28px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-when {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  padding-top: 2px;
}

.timeline-role { font-weight: 600; font-size: 1rem; }

.timeline-org { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }

.timeline-desc {
  margin-top: 8px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 60ch;
}

@media (max-width: 640px) {
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- skills ---------- */
.skill-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding-block: 22px;
  border-top: 1px solid var(--line-soft);
}

.skill-row:first-child { border-top: 1px solid var(--line); }

.skill-cat {
  font-weight: 600;
  font-size: 0.98rem;
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--text-dim);
}

@media (max-width: 640px) {
  .skill-row { grid-template-columns: 1fr; gap: 10px; }
}

/* ---------- connect ---------- */
.connect-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.connect-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-1);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.connect-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(240px circle at var(--x, 50%) var(--y, 50%), var(--accent-dim), transparent 70%);
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.connect-card:hover::before { opacity: 1; }
.connect-card:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.connect-card:active { transform: translateY(0) scale(0.99); }
.connect-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.connect-avatar {
  width: 60px;
  height: 60px;
  border-radius: 30%;
  object-fit: cover;
  border: 1px solid var(--line);
  flex: none;
  position: relative;
}

.connect-avatar-plain {
  width: 60px;
  height: 60px;
  border-radius: 30%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.connect-avatar-plain svg { width: 26px; height: 26px; color: var(--accent); }

.connect-body { flex: 1; min-width: 0; }

.connect-name {
  font-weight: 600;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.connect-handle {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

.connect-cta {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.connect-cta svg { width: 15px; height: 15px; }

@media (max-width: 560px) {
  .connect-card { flex-wrap: wrap; row-gap: 10px; }
  .connect-cta { flex-basis: 100%; margin-left: 80px; }
}

/* ---------- lightbox ---------- */
body.lightbox-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(72px + var(--safe-top)) calc(24px + var(--safe-right)) calc(72px + var(--safe-bottom)) calc(24px + var(--safe-left));
  /* no backdrop-filter, same iOS 26 toolbar-tint reason as .nav */
  background: rgba(6, 5, 6, 0.95);
  animation: lightbox-fade 0.25s var(--ease);
}

.lightbox[hidden] { display: none; }

@keyframes lightbox-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: min(90vw, 720px);
}

.lightbox-viewport {
  position: relative;
  width: 100%;
  height: min(78vh, 640px);
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  background: var(--bg-1);
  touch-action: pan-y;
}

.lightbox-track {
  display: flex;
  width: 300%;
  height: 100%;
  transform: translateX(-33.3334%);
}

.lightbox-track.is-dragging { transition: none; }
.lightbox-track.is-settling { transition: transform 0.32s var(--ease); }

.lightbox-slide {
  flex: none;
  width: 33.3334%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.lightbox-close svg,
.lightbox-nav svg { width: 20px; height: 20px; }

.lightbox-close:hover,
.lightbox-nav:hover { border-color: var(--accent-line); }

.lightbox-close:active,
.lightbox-nav:active { transform: scale(0.94); }

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lightbox-close { top: calc(24px + var(--safe-top)); right: calc(24px + var(--safe-right)); }
.lightbox-prev { left: calc(24px + var(--safe-left)); top: 50%; transform: translateY(-50%); }
.lightbox-next { right: calc(24px + var(--safe-right)); top: 50%; transform: translateY(-50%); }
.lightbox-prev:active { transform: translateY(-50%) scale(0.94); }
.lightbox-next:active { transform: translateY(-50%) scale(0.94); }

.lightbox-nav[hidden] { display: none; }

@media (max-width: 640px) {
  .lightbox { padding: calc(88px + var(--safe-top)) calc(16px + var(--safe-right)) calc(64px + var(--safe-bottom)) calc(16px + var(--safe-left)); }
  .lightbox-close { top: calc(16px + var(--safe-top)); right: calc(16px + var(--safe-right)); width: 40px; height: 40px; }
  .lightbox-prev { left: calc(8px + var(--safe-left)); }
  .lightbox-next { right: calc(8px + var(--safe-right)); }
  .lightbox-viewport { height: min(68vh, 640px); }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox { animation: none; }
  .lightbox-track.is-settling { transition: none; }
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding-top: 32px;
  padding-bottom: calc(32px + var(--safe-bottom));
}

footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--muted);
  transition: color 0.2s ease;
}

.footer-links a:hover { color: var(--text); }

/* ---------- fam page ---------- */
.intro {
  padding-block: calc(var(--nav-h) + var(--safe-top) + 56px) clamp(48px, 8vw, 72px);
}

.intro h1 {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  line-height: 1.15;
}

.intro p {
  margin-top: 18px;
  max-width: 60ch;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-dim);
}

#wishlist, #interests, #recommendations { padding-block: clamp(56px, 8vw, 96px); }

.wish-grid,
.interest-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.wish-grid { grid-template-columns: 1fr; }
.interest-grid { grid-template-columns: repeat(2, 1fr); }

.wish-grid > li,
.interest-grid > li {
  display: flex;
  list-style: none;
  min-width: 0;
  transition-delay: calc(var(--i, 0) * 70ms);
}

.wish-grid > li::marker,
.interest-grid > li::marker { content: none; }

.item-card {
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-1);
  transition: border-color 0.2s ease;
}

.item-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-soft);
}

.item-media img,
.interest-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.item-card:hover .item-media img,
.interest-tile:hover img { transform: scale(1.04); }

.item-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 22px;
}

.item-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(200px circle at var(--x, 50%) var(--y, 50%), var(--accent-dim), transparent 70%);
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.item-card:hover::before { opacity: 1; }
.item-card:hover { border-color: var(--accent-line); }

.item-category {
  display: inline-block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.item-title {
  position: relative;
  margin: 0;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.3;
  text-wrap: balance;
}

.item-note {
  position: relative;
  margin: 8px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-dim);
  text-wrap: pretty;
}

.item-link {
  position: relative;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
}

.item-link svg { width: 15px; height: 15px; }

.item-link { margin-top: auto; padding-top: 14px; align-self: flex-start; }

.interest-tile {
  position: relative;
  flex: 1;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-1);
  transition: border-color 0.2s ease;
}

.interest-tile:hover { border-color: var(--accent-line); }

.interest-tile img { position: absolute; inset: 0; }

.interest-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 10, 11, 0.85) 0%, rgba(10, 10, 11, 0) 55%);
  pointer-events: none;
}

.interest-name {
  position: absolute;
  z-index: 1;
  left: 18px;
  right: 18px;
  bottom: 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

@media (max-width: 599px) {
  .interest-grid { gap: 12px; }
  .interest-grid > li:last-child { grid-column: 1 / -1; }
  .interest-grid > li:last-child .interest-tile { aspect-ratio: 16 / 9; }
  .interest-name { left: 14px; right: 14px; bottom: 11px; font-size: 0.98rem; }
}

@media (min-width: 600px) {
  .wish-grid { grid-template-columns: repeat(2, 1fr); }
  .interest-grid { grid-template-columns: repeat(3, 1fr); }

  .wish-featured { grid-column: 1 / -1; }
  .wish-featured .item-card { flex-direction: row; }
  .wish-featured .item-media {
    flex: 0 0 46%;
    aspect-ratio: auto;
    min-height: 300px;
    border-bottom: 0;
    border-right: 1px solid var(--line-soft);
  }
  .wish-featured .item-media img { position: absolute; inset: 0; }
  .wish-featured .item-body { justify-content: center; padding: 28px 32px; }
  .wish-featured .item-link { margin-top: 0; }
  .wish-featured .item-title { font-size: 1.45rem; letter-spacing: -0.01em; }
}

@media (min-width: 1024px) {
  .wish-grid { grid-template-columns: repeat(4, 1fr); }
  .wish-featured { grid-column: span 2; }
}

@media (prefers-reduced-motion: reduce) {
  .item-media img, .interest-tile img { transition: none; }
  .item-card:hover .item-media img, .interest-tile:hover img { transform: none; }
}

.empty-state {
  padding: 40px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--muted);
  font-size: 0.94rem;
}
