/* ---- DARK MODE (default) ---- */
:root {
  --bg: #002952;
  --bg-section: #002b56;
  --bg-card: #003566;
  --bg-card-2: #003566;
  --line: rgba(255, 255, 255, 0.07);
  --line-soft: rgba(255, 255, 255, 0.05);
  --text: #f4f4f3;
  --text-dim: #b3b3b5;
  --text-faint: #85858a;
  --white: #fbfbfa;
  --invert: #f0f8ff;
  --invert-text: #1a1815;
  --hero-grad: linear-gradient(115deg, #002952 0%, #002952 30%, #002b56 60%, #003566 100%);
  --ph-grad: linear-gradient(135deg, #002b56 0%, #003566 100%);
  --ph-text: rgba(255, 255, 255, 0.13);
  --num-faint: rgba(255, 255, 255, 0.14);
  --icon-soft-bg: rgba(255, 255, 255, 0.04);
  --pill-bg: rgba(0, 53, 102, 0.55);
  --pill-border: rgba(255, 255, 255, 0.08);
  --navpill-bg: rgba(0, 53, 102, 0.2);
  --dot: rgba(255, 255, 255, 0.32);
  --dot-on: rgba(255, 255, 255, 0.9);
  --radius: 22px;
}

/* ---- LIGHT MODE ---- */
html.light {
  --bg: #f0f8ff;
  --bg-section: #e9f3fc;
  --bg-card: #d6ebff;
  --bg-card-2: #d6ebff;
  --line: rgba(20, 18, 15, 0.1);
  --line-soft: rgba(20, 18, 15, 0.07);
  --text: #1a1815;
  --text-dim: #504c45;
  --text-faint: #7d786e;
  --white: #1a1815;
  --invert: #002952;
  --invert-text: #f4f4f3;
  --hero-grad: linear-gradient(115deg, #f0f8ff 0%, #f0f8ff 28%, #e3f0fc 60%, #d6e8f7 100%);
  --ph-grad: linear-gradient(135deg, #e9f3fc 0%, #dceaf6 100%);
  --ph-text: rgba(20, 18, 15, 0.18);
  --num-faint: rgba(20, 18, 15, 0.18);
  --icon-soft-bg: rgba(20, 18, 15, 0.045);
  --pill-bg: rgba(255, 255, 255, 0.6);
  --pill-border: rgba(20, 18, 15, 0.1);
  --navpill-bg: rgba(255, 255, 255, 0.2);
  --dot: rgba(20, 18, 15, 0.28);
  --dot-on: rgba(20, 18, 15, 0.78);
}

html,
body {
  transition:
    background-color 0.35s ease,
    color 0.35s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  font-family:
    "Satoshi",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    "Satoshi",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  position: relative;
}

/* ============ CUSTOM CURSOR ============ */
/* a slim arrow that stays visible on both the light and dark themes */
:root {
  --cursor-arrow: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%3E%3Cpath%20d='M4%203%20L4%2023%20L9.6%2018.1%20L12.9%2025.6%20L15.8%2024.3%20L12.5%2017.1%20L19.8%2016.7%20Z'%20fill='%23002952'%20stroke='%23F0F8FF'%20stroke-width='1.4'%20stroke-linejoin='round'/%3E%3C/svg%3E")
    4 3;
  --cursor-pointer: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%3E%3Cpath%20d='M4%203%20L4%2023%20L9.6%2018.1%20L12.9%2025.6%20L15.8%2024.3%20L12.5%2017.1%20L19.8%2016.7%20Z'%20fill='%23F0F8FF'%20stroke='%23002952'%20stroke-width='1.4'%20stroke-linejoin='round'/%3E%3C/svg%3E")
    4 3;
}

html,
body {
  cursor: var(--cursor-arrow), auto;
}

a,
button,
label,
input[type="checkbox"],
input[type="radio"],
.feat-item,
.feat-card,
.cat-card,
.hd-btn,
.hd-dot,
.ghost-btn,
.mk-btn,
.cc-row {
  cursor: var(--cursor-pointer), pointer;
}

.wrap {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 clamp(18px, 2vw, 25px);
}

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

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

/* visually hidden but available to screen readers & search engines */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============ INTRO / PAGE-LOAD REVEAL ============ */
.intro {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition:
    transform 1.05s cubic-bezier(0.7, 0, 0.25, 1),
    opacity 0.45s ease 0.6s,
    visibility 0s linear 1.05s;
}

.intro-brand {
  font-family:
    "Satoshi",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-weight: 400;
  font-size: clamp(40px, 9vw, 104px);
  letter-spacing: 0.14em;
  color: var(--text);
  opacity: 0;
  transform: translateY(14px);
  animation: introBrandIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

@keyframes introBrandIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* the intro lifts away once the page is ready */
.intro.done {
  opacity: 0;
  transform: translateY(-100%);
  visibility: hidden;
  pointer-events: none;
}

/* hero drops in from the top, the projects area rises from the bottom */
.hero,
#projects {
  transition:
    opacity 1s ease,
    transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}
html.intro-active .hero {
  opacity: 0;
  transform: translateY(-110px);
}
html.intro-active #projects {
  opacity: 0;
  transform: translateY(80px);
}
html.intro-done #projects {
  transition-delay: 0.18s;
}

@media (prefers-reduced-motion: reduce) {
  .intro {
    transition: none;
  }
  .intro-brand {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .hero,
  #projects {
    transition: none;
  }
  html.intro-active .hero,
  html.intro-active #projects {
    opacity: 1;
    transform: none;
  }
}

/* placeholder for images user will upload */
.ph {
  background: var(--ph-grad);
  position: relative;
  overflow: hidden;
}

.ph::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ph-text);
  font-size: 12.6px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family:
    "Satoshi",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  text-align: center;
  padding: 10px;
}

/* ============ TOP BAR ============ */
.topbar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: 100%;
  max-width: 1920px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(22px + env(safe-area-inset-top)) clamp(28px, 3.6vw, 64px) 22px;
  padding-left: max(clamp(28px, 3.6vw, 64px), env(safe-area-inset-left));
  padding-right: max(clamp(28px, 3.6vw, 64px), env(safe-area-inset-right));
  transition:
    background-color 0.3s ease,
    padding 0.3s ease,
    box-shadow 0.3s ease,
    backdrop-filter 0.3s ease;
}

.topbar.scrolled {
  background: transparent;
  padding-top: calc(8px + env(safe-area-inset-top));
  padding-bottom: 8px;
}

.topbar.scrolled .brand-text {
  font-size: 25.3px;
}

.topbar.scrolled .tb-left {
  padding: 5px 20px;
}

.topbar.scrolled .theme-switch-wrapper {
  transform: scale(0.86);
}

.topbar.scrolled .nav-center {
  gap: 18px;
  padding: 6px 18px;
}

.topbar.scrolled .nav-center a {
  font-size: 11.5px;
  letter-spacing: 0.2em;
}

.tb-left {
  display: flex;
  align-items: center;
  overflow: visible;
  background: var(--navpill-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--pill-border);
  padding: 8px 26px;
  border-radius: 40px;
  transition: padding 0.3s ease;
}

.brand-text {
  font-family:
    "Satoshi",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-weight: 400;
  font-size: 32.2px;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--text);
  user-select: none;
  display: block;
  transition: font-size 0.3s ease;
}

.theme-switch-wrapper {
  transition: transform 0.3s ease;
}

.tb-end {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 26px;
  background: var(--navpill-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--pill-border);
  padding: 9px 24px;
  border-radius: 40px;
  transition:
    padding 0.3s ease,
    gap 0.3s ease;
}

.nav-center a {
  font-family:
    "Satoshi",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 12.6px;
  font-weight: 400;
  letter-spacing: 0.28em;
  color: var(--text);
  transition:
    opacity 0.25s,
    font-size 0.3s ease,
    letter-spacing 0.3s ease;
  white-space: nowrap;
}

.nav-center a:hover {
  opacity: 0.55;
}

/* ============ HERO ============ */
.hero {
  position: relative;
  z-index: 2;
  min-height: 700px;
  max-width: 1920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-slides {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  will-change: transform;
  visibility: hidden;
}

.hero-slide.active {
  transform: translateX(0);
}

.hl {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.s1 .hl {
  background-image: url("images/hero/hero-1.webp");
}

.s2 .hl {
  background-image: url("images/hero/hero-2.webp");
}

.s3 .hl {
  background-image: url("images/hero/hero-3.webp");
}

.s4 .hl {
  background-image: url("images/hero/hero-4.webp");
}

.s5 .hl {
  background-image: url("images/hero/hero-5.webp");
}

.s6 .hl {
  background-image: url("images/hero/hero-6.webp");
}

.s7 .hl {
  background-image: url("images/hero/hero-7.webp");
}

.s8 .hl {
  background-image: url("images/hero/hero-8.webp");
}

.s9 .hl {
  background-image: url("images/hero/hero-9.webp");
}

/* directional pad to switch hero images */
.hero-dpad {
  position: absolute;
  z-index: 6;
  right: clamp(30px, 3vw, 56px);
  bottom: 30px;
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(3, 48px);
  gap: 8px;
}

.hd-btn {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: transparent;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition:
    opacity 0.22s,
    transform 0.22s,
    background-color 0.22s;
}

.hd-btn svg {
  width: 23px;
  height: 23px;
}

.hd-btn:hover {
  background: transparent;
  transform: scale(1.12);
}

.hd-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.hd-up {
  grid-column: 2;
  grid-row: 1;
}

.hd-left {
  grid-column: 1;
  grid-row: 2;
}

.hd-right {
  grid-column: 3;
  grid-row: 2;
}

.hd-down {
  grid-column: 2;
  grid-row: 3;
}

/* 9-dot mini-map, centered in the middle cell of the d-pad (between the 4 arrows) */
.hd-dots {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;
  gap: 4px;
  width: 48px;
  height: 48px;
}

.hd-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition:
    background-color 0.25s,
    transform 0.25s;
}

.hd-dot.active {
  background: #fff;
  transform: scale(1.7);
}

/* attention-grabbing intro pulse */
@keyframes hd-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.45);
  }

  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(0, 0, 0, 0);
  }
}

.hd-btn {
  animation: hd-pulse 1.4s ease-in-out 1.9s 3 both;
}

.hd-up {
  animation-delay: 1.9s;
}

.hd-right {
  animation-delay: 2.1s;
}

.hd-down {
  animation-delay: 2.3s;
}

.hd-left {
  animation-delay: 2.5s;
}

.hd-btn:hover {
  animation: none;
}

/* ============ SECTION SHELL ============ */
section.block {
  padding: 104px 0;
}

/* AvA edge marks — scattered in the empty gaps between sections, with parallax */
.ava-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.ava-mark {
  position: absolute;
  font-family: "Satoshi", sans-serif;
  font-weight: 600;
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #fff;
  opacity: 0.13;
  user-select: none;
  will-change: transform;
}

html.light .ava-mark {
  color: #000;
  opacity: 0.24;
}

.block-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

/* project description that appears in the left column on card click */
.proj-desc {
  margin-top: 0;
  /* aligned with the gallery via JS */
  position: relative;
  z-index: 3;
  max-width: 260px;
  height: 600px;
  /* same height as the gallery images */
  padding: 28px 24px;
  background: var(--bg-card-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}

.proj-desc.in {
  opacity: 1;
  transform: none;
}

.proj-desc-title {
  font-size: 21.8px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.proj-desc-location {
  font-size: 13.8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 5px;
}

.proj-desc-text {
  font-size: 14.9px;
  line-height: 1.6;
  color: var(--text-dim);
  margin-top: 14px;
}

.proj-desc-specs {
  display: flex;
  gap: 28px;
  margin-top: auto;
  /* pushes year/area to the bottom of the box */
  padding-top: 14px;
}

.proj-desc-spec {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.proj-desc-spec .spec-value {
  font-size: 16.1px;
  font-weight: 500;
  color: var(--text);
}

/* word-by-word reveal for the project description text */
.proj-desc .word {
  display: inline-block;
  opacity: 0;
  will-change: opacity;
}

.proj-desc .word.in {
  opacity: 1;
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.block-title {
  font-family:
    "Satoshi",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-weight: 500;
  font-size: 39.1px;
  line-height: 1.15;
  letter-spacing: -0.4px;
}

.ghost-btn {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14.4px;
  padding: 9px 9px 9px 20px;
  border-radius: 30px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.25s ease;
  cursor: pointer;
  font-family:
    "Satoshi",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.ghost-btn .arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--invert);
  color: var(--invert-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.ghost-btn .arrow svg {
  width: 13px;
  height: 13px;
}

.ghost-btn:hover {
  background-color: #00437a;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

html.light .ghost-btn:hover {
  background-color: #c2e1ff;
  border-color: rgba(26, 24, 21, 0.5);
  box-shadow: inset 0 0 0 1px rgba(26, 24, 21, 0.5);
}

.ghost-btn.click-invert,
html.light .ghost-btn.click-invert {
  background: var(--invert);
  color: var(--invert-text);
  border-color: var(--invert);
}

.ghost-btn.click-invert .arrow,
html.light .ghost-btn.click-invert .arrow {
  background: var(--bg);
  color: var(--text);
}

/* ============ CATEGORIES ============ */
.cat-row {
  display: flex;
  gap: 30px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  cursor: grab;
  width: 100%;
  max-width: 100%;
}

.cat-row::-webkit-scrollbar {
  display: none;
}

.cat-row.dragging {
  cursor: grabbing;
}

.cat-row.dragging .cat-card {
  pointer-events: none;
}

.cat-card {
  flex: 0 0 clamp(380px, calc((100% - 2 * 30px) / 2.15), 520px);
  min-width: 380px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-card-2);
  border: 1px solid var(--line-soft);
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.25s ease;
}

/* hover: colour change like the buttons (no lift) */
.cat-card:hover,
.cat-card.active {
  background-color: #00437a;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

html.light .cat-card:hover,
html.light .cat-card.active {
  background-color: #c2e1ff;
  border-color: rgba(26, 24, 21, 0.5);
  box-shadow: inset 0 0 0 1px rgba(26, 24, 21, 0.5);
}

/* click: full colour invert, briefly */
.cat-card.click-invert,
html.light .cat-card.click-invert {
  background: var(--invert);
  color: var(--invert-text);
  border-color: var(--invert);
  box-shadow: none;
}

.cat-card.click-invert .nm,
html.light .cat-card.click-invert .nm {
  color: var(--invert-text);
}

.cat-card.click-invert .ic,
html.light .cat-card.click-invert .ic {
  color: var(--invert-text);
}

.cat-thumb {
  width: 100%;
  aspect-ratio: 1.618;
  height: auto;
  position: relative;
}

.cat-meta {
  padding: 11px 20px;
  display: flex;
  align-items: center;
  gap: 13px;
}

.cat-meta .ic {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  flex: 0 0 auto;
}

.cat-meta .ic svg {
  width: 18px;
  height: 18px;
}

.cat-meta .nm {
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.25;
}

/* ---- category sub-items: rectangles that appear below the cards ---- */
.cat-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  /* centered row of rectangles */
  margin-top: 26px;
  min-height: 1px;
}

/* outer frame stays put and clips, like a gallery cell */
.cat-sub-item {
  flex: 0 0 auto;
  border-radius: 14px;
  overflow: hidden;
  opacity: 0;
  cursor: default;
}

.cat-sub-item.in:not(.out) {
  opacity: 1;
}

/* inner box is what actually animates (drops in from above the clip line) */
.cat-sub-inner {
  padding: 14px 22px;
  background: var(--bg-card-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  font-size: 14.9px;
  font-weight: 400;
  white-space: nowrap;
}

.cat-sub-item.in:not(.out) .cat-sub-inner {
  -webkit-animation: sub-in 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  animation: sub-in 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.cat-sub-item.out {
  opacity: 1;
}

.cat-sub-item.out .cat-sub-inner {
  -webkit-animation: sub-out 0.18s cubic-bezier(0.55, 0.085, 0.68, 0.53) both;
  animation: sub-out 0.18s cubic-bezier(0.55, 0.085, 0.68, 0.53) both;
}

/* like the project gallery: the inner box slides down from behind the
     top clip line, and slides back up out of view on exit */
@keyframes sub-in {
  0% {
    transform: translateY(-100%);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes sub-out {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-100%);
  }
}

/* ============ HOW IT WORKS ============ */
.how-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.how-item {
  grid-column: span 3;
}

.how-item:nth-child(5) {
  grid-column: 2 / span 3;
}

.how-item:nth-child(6) {
  grid-column: 5 / span 3;
}

.how-item:nth-child(7) {
  grid-column: 8 / span 3;
}

.how-item {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 24px 22px;
  transition:
    border-color 0.45s ease,
    transform 0.45s ease;
}

.how-item:hover {
  border-color: rgba(240, 248, 255, 0.18);
  transform: translateY(-6px);
}

html.light .how-item:hover {
  border-color: rgba(0, 67, 122, 0.18);
}

.how-item .num {
  font-family:
    "Satoshi",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-weight: 500;
  font-size: 71.3px;
  color: var(--num-faint);
  line-height: 1;
}

.how-item .ic {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--icon-soft-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  margin: 30px 0 22px;
}

.how-item .ic svg {
  width: 16px;
  height: 16px;
}

.how-item h4 {
  font-size: 17.2px;
  font-weight: 500;
  margin-bottom: 10px;
}

.how-item p {
  font-size: 14.4px;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 200px;
}

/* ============ FEATURED ============ */
.feat-col {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  position: relative;
  margin-top: -44px;
}

.feat-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.feat-viewport::-webkit-scrollbar {
  display: none;
}

.feat-viewport.dragging {
  cursor: grabbing;
}

.feat-viewport.dragging .feat-card {
  pointer-events: none;
}

.feat-track {
  display: flex;
  gap: 18px;
  width: max-content;
  padding-bottom: 4px;
}

.feat-item {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
}

.feat-card {
  width: 100%;
  border-radius: 16px;
  background: var(--bg-card-2);
  border: 1px solid transparent;
  box-shadow: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.25s ease;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* hover: colour change like the buttons (no lift) */
.feat-card:hover,
.feat-card.active {
  background-color: #00437a;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

html.light .feat-card:hover,
html.light .feat-card.active {
  background-color: #c2e1ff;
  border-color: rgba(26, 24, 21, 0.5);
  box-shadow: inset 0 0 0 1px rgba(26, 24, 21, 0.5);
}

/* click: full colour invert, briefly */
.feat-card.click-invert,
html.light .feat-card.click-invert {
  background: var(--invert);
  color: var(--invert-text);
  border-color: var(--invert);
  box-shadow: none;
}

.feat-thumb {
  width: 100%;
  aspect-ratio: 1.618;
  height: auto;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

.feat-thumb img {
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.feat-card:hover .feat-thumb img {
  transform: scale(1.1);
}

.feat-meta {
  height: 64px;
  padding: 11px 16px;
  border-radius: 0 0 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feat-meta .ttl {
  font-size: 16.1px;
  font-weight: 500;
}

.feat-meta .arr {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: 0.25s;
}

.feat-meta .arr svg {
  width: 13px;
  height: 13px;
}

.feat-card:hover .arr,
.feat-card.active .arr {
  background: var(--invert);
  color: var(--invert-text);
  border-color: var(--invert);
}

/* ---- gallery: draggable horizontal train of the active project's images ---- */
.feat-item {
  position: relative;
  cursor: pointer;
}

.feat-card.active {
  outline: none;
  border-radius: 16px;
}

.feat-gallery {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 34px;
  padding: 0;
  display: flex;
  gap: 14px;
  align-items: stretch;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  cursor: grab;
}

.feat-gallery::-webkit-scrollbar {
  display: none;
}

.feat-gallery.dragging {
  cursor: grabbing;
}

.feat-gallery.dragging .g-img {
  pointer-events: none;
}

.feat-gallery .g-img {
  flex: 0 0 auto;
  height: 600px;
  /* fixed height for all images */
  width: auto;
  /* width follows each image's own ratio */
  overflow: hidden;
  border-radius: 18px;
  background: var(--bg-card-2);
  border: 0;
  outline: none;
  box-shadow: none;
  opacity: 0;
}

.feat-gallery .g-img img {
  width: auto;
  height: 100%;
  /* fill the 600px height, keep aspect ratio */
  display: block;
  object-fit: contain;
  /* never crop the image */
  border: 0;
  outline: none;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.feat-gallery .g-img.in {
  opacity: 1;
  -webkit-animation: slide-in-top 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  animation: slide-in-top 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.feat-gallery .g-img.out {
  -webkit-animation: slide-out-top 0.6s cubic-bezier(0.55, 0.085, 0.68, 0.53) both;
  animation: slide-out-top 0.6s cubic-bezier(0.55, 0.085, 0.68, 0.53) both;
}

@-webkit-keyframes slide-in-top {
  0% {
    -webkit-transform: translateY(-1000px);
    transform: translateY(-1000px);
    opacity: 0;
  }

  100% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slide-in-top {
  0% {
    -webkit-transform: translateY(-1000px);
    transform: translateY(-1000px);
    opacity: 0;
  }

  100% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }
}

@-webkit-keyframes slide-out-top {
  0% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }

  100% {
    -webkit-transform: translateY(-1000px);
    transform: translateY(-1000px);
    opacity: 0;
  }
}

@keyframes slide-out-top {
  0% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }

  100% {
    -webkit-transform: translateY(-1000px);
    transform: translateY(-1000px);
    opacity: 0;
  }
}

/* ============ ABOUT ============ */
.about-box {
  background: var(--bg-card-2);
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  padding: 80px 70px;
}

.about {
  margin: 20px 0 10px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 48px;
  align-items: start;
  padding: 20px 0;
}

.about-title {
  font-family:
    "Satoshi",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-weight: 500;
  font-size: 52.9px;
  line-height: 1.1;
  letter-spacing: -0.5px;
  transform: translate(300px, -30px);
}

.about-body {
  transform: translate(-300px, 50px);
}

.about-body p {
  font-size: 16.1px;
  color: #ffffff;
  line-height: 1.9;
  margin-bottom: 18px;
}

html.light .about-body p {
  color: #000000;
}

.about-body p:last-child {
  margin-bottom: 0;
}

/* ============ CTA + CONTACT + FEATS (3 borderless columns) ============ */
.cta-contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: stretch;
  background: var(--bg-card-2);
  border-radius: 24px;
  box-shadow: 0 0 0 1px var(--line-soft);
  overflow: hidden;
}

.cta-abstract {
  border-right: 1px solid var(--line-soft);
  min-height: 300px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  /* dark theme image (default) */
  background-image: url("images/abstract/abstract-dark.webp");
}

html.light .cta-abstract {
  /* light theme image */
  background-image: url("images/abstract/abstract-light.webp");
}

.cta-contact-row .cta-block {
  display: flex;
  align-items: center;
  padding: 48px;
  border-right: 1px solid var(--line-soft);
}

.cta-contact-row .feats-block {
  display: flex;
  align-items: center;
  padding: 48px 40px;
}

@media (max-width: 960px) {
  .cta-contact-row {
    grid-template-columns: 1fr;
  }

  .cta-abstract {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    min-height: 200px;
  }

  .cta-contact-row .cta-block {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 40px;
  }

  .cta-contact-row .feats-block {
    padding: 40px;
  }
}

/* ============ CTA ============ */
.cta-mid {
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.cta-mid h2 {
  font-family:
    "Satoshi",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-weight: 500;
  font-size: 46px;
  line-height: 1.12;
  letter-spacing: -0.5px;
}

.cta-mid p {
  font-size: 16.1px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-top: 20px;
  max-width: 340px;
}

.cta-mid .mk-btn {
  margin-top: 30px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14.9px;
  padding: 11px 11px 11px 24px;
  border-radius: 34px;
  cursor: pointer;
  font-family:
    "Satoshi",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.25s ease;
}

.cta-mid .mk-btn:hover {
  background-color: #00437a;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

html.light .cta-mid .mk-btn:hover {
  background-color: #c2e1ff;
  border-color: rgba(26, 24, 21, 0.5);
  box-shadow: inset 0 0 0 1px rgba(26, 24, 21, 0.5);
}

.cta-mid .mk-btn .a {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--invert);
  color: var(--invert-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.cta-mid .mk-btn .a svg {
  width: 13px;
  height: 13px;
}

.cta-mid .mk-btn.click-invert,
html.light .cta-mid .mk-btn.click-invert {
  background: var(--invert);
  color: var(--invert-text);
  border-color: var(--invert);
}

.cta-mid .mk-btn.click-invert .a,
html.light .cta-mid .mk-btn.click-invert .a {
  background: var(--bg);
  color: var(--text);
}

/* ---- CONTACT block in CTA ---- */
.cta-contact {
  display: flex;
  flex-direction: column;
  align-content: start;
  justify-content: center;
  height: 100%;
}

.cta-contact .cc-head {
  font-size: 39.1px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 22px;
}

.cta-contact .cc-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.cta-contact .cc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.cta-contact .cc-ic {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.cta-contact .cc-ic svg {
  width: 18px;
  height: 18px;
  display: block;
}

.cta-contact .cc-k {
  font-size: 14.9px;
  font-weight: 700;
  color: var(--text);
  min-width: 74px;
}

.cta-contact .cc-v {
  font-size: 14.9px;
  font-weight: 400;
  color: var(--text-dim);
  transition: color 0.2s;
}

.cta-contact .cc-row:hover .cc-v {
  color: var(--text);
}

/* ============ FOOTER NAV ============ */
footer {
  border-top: 1px solid var(--line-soft);
  padding: 48px 0 calc(40px + env(safe-area-inset-bottom));
}

.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 8px;
}

.foot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  max-width: 620px;
}

.foot-brand {
  font-size: 18px;
  letter-spacing: 0.16em;
  color: var(--text);
  text-transform: uppercase;
}

.foot-tagline {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 0;
}

.foot-copy {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-top: 4px;
}

/* responsive */

/* ---- TABLET (<=1080px) ---- */
@media (max-width: 1080px) {
  .block-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .block-title {
    font-size: 34.5px;
  }

  .ghost-btn {
    margin-top: 18px;
  }

  .about {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .about-title {
    font-size: 43.7px;
  }

  .cat-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    width: 100%;
    max-width: 100%;
    padding-bottom: 6px;
  }

  .cat-row::-webkit-scrollbar {
    display: none;
  }

  .cat-row.dragging {
    cursor: grabbing;
  }

  .cat-row.dragging > * {
    pointer-events: none;
  }

  .cat-card {
    flex: 0 0 420px;
  }

  .how-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 34px;
  }

  .how-item,
  .how-item:nth-child(5),
  .how-item:nth-child(6),
  .how-item:nth-child(7) {
    grid-column: auto;
    max-width: 100%;
  }

  .feat-item {
    flex: 0 0 240px;
  }
}

/* ===== MOBILE MENU ===== */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  margin: 0 auto;
  transition:
    transform 0.3s,
    opacity 0.3s;
}

.mm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.35s ease,
    visibility 0s linear 0.35s;
}

.mm-overlay.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease;
}

.mobile-menu {
  position: fixed;
  top: 0;
  bottom: 0;
  right: -100%;
  width: 74%;
  max-width: 320px;
  height: 100%;
  z-index: 9999;
  background: rgba(0, 28, 56, 0.6);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  transition: right 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding-top: calc(90px + env(safe-area-inset-top));
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  visibility: hidden;
}

html.light .mobile-menu {
  background: rgba(243, 241, 236, 0.62);
  border-left: 1px solid rgba(20, 18, 15, 0.14);
}

.mobile-menu.open {
  right: 0;
  visibility: visible;
}

.mm-links {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mm-links a {
  display: block;
  font-family:
    "Satoshi",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 19.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: #f4f4f3;
  text-decoration: none;
  padding: 18px 30px;
}

html.light .mm-links a {
  color: #1a1815;
}

.mm-links a:active {
  background: rgba(255, 255, 255, 0.06);
}

html.light .mm-links a:active {
  background: rgba(20, 18, 15, 0.05);
}

/* ---- MOBILE (<=760px) ---- */
@media (max-width: 760px) {
  /* ---------- nav ---------- */
  .nav-center {
    display: none;
  }
  .burger {
    display: flex;
  }
  .topbar {
    padding: 16px 16px;
    padding-top: calc(16px + env(safe-area-inset-top));
  }
  .tb-left {
    padding: 6px 16px;
  }
  .brand-text {
    font-size: 24px;
  }

  /* ---------- section rhythm (overrides the per-section inline paddings) ---------- */
  section.block {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
  }
  .block-title {
    font-size: 30px;
    line-height: 1.18;
  }

  /* ---------- hero ---------- */
  .hero {
    min-height: 62vh;
  }
  .hero-dpad {
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(20px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(3, 44px);
  }
  .hd-btn {
    width: 44px;
    height: 44px;
  }
  .hd-dots {
    width: 44px;
    height: 44px;
  }

  /* ---------- generic 2-col blocks collapse to one column ---------- */
  .block-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* ---------- projects ---------- */
  .proj-desc {
    /* drop the fixed desktop height/width so it wraps its own content */
    height: auto;
    max-width: none;
    margin-top: 0;
    padding: 22px 20px;
  }
  .proj-desc-title {
    font-size: 20px;
  }
  .feat-col {
    margin-top: 0;
  }

  /* full-bleed, swipeable card trains */
  .cat-row,
  .feat-viewport {
    margin-left: calc(-1 * clamp(16px, 4vw, 25px));
    margin-right: calc(-1 * clamp(16px, 4vw, 25px));
    width: auto;
    max-width: none;
    padding-left: clamp(16px, 4vw, 25px);
    padding-right: 0;
    scroll-padding-left: clamp(16px, 4vw, 25px);
  }
  .feat-track {
    padding-right: clamp(16px, 4vw, 25px);
  }
  .cat-row::after {
    content: "";
    flex: 0 0 clamp(16px, 4vw, 25px);
  }
  .feat-item {
    flex: 0 0 80vw;
  }
  .cat-card {
    flex: 0 0 80vw;
    min-width: 0; /* the desktop 380px floor would overflow a phone */
  }
  .feat-gallery {
    padding-left: clamp(16px, 4vw, 25px);
  }
  .feat-gallery .g-img {
    /* the desktop 600px image height is way too tall for a phone */
    height: 46vh;
    max-height: 360px;
  }

  /* ---------- about ---------- */
  .about-box {
    padding: 26px 20px;
    border-radius: 20px;
  }
  .about {
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 0;
    padding: 0;
  }
  /* these carry big desktop translate() offsets — clear them so the text
     stays inside its card on a narrow screen */
  .about-title,
  .about-body {
    transform: none;
  }
  .about-title {
    font-size: 32px;
  }
  .about-body p {
    font-size: 15px;
  }

  /* ---------- how it works ---------- */
  .how-row {
    display: flex;
    flex-direction: column;
    gap: 28px;
    overflow: visible;
  }
  .how-item {
    flex: 0 0 auto;
    max-width: 100%;
  }
  .how-item .num {
    font-size: 52px;
  }

  /* ---------- contact ---------- */
  .cta-contact-row .cta-block,
  .cta-contact-row .feats-block {
    padding: 30px 22px;
  }
  .cta-mid h2 {
    font-size: 28px;
  }
  .cta-mid .mk-btn {
    margin-top: 22px;
  }
  .cc-v {
    word-break: break-word;
  }
}

/* ---- SMALL MOBILE (<=480px) ---- */
@media (max-width: 480px) {
  .topbar {
    padding: 14px 14px;
    padding-top: calc(14px + env(safe-area-inset-top));
  }
  .tb-left {
    padding: 5px 14px;
  }
  .brand-text {
    font-size: 22px;
  }
  .block-title {
    font-size: 26px;
  }
  .feat-item,
  .cat-card {
    flex: 0 0 84vw;
  }
  .about-title {
    font-size: 28px;
  }
  .how-item .num {
    font-size: 46px;
  }
  .cta-mid h2 {
    font-size: 25px;
  }
  .intro-brand {
    letter-spacing: 0.1em;
  }
}

/* ===== CUSTOM DARK MODE TOGGLE ===== */
.theme-switch-wrapper {
  width: 51px;
  height: 26px;
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#toggle-label {
  cursor: pointer;
  outline: transparent;
  position: absolute;
  top: 0;
  left: 0;
  transform: scale(0.21);
  transform-origin: top left;
  display: block;
}

#toggle {
  display: none;
}

@media (max-width: 760px) {
  .theme-switch-wrapper {
    width: 36px;
    height: 18px;
  }

  #toggle-label {
    transform: scale(0.147);
  }
}

#toggle-div {
  height: 120px;
  width: 240px;
  background-color: #357bb3;
  border-radius: 100px;
  position: relative;
  overflow: hidden;
  transition: all 300ms ease;
  box-shadow:
    inset 2px 5px 5px rgba(0, 0, 0, 0.8),
    inset -2px -5px 5px rgba(0, 0, 0, 0.2);
}

.backdrops {
  position: absolute;
  left: 10px;
  top: 10px;
  height: 100px;
  width: 100px;
  transition: all 300ms ease;
}

.backdrop {
  height: 200px;
  width: 200px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 100%;
  position: absolute;
  left: 30%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: all 300ms ease;
}

.backdrop::after,
.backdrop::before {
  content: "";
  height: 200px;
  width: 200px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 100%;
  position: absolute;
  transition: all 300ms ease;
}

.backdrop::before {
  left: 15%;
}

.backdrop::after {
  left: 30%;
}

.clouds {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 50%;
  left: 0;
  transform: translate(0, -50%);
  transition: all 300ms ease;
}

.cloud {
  position: absolute;
  right: 10%;
  top: 50%;
  background-color: #fbfbfb;
  height: 20px;
  width: 100px;
  border-radius: 0 100px 100px 100px;
  transform: scale(-0.8, 0.8);
}

.cloud::before {
  content: "";
  position: absolute;
  background-color: #fbfbfb;
  height: 20px;
  width: 80px;
  bottom: 18px;
  left: 0;
  border-radius: 100px 100px 0 0;
}

.cloud::after {
  content: "";
  position: absolute;
  background-color: #fbfbfb;
  height: 40px;
  width: 40px;
  bottom: 18px;
  left: 10px;
  border-radius: 100%;
}

.cloud-1 {
  top: 45%;
  right: 22%;
  transform: scale(-0.6, 0.6);
  opacity: 0.5;
}

.cloud-2 {
  top: 20%;
  right: 0%;
  transform: scale(-0.6, 0.6);
  opacity: 0.5;
}

.cloud-3 {
  top: 92%;
  right: 35%;
}

.cloud-4 {
  top: 85%;
  right: 10%;
  transform: scale(-1, 1);
}

.cloud-5 {
  top: 60%;
  right: -18%;
  transform: rotateZ(-50deg) scale(-1, 1);
}

.sun-moon {
  height: 100px;
  width: 100px;
  background-color: #f1c428;
  border-radius: 100%;
  box-shadow:
    inset 2px 5px 3px rgba(255, 255, 255, 0.5),
    inset -2px -5px 3px rgba(0, 0, 0, 0.5),
    5px 5px 10px rgba(0, 0, 0, 0.5);
  position: absolute;
  left: 10px;
  top: 10px;
  transition: 300ms ease;
}

.stars {
  position: absolute;
  height: 100%;
  width: 100%;
  top: -50%;
  left: 0;
  transform: translate(0, -50%);
  transition: all 300ms ease;
}

.star {
  position: absolute;
  left: 10%;
  top: 50%;
  height: 6px;
  width: 6px;
  border-radius: 100%;
  background-color: #c4c9d2;
  box-shadow: 0 0 4px #fff;
  animation: twinkle 1s infinite alternate;
}

.star::before,
.star::after {
  content: "";
  position: absolute;
  border-radius: 100%;
  background-color: #c4c9d2;
  box-shadow: 0 0 4px #fff;
}

.star::before {
  left: 300%;
  top: 300%;
  height: 4px;
  width: 4px;
}

.star::after {
  left: 400%;
  bottom: 400%;
  height: 5px;
  width: 5px;
}

.star-2 {
  left: 40%;
  top: 10%;
  transform: rotateZ(75deg) scale(1.1);
  animation-delay: 300ms;
}

.star-3 {
  left: 40%;
  top: 60%;
  transform: rotateZ(150deg) scale(0.8);
  animation-delay: 600ms;
}

.crater {
  display: none;
  position: absolute;
  left: 30%;
  top: 60%;
  transform: translate(-50%, -50%);
  height: 30px;
  width: 30px;
  background-color: #949eb2;
  border-radius: 100%;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.4);
}

.crater::before,
.crater::after {
  content: "";
  position: absolute;
  background-color: #949eb2;
  border-radius: 100%;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.4);
}

.crater::before {
  height: 15px;
  width: 15px;
  top: -100%;
  left: 50%;
}

.crater::after {
  height: 20px;
  width: 20px;
  bottom: 40%;
  left: 150%;
}

#toggle-div.night {
  background-color: #1d1f2b;
}

input:checked ~ .clouds {
  top: 150%;
}

input:checked ~ .sun-moon {
  left: calc(100% - 110px);
  background-color: #c4c9d2;
  transform: rotateZ(180deg);
}

input:checked ~ .backdrops {
  left: calc(100% - 130px);
}

input:checked ~ .sun-moon .crater {
  display: block;
}

input:checked ~ .stars {
  top: 50%;
}

@keyframes twinkle {
  from {
    opacity: 1;
  }

  to {
    opacity: 0.5;
  }
}

/* ============ THEME SWITCH: BOTTOM-UP VIEW TRANSITION ============ */
/* During the transition, stop the default cross-fade so our clip wins */
.theme-transition-bottom-up::view-transition-old(root),
.theme-transition-bottom-up::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* Old theme stays put underneath */
.theme-transition-bottom-up::view-transition-old(root) {
  z-index: 1;
}

/* New theme is revealed from the bottom upward */
.theme-transition-bottom-up::view-transition-new(root) {
  z-index: 2;
  animation: theme-reveal-bottom-up 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes theme-reveal-bottom-up {
  from {
    clip-path: inset(100% 0 0 0);
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

/* ============ PROJECT QUESTIONNAIRE MODAL ============ */
.pq-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0, 12, 28, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 40px 20px;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.pq-overlay.open {
  display: flex;
  opacity: 1;
}

.pq-modal {
  width: 100%;
  max-width: 660px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 42px 44px 36px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  transform: translateY(24px) scale(0.98);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pq-overlay.open .pq-modal {
  transform: translateY(0) scale(1);
}

.pq-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.pq-close:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.pq-close svg {
  width: 16px;
  height: 16px;
}

.pq-head {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--text);
}

.pq-intro {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 26px;
}

.pq-q {
  margin-bottom: 24px;
}

.pq-q-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.pq-q-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.pq-opts {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.pq-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 15px;
  transition: all 0.18s ease;
  font-size: 14px;
  color: var(--text-dim);
  user-select: none;
}

.pq-opt:hover {
  border-color: var(--text-faint);
  color: var(--text);
}

.pq-opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pq-box {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 1.6px solid var(--text-faint);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.pq-opt input[type="radio"] + .pq-box {
  border-radius: 50%;
}

.pq-box svg {
  width: 11px;
  height: 11px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.18s ease;
  color: #fff;
}

.pq-opt.checked {
  border-color: var(--text);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.pq-opt.checked .pq-box {
  background: var(--text);
  border-color: var(--text);
}

.pq-opt.checked .pq-box svg {
  opacity: 1;
  transform: scale(1);
  color: var(--bg-card);
}

.pq-opt.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pq-field {
  margin-bottom: 16px;
}

.pq-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}

.pq-field input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s ease;
}

.pq-field input:focus {
  border-color: var(--text-dim);
}

.pq-field input::placeholder {
  color: var(--text-faint);
}

.pq-divider {
  height: 1px;
  background: var(--line);
  margin: 28px 0 24px;
}

.pq-submit {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg-card);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
  letter-spacing: -0.01em;
}

.pq-submit:hover {
  opacity: 0.85;
}

.pq-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pq-closing {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-faint);
  margin: 18px 0 0;
  text-align: center;
}

.pq-success {
  text-align: center;
  padding: 30px 10px;
}

.pq-success .pq-tick {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
}

.pq-success .pq-tick svg {
  width: 30px;
  height: 30px;
}

.pq-success h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 10px;
}

.pq-success p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
}

.pq-err {
  color: #ff8080;
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
  display: none;
}

@media (max-width: 600px) {
  .pq-modal {
    padding: 36px 22px 28px;
  }

  .pq-head {
    font-size: 22px;
  }
}
