:root {
  --bg: #060610;
  --bg-mid: #0a0a16;

  --text-bright: #f2ede6;
  --text: #c5bfb6;
  --text-muted: #736a7e;
  --text-quiet: #524868;
  --text-dim: #2d2740;

  --accent: #c9b899;
  --accent-cool: rgba(160, 185, 235, 0.6);

  --glass-fill: rgba(255, 255, 255, 0.007);
  --glass-border: rgba(255, 255, 255, 0.04);
  --glass-edge: rgba(180, 200, 245, 0.18);
  --glass-edge-warm: rgba(210, 190, 160, 0.07);
  --rim: rgba(140, 165, 220, 0.07);
  --rim-warm: rgba(200, 180, 150, 0.035);

  --max-w: 1280px;
  --header-h: 58px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --s-11: 180px;

  --r-sm: 4px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-material: cubic-bezier(0.4, 0, 0.2, 1);

  --f-display: Georgia, 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  --f-body: 'Segoe UI', -apple-system, 'Helvetica Neue', BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--f-body);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
}

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

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

body.page-home {
  background:
    radial-gradient(ellipse 1000px 800px at 20% 15%, rgba(16, 24, 55, 0.65), transparent),
    radial-gradient(ellipse 650px 520px at 85% 62%, rgba(14, 20, 46, 0.24), transparent),
    radial-gradient(ellipse 500px 400px at 52% 92%, rgba(10, 16, 38, 0.12), transparent),
    radial-gradient(circle 1400px at 30% 25%, rgba(12, 18, 42, 0.35), transparent 70%),
    radial-gradient(ellipse 200% 150% at 50% 50%, transparent 10%, rgba(0, 0, 0, 0.9)),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.4) 85%, rgba(0, 0, 0, 0.9) 100%);
  background-color: var(--bg);
}

body.page-hacker {
  background:
    radial-gradient(ellipse 850px 600px at 15% 8%, rgba(16, 24, 52, 0.58), transparent),
    radial-gradient(ellipse 520px 420px at 82% 55%, rgba(14, 20, 44, 0.22), transparent),
    radial-gradient(circle 1100px at 22% 18%, rgba(12, 18, 42, 0.28), transparent 70%),
    radial-gradient(ellipse 200% 150% at 50% 50%, transparent 10%, rgba(0, 0, 0, 0.9)),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.4) 85%, rgba(0, 0, 0, 0.9) 100%);
  background-color: var(--bg);
}

body.page-notes {
  background:
    radial-gradient(ellipse 900px 580px at 72% 10%, rgba(16, 24, 52, 0.52), transparent),
    radial-gradient(ellipse 500px 400px at 16% 55%, rgba(14, 20, 44, 0.24), transparent),
    radial-gradient(circle 1100px at 68% 22%, rgba(12, 18, 42, 0.24), transparent 70%),
    radial-gradient(ellipse 200% 150% at 50% 50%, transparent 10%, rgba(0, 0, 0, 0.9)),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.4) 85%, rgba(0, 0, 0, 0.9) 100%);
  background-color: var(--bg);
}

body.page-projects {
  background:
    radial-gradient(ellipse 950px 480px at 48% 78%, rgba(14, 22, 52, 0.5), transparent),
    radial-gradient(ellipse 480px 380px at 10% 18%, rgba(14, 20, 44, 0.26), transparent),
    radial-gradient(circle 1100px at 48% 68%, rgba(12, 18, 42, 0.22), transparent 70%),
    radial-gradient(ellipse 200% 150% at 50% 50%, transparent 10%, rgba(0, 0, 0, 0.9)),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.4) 85%, rgba(0, 0, 0, 0.9) 100%);
  background-color: var(--bg);
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.light-ray {
  position: absolute;
  pointer-events: none;
}

.light-ray--1 {
  top: -18%;
  left: 8%;
  width: 380px;
  height: 110vh;
  background: linear-gradient(
    168deg,
    rgba(160, 185, 235, 0.022) 0%,
    rgba(160, 185, 235, 0.008) 30%,
    transparent 65%
  );
  filter: blur(60px);
  transform: rotate(-8deg);
  opacity: 0;
  animation: ray-fade-in 3s var(--ease) 0.5s forwards;
}

.light-ray--2 {
  top: -10%;
  left: 22%;
  width: 200px;
  height: 90vh;
  background: linear-gradient(
    172deg,
    rgba(200, 190, 170, 0.014) 0%,
    rgba(200, 190, 170, 0.005) 35%,
    transparent 60%
  );
  filter: blur(50px);
  transform: rotate(-4deg);
  opacity: 0;
  animation: ray-fade-in 3.5s var(--ease) 1s forwards;
}

.light-ray--3 {
  top: -5%;
  right: 15%;
  width: 280px;
  height: 70vh;
  background: linear-gradient(
    175deg,
    rgba(140, 165, 210, 0.012) 0%,
    rgba(140, 165, 210, 0.004) 40%,
    transparent 65%
  );
  filter: blur(55px);
  transform: rotate(5deg);
  opacity: 0;
  animation: ray-fade-in 4s var(--ease) 1.5s forwards;
}

.light-ray--4 {
  top: -12%;
  left: 42%;
  width: 160px;
  height: 95vh;
  background: linear-gradient(
    170deg,
    rgba(190, 180, 200, 0.016) 0%,
    rgba(190, 180, 200, 0.006) 32%,
    transparent 58%
  );
  filter: blur(48px);
  transform: rotate(-2deg);
  opacity: 0;
  animation: ray-fade-in 3.8s var(--ease) 0.8s forwards;
}

.light-ray--5 {
  top: -8%;
  right: 32%;
  width: 240px;
  height: 80vh;
  background: linear-gradient(
    174deg,
    rgba(170, 195, 220, 0.014) 0%,
    rgba(170, 195, 220, 0.005) 36%,
    transparent 62%
  );
  filter: blur(52px);
  transform: rotate(2deg);
  opacity: 0;
  animation: ray-fade-in 4.2s var(--ease) 1.2s forwards;
}

@keyframes ray-fade-in {
  to { opacity: 1; }
}

.specular-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.specular-dot {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--s-6);
  background: rgba(6, 6, 16, 0.6);
  backdrop-filter: blur(44px) saturate(1.35);
  -webkit-backdrop-filter: blur(44px) saturate(1.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.site-nav {
  display: flex;
  gap: var(--s-1);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: var(--s-2) var(--s-4);
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  transition: color 0.4s var(--ease);
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.75);
}

.nav-link::before {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 16px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 1px;
  transform: translateX(-50%) scaleX(0);
  transition: transform 0.4s var(--ease);
}

.nav-link:hover::before {
  transform: translateX(-50%) scaleX(1);
}

.nav-link.is-active {
  color: rgba(255, 255, 255, 0.65);
}

.nav-link.is-active::before {
  display: none;
}

.nav-link.is-active::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
  border-radius: 1px;
}

.glass {
  position: relative;
  background:
    linear-gradient(174deg, rgba(255, 255, 255, 0.022) 0%, rgba(255, 255, 255, 0.004) 45%, rgba(0, 0, 0, 0.025) 100%),
    var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-top-color: var(--glass-edge);
  border-radius: var(--r-xl);
  backdrop-filter: blur(80px) saturate(1.25);
  -webkit-backdrop-filter: blur(80px) saturate(1.25);
  box-shadow:
    0 0 0 0.5px var(--rim),
    0 1px 0 0 var(--glass-edge-warm),
    0 0 80px -20px rgba(140, 165, 220, 0.012),
    0 85px 170px -30px rgba(0, 0, 0, 0.7),
    0 40px 80px -20px rgba(0, 0, 0, 0.5),
    0 10px 24px -4px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0.5px 0 rgba(180, 200, 240, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.glass > * {
  position: relative;
  z-index: 3;
}

.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    118deg,
    transparent 12%,
    rgba(160, 185, 235, 0.022) 22%,
    rgba(255, 255, 255, 0.038) 30%,
    rgba(210, 190, 235, 0.015) 40%,
    rgba(170, 210, 240, 0.01) 47%,
    transparent 54%
  );
  background-size: 250% 100%;
  background-position: 100% 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 1;
  transition: background-position 0.7s var(--ease);
}

.glass::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.12) 100%),
    linear-gradient(100deg, transparent 35%, rgba(150, 175, 225, 0.01) 52%, transparent 68%);
  pointer-events: none;
  border-radius: inherit;
  z-index: 2;
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--header-h) + var(--s-11)) var(--s-7) var(--s-9);
  max-width: var(--max-w);
  margin: 0 auto;
  z-index: 10;
}

.hero-eyebrow {
  font-family: var(--f-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--s-5);
  padding-left: 2px;
}

.hero-title {
  font-family: var(--f-display);
  font-size: clamp(4.5rem, 13vw, 10.5rem);
  font-weight: normal;
  letter-spacing: -0.04em;
  line-height: 0.85;
  color: var(--text-bright);
  text-shadow: 0 0 120px rgba(200, 190, 170, 0.04);
}

.hero-rule {
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.35;
  border: none;
  margin: var(--s-6) 0 var(--s-5);
  margin-left: 1px;
}

.hero-sub {
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-quiet);
  margin-left: 2px;
}

.modules {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto auto;
  column-gap: 22px;
  row-gap: 22px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-7) var(--s-10);
  z-index: 10;
}

.modules::before {
  content: '';
  position: absolute;
  top: -22%;
  left: 0%;
  width: 750px;
  height: 750px;
  background: radial-gradient(ellipse, rgba(16, 26, 56, 0.1), transparent 50%);
  filter: blur(105px);
  pointer-events: none;
  z-index: -1;
}

.modules::after {
  content: '';
  position: absolute;
  bottom: -14%;
  right: -8%;
  width: 580px;
  height: 580px;
  background: radial-gradient(ellipse, rgba(14, 22, 50, 0.08), transparent 50%);
  filter: blur(100px);
  pointer-events: none;
  z-index: -1;
}

.module {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--s-6) var(--s-6) var(--s-5);
  cursor: pointer;
  transition:
    transform 0.5s var(--ease),
    box-shadow 0.5s var(--ease),
    border-color 0.5s var(--ease);
}

.module:nth-child(1) {
  grid-column: 1 / 8;
  grid-row: 1;
  min-height: 210px;
}

.module:nth-child(2) {
  grid-column: 8 / 13;
  grid-row: 1 / 3;
  margin-top: var(--s-7);
}

.module:nth-child(3) {
  grid-column: 2 / 7;
  grid-row: 2;
  min-height: 210px;
  margin-top: calc(-1 * var(--s-4));
}

.module:hover {
  transform: translateY(-4px);
  border-top-color: rgba(185, 205, 248, 0.22);
  box-shadow:
    0 0 0 0.5px rgba(155, 180, 230, 0.14),
    0 1px 0 0 rgba(210, 190, 160, 0.05),
    0 0 70px -10px rgba(140, 165, 225, 0.02),
    0 95px 190px -30px rgba(0, 0, 0, 0.75),
    0 48px 96px -20px rgba(0, 0, 0, 0.55),
    0 12px 28px -4px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 0.5px 0 rgba(180, 200, 240, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.module:hover::before {
  background-position: 35% 0;
}

.module:hover .module__title {
  color: var(--text-bright);
}

.module__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.module__foot {
  margin-top: auto;
}

.module__index {
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}

.module__arrow {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.08);
  transition: color 0.4s var(--ease), transform 0.4s var(--ease), opacity 0.4s var(--ease);
  line-height: 1;
}

.module:hover .module__arrow {
  color: var(--accent);
  opacity: 0.75;
  transform: translateX(3px);
}

.module__title {
  font-family: var(--f-display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: normal;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--text);
  transition: color 0.4s var(--ease);
}

.module__desc {
  margin-top: var(--s-2);
  font-size: 14px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.page-content {
  position: relative;
  isolation: isolate;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--header-h) + var(--s-11)) var(--s-7) var(--s-10);
}

.page-content::before {
  content: '';
  position: absolute;
  top: 8%;
  left: 3%;
  width: 650px;
  height: 540px;
  background: radial-gradient(ellipse, rgba(16, 26, 54, 0.08), transparent 54%);
  filter: blur(100px);
  pointer-events: none;
  z-index: -1;
}

.page-heading {
  margin-bottom: var(--s-9);
  padding-left: 2px;
}

.page-title {
  font-family: var(--f-display);
  font-size: clamp(3.8rem, 10vw, 7rem);
  font-weight: normal;
  letter-spacing: -0.035em;
  line-height: 0.88;
  color: var(--text-bright);
  text-shadow: 0 0 100px rgba(200, 190, 170, 0.03);
}

.page-desc {
  margin-top: var(--s-6);
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-quiet);
}

.content-panel {
  padding: var(--s-8) var(--s-7);
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-placeholder {
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Project Cards ─────────────────────────────── */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--s-5);
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: var(--s-6) var(--s-6) var(--s-5);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(180, 200, 240, 0.09);
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
}

.project-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.project-lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.project-stats {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  font-size: 11px;
  color: var(--text-quiet);
}

.project-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-name {
  font-family: var(--f-display);
  font-size: 1.35rem;
  font-weight: normal;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  margin-bottom: var(--s-3);
  line-height: 1.2;
}

.project-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: var(--s-5);
}

.project-topics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
}

.project-topic {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-quiet);
  padding: 3px 8px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--s-4);
  border-top: 1px solid var(--glass-border);
  margin-top: auto;
}

.project-updated {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.project-link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: gap 0.2s var(--ease);
}

.project-link:hover {
  gap: 9px;
}

.project-card-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.project-card-spinner {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--glass-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.project-card-error {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: var(--s-7);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--s-6);
}

.note-card {
  padding: var(--s-7) var(--s-6);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: pointer;
  transition:
    transform 0.5s var(--ease),
    box-shadow 0.5s var(--ease),
    border-color 0.5s var(--ease);
}

.note-card:nth-child(1) {
  grid-column: 1 / 8;
}

.note-card:nth-child(2) {
  grid-column: 8 / 13;
  margin-top: var(--s-6);
}

.note-card:nth-child(3) {
  grid-column: 2 / 7;
  margin-top: calc(-1 * var(--s-3));
}

.note-card:nth-child(4) {
  grid-column: 7 / 12;
  margin-top: var(--s-4);
}

.note-card:hover {
  transform: translateY(-4px);
  border-top-color: rgba(185, 205, 248, 0.2);
  box-shadow:
    0 0 0 0.5px rgba(155, 180, 230, 0.12),
    0 1px 0 0 rgba(210, 190, 160, 0.04),
    0 0 55px -10px rgba(140, 165, 225, 0.016),
    0 75px 150px -28px rgba(0, 0, 0, 0.7),
    0 40px 80px -18px rgba(0, 0, 0, 0.5),
    0 10px 24px -4px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0.5px 0 rgba(180, 200, 240, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.note-card:hover::before {
  background-position: 35% 0;
}

.note-card:hover .note-card__label {
  color: var(--text-bright);
}

.note-card__label {
  font-family: var(--f-display);
  font-size: 1.4rem;
  font-weight: normal;
  color: var(--text);
  transition: color 0.4s var(--ease);
}

.note-card__content {
  margin-top: var(--s-4);
}

.note-card__title {
  font-family: var(--f-display);
  font-size: 1.6rem;
  font-weight: normal;
  color: var(--text);
  transition: color 0.4s var(--ease);
  line-height: 1.2;
}

.note-card:hover .note-card__title {
  color: var(--text-bright);
}

.note-card__text {
  margin-top: var(--s-3);
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.6;
  letter-spacing: 0.01em;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-rule {
  from {
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
  }
  to {
    opacity: 1;
    transform: scaleX(1);
    transform-origin: left;
  }
}

.reveal {
  animation: reveal 1.2s var(--ease) both;
}

.reveal-rule {
  animation: reveal-rule 1s var(--ease) both;
}

.reveal-d1 { animation-delay: 0.18s; }
.reveal-d2 { animation-delay: 0.38s; }
.reveal-d3 { animation-delay: 0.58s; }
.reveal-d4 { animation-delay: 0.78s; }
.reveal-d5 { animation-delay: 0.98s; }

@media (max-width: 900px) {
  .hero {
    padding: calc(var(--header-h) + var(--s-9)) var(--s-5) var(--s-7);
  }

  .atmosphere {
    display: none;
  }

  .modules {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    margin-top: 0;
    padding: var(--s-5) var(--s-5) var(--s-7);
  }

  .module:nth-child(1) {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 190px;
  }

  .module:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    min-height: 190px;
    margin-top: 0;
  }

  .module:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    min-height: 190px;
    margin-top: 0;
  }

  .modules::before,
  .modules::after,
  .page-content::before {
    display: none;
  }

  .card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .note-card:nth-child(1),
  .note-card:nth-child(2),
  .note-card:nth-child(3),
  .note-card:nth-child(4) {
    grid-column: auto;
    margin-top: 0;
  }
}

@media (max-width: 600px) {
  .site-header {
    height: auto;
    padding: var(--s-3) var(--s-4);
  }

  .hero {
    padding: calc(var(--header-h) + var(--s-8)) var(--s-5) var(--s-6);
  }

  .hero-title {
    font-size: clamp(3.2rem, 14vw, 5rem);
  }

  .modules {
    grid-template-columns: 1fr;
    gap: var(--s-4);
    padding: var(--s-4) var(--s-5) var(--s-7);
  }

  .module:nth-child(1),
  .module:nth-child(2),
  .module:nth-child(3) {
    grid-column: 1;
    grid-row: auto;
    min-height: 180px;
    margin-top: 0;
  }

  .module {
    padding: var(--s-5);
  }

  .page-content {
    padding: calc(var(--header-h) + var(--s-9)) var(--s-5) var(--s-8);
  }

  .page-heading {
    margin-bottom: var(--s-8);
  }

  .page-title {
    font-size: clamp(2.8rem, 12vw, 4rem);
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .note-card:nth-child(1),
  .note-card:nth-child(2),
  .note-card:nth-child(3),
  .note-card:nth-child(4) {
    grid-column: 1;
    margin-top: 0;
  }

  .content-panel {
    min-height: 260px;
    padding: var(--s-7) var(--s-5);
  }

  .nav-link {
    padding: var(--s-2) var(--s-3);
    font-size: 10px;
  }

  .module__title {
    font-size: 1.5rem;
  }

  .hero-rule {
    width: 40px;
  }

  .specular-field {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .atmosphere,
  .specular-field {
    display: none;
  }
}
