/* ==========================================================================
   Ghaith Sukkar — chemistry platform design system
   Dark "fume hood" lab palette taken from the lecture thumbnails:
   reaction green, hazmat yellow, label orange. Periodic-table tiles are the
   recurring motif (the brand itself is written as [Ga]ith [S]ukkar).
   ========================================================================== */

:root {
  --bg: #06100c;
  --bg-2: #0a1711;
  --surface: #0e1f17;
  --surface-2: #132a1f;
  --line: rgba(160, 255, 200, 0.11);
  --line-strong: rgba(160, 255, 200, 0.24);
  --text: #eaf6ee;
  --muted: #93ab9e;
  --green: #35e08a;
  --green-deep: #0f8f52;
  --green-ink: #04140c;
  --yellow: #ffe100;
  --orange: #ff8a1f;
  --danger: #ff5d5d;

  --font-display: "Alexandria", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --nav-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 85% -10%, rgba(53, 224, 138, 0.13), transparent 70%),
    radial-gradient(700px 480px at 0% 12%, rgba(255, 225, 0, 0.06), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main {
  flex: 1;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.3;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

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

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

button {
  font: inherit;
  color: inherit;
}

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

.hidden {
  display: none !important;
}

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

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

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Chemistry background ----------
   A fixed layer behind the page: a faint hexagonal lattice plus a few line-drawn
   molecules and glassware drifting slowly. Only transform is animated, so the
   browser moves them on the compositor without repainting (cheap on phones). */

.chem-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.chem-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0v16.2L0 32.3v32.4L28 80.8v16.2M28 16.2l28 16.1v32.4L28 80.8' fill='none' stroke='%2335e08a' stroke-opacity='.075' stroke-width='1'/%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, 0.35) 55%, #000);
  mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, 0.35) 55%, #000);
}

.cb {
  position: absolute;
  fill: none;
  color: var(--green);
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: var(--o, 0.16);
  /* Three independent sine-eased loops (drift, sway, turn) with different
     lengths, so the motion never visibly repeats or stops dead at a corner. */
  animation:
    cb-in 1.6s ease-out both,
    cb-drift var(--t1, 23s) cubic-bezier(0.37, 0, 0.63, 1) infinite alternate,
    cb-turn var(--t2, 37s) cubic-bezier(0.37, 0, 0.63, 1) infinite alternate,
    cb-breathe var(--t3, 17s) cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
  animation-delay: 0s, var(--d, 0s), var(--d, 0s), var(--d, 0s);
  will-change: translate, rotate, scale;
  backface-visibility: hidden;
}

.cb .fill {
  fill: currentColor;
  stroke: none;
}

.cb-1 { width: 120px; top: 14%; left: 4%; --x: 26px; --y: 44px; --r: 22deg; --t1: 23s; --t2: 41s; --t3: 17s; --d: -6s; }
.cb-2 { width: 110px; top: 58%; right: 5%; color: var(--yellow); --x: -30px; --y: -46px; --r: -18deg; --t1: 27s; --t2: 35s; --t3: 19s; --d: -14s; }
.cb-3 { width: 150px; top: 8%; right: 9%; --o: 0.12; --x: -22px; --y: 36px; --r: 70deg; --t1: 31s; --t2: 53s; --t3: 21s; --d: -9s; }
.cb-4 { width: 84px; top: 70%; left: 8%; color: var(--orange); --x: 24px; --y: -38px; --r: -14deg; --t1: 25s; --t2: 39s; --t3: 15s; --d: -19s; }
.cb-5 { width: 210px; top: 40%; left: 30%; --o: 0.1; --x: 40px; --y: 26px; --r: 9deg; --t1: 33s; --t2: 47s; --t3: 23s; --d: -3s; }
.cb-6 { width: 150px; top: 84%; right: 30%; --o: 0.12; --x: -34px; --y: -30px; --r: -24deg; --t1: 29s; --t2: 43s; --t3: 18s; --d: -11s; }

@keyframes cb-in {
  from {
    opacity: 0;
  }
}

@keyframes cb-drift {
  from {
    translate: calc(var(--x, 20px) * -0.5) calc(var(--y, 30px) * -0.5);
  }
  to {
    translate: calc(var(--x, 20px) * 0.5) calc(var(--y, 30px) * 0.5);
  }
}

@keyframes cb-turn {
  from {
    rotate: calc(var(--r, 10deg) * -0.5);
  }
  to {
    rotate: calc(var(--r, 10deg) * 0.5);
  }
}

@keyframes cb-breathe {
  from {
    scale: 0.96;
  }
  to {
    scale: 1.05;
  }
}

@media (max-width: 700px) {
  .cb { --o: 0.13; }
  .cb-1 { width: 84px; top: 11%; left: -18px; }
  .cb-2 { width: 80px; top: 52%; right: -14px; }
  .cb-3 { width: 100px; top: 30%; right: -30px; }
  .cb-4 { width: 60px; top: 76%; left: 6px; }
  .cb-5,
  .cb-6 { display: none; }
}

/* ---------- Buttons ---------- */

.btn-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

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

.btn-primary {
  background: var(--green);
  color: var(--green-ink);
  box-shadow: 0 10px 30px -12px rgba(53, 224, 138, 0.8);
}

.btn-ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
}

.btn-yellow {
  background: var(--yellow);
  color: #171400;
}

@media (hover: hover) {
  .btn-primary:hover {
    background: #5bf0a4;
  }
  .btn-ghost:hover {
    border-color: var(--green);
    color: var(--green);
  }
  .btn-yellow:hover {
    background: #fff04d;
  }
}

/* ---------- Periodic tile ---------- */

.tile {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.1em;
  height: 2.1em;
  border: 1.5px solid currentColor;
  border-radius: 0.3em;
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1;
  direction: ltr;
  flex: none;
}

.tile > i {
  position: absolute;
  top: 0.22em;
  left: 0.28em;
  font-size: 0.34em;
  font-style: normal;
  font-weight: 500;
  opacity: 0.85;
}

.tile > b {
  font-size: 0.92em;
  transform: translateY(0.08em);
}

/* ---------- Navbar ---------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  background: rgba(6, 16, 12, 0.94);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 900px) {
  @supports (backdrop-filter: blur(12px)) {
    .navbar {
      background: rgba(6, 16, 12, 0.72);
      backdrop-filter: blur(14px) saturate(140%);
    }
  }
}

.brand {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  direction: ltr;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--text);
  margin-inline-end: auto;
}

.brand .tile {
  font-size: 1.05rem;
  color: var(--green-ink);
  background: var(--green);
  border-color: var(--green);
}

.brand .tile + span {
  margin: 0 9px 0 1px;
  padding-bottom: 2px;
}

sub {
  font-size: 0.68em;
  line-height: 0;
}

.brand .tile.s {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #171400;
}

.nav1 {
  display: none;
  align-items: center;
  gap: 4px;
}

.nav1 a,
.nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s, background-color 0.2s;
}

.nav1 a.cta,
.nav a.cta {
  color: var(--green-ink);
  background: var(--green);
  font-weight: 600;
}

@media (hover: hover) {
  .nav1 a:not(.cta):hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
  }
}

.atp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  direction: ltr;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.atp .text {
  display: inline-grid;
  place-items: center;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--yellow);
  color: #171400;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.atp .text2 {
  font-weight: 700;
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
}

.list-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-inline-end: -8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.list-icon svg {
  pointer-events: none;
}

.nav {
  position: fixed;
  top: var(--nav-h);
  inset-inline: 0;
  z-index: 49;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px var(--gutter) 20px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  animation: drop 0.22s var(--ease);
}

.nav a {
  padding: 12px 16px;
  font-size: 1.05rem;
  color: var(--text);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (min-width: 760px) {
  .nav1 {
    display: flex;
  }
  .list-icon,
  .nav {
    display: none !important;
  }
}

/* Phones: brand + Atom balance + menu button must fit in one row */
@media (max-width: 480px) {
  .navbar {
    gap: 8px;
  }
  .navbar .brand {
    font-size: 0.9rem;
  }
  .navbar .brand .tile {
    font-size: 0.9rem;
  }
  .navbar .brand .tile + span {
    margin-right: 6px;
  }
  .atp {
    height: 34px;
    gap: 6px;
    padding: 0 9px 0 4px;
    font-size: 0.8rem;
  }
  .atp .text {
    height: 24px;
    padding: 0 7px;
    font-size: 0.62rem;
  }
}

/* ---------- Toasts and confirm dialog ---------- */

.error {
  position: fixed;
  z-index: 90;
  inset-inline: 0;
  bottom: 20px;
  display: flex;
  justify-content: center;
  padding-inline: 16px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  font-weight: 500;
  animation: rise 0.3s var(--ease);
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
}

.toast-success .toast-icon {
  background: var(--green);
  color: var(--green-ink);
}

.toast-error {
  border-color: rgba(255, 93, 93, 0.5);
}

.toast-error .toast-icon {
  background: var(--danger);
  color: #1c0505;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 5, 0.78);
}

.popup-message {
  width: min(100%, 400px);
  padding: 28px 24px 22px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  text-align: center;
  animation: rise 0.25s var(--ease);
}

.popup-message h2 {
  font-size: 1.25rem;
  margin-bottom: 22px;
}

.popup-message .buttons {
  display: flex;
  gap: 10px;
}

.popup-message button {
  flex: 1;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
}

.popup-message .confirm-btn {
  background: var(--green);
  border-color: var(--green);
  color: var(--green-ink);
}

.upload-btn {
  position: fixed;
  z-index: 60;
  inset-inline-start: 20px;
  bottom: 20px;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--yellow);
  color: #171400;
  font-size: 1.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}

/* ---------- Section scaffolding ---------- */

.section {
  padding-block: clamp(56px, 9vw, 104px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--green);
  justify-self: start;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1.5px;
  background: currentColor;
}

.section-head {
  display: grid;
  gap: 10px;
  margin-bottom: clamp(26px, 4vw, 44px);
  max-width: 640px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 4.4vw, 2.5rem);
  font-weight: 800;
}

.section-head p {
  color: var(--muted);
}

html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

html.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(20px, 5vw, 64px) clamp(40px, 6vw, 80px);
}

.hero-grid {
  display: grid;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.hero-copy {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.hero h1 {
  font-size: clamp(1.9rem, 6.4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.hero h1 em {
  font-style: normal;
  color: var(--green);
  position: relative;
  white-space: nowrap;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -0.06em;
  height: 0.12em;
  border-radius: 99px;
  background: var(--yellow);
  transform-origin: right;
  animation: underline 0.9s 0.35s var(--ease) both;
}

@keyframes underline {
  from {
    transform: scaleX(0);
  }
}

.hero-lede {
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: var(--muted);
  max-width: 34em;
}

.hero-lede strong {
  color: var(--text);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
  width: 100%;
}

.hero-stats div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-stats b {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  color: var(--yellow);
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    row-gap: 22px;
  }
  .hero-copy {
    align-self: end;
  }
  .hero-photo {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: min(100%, 400px);
  }
  .hero-stats {
    grid-column: 1;
    align-self: start;
  }
}

/* ---------- Feature strip ---------- */

.features {
  display: grid;
  gap: 12px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.feature .tile {
  font-size: 1.5rem;
  color: var(--green);
}

.feature:nth-child(2) .tile {
  color: var(--yellow);
}

.feature:nth-child(3) .tile {
  color: var(--orange);
}

.feature h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.feature p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

@media (min-width: 760px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Units (periodic grid) ---------- */

.units {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}

.unit {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.35s var(--ease), border-color 0.25s;
  will-change: transform;
}

.unit-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
}

.unit-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.unit-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(14, 31, 23, 0.95));
}

.unit-body {
  display: grid;
  gap: 6px;
  padding: 16px;
  flex: 1;
  align-content: start;
}

.unit-body h3 {
  font-size: 1.12rem;
  font-weight: 700;
}

.unit-body p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
}

.unit-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 600;
}

.unit-foot svg {
  transition: transform 0.25s var(--ease);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.7;
}

.badge-free {
  background: rgba(53, 224, 138, 0.14);
  color: var(--green);
}

.badge-locked {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.badge-live {
  background: rgba(255, 138, 31, 0.14);
  color: var(--orange);
}

.unit.is-locked {
  background: transparent;
  border-style: dashed;
}

.unit.is-locked .unit-media img {
  filter: grayscale(1) brightness(0.55);
}

.unit.is-locked .unit-foot {
  color: var(--muted);
}

@media (hover: hover) {
  a.unit:hover {
    border-color: var(--green);
  }
  a.unit:hover .unit-foot svg {
    transform: translateX(-5px);
  }
}

/* ---------- Steps as a reaction equation ---------- */

.equation {
  display: grid;
  gap: 8px;
  align-items: stretch;
}

.reagent {
  display: grid;
  gap: 10px;
  align-content: start;
  justify-items: start;
  padding: 22px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.reagent.product {
  border-color: rgba(255, 225, 0, 0.45);
  background: linear-gradient(160deg, rgba(255, 225, 0, 0.1), var(--surface) 60%);
}

.reagent .step-n {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--green);
}

.reagent.product .step-n {
  color: var(--yellow);
}

.reagent h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.reagent p {
  color: var(--muted);
  font-size: 0.93rem;
}

.reagent .btn-x {
  min-height: 44px;
  margin-top: 6px;
  font-size: 0.9rem;
}

.operator {
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  padding: 2px;
}

.operator.arrow {
  color: var(--yellow);
}

.operator.arrow svg {
  transform: rotate(-90deg);
}

@media (min-width: 900px) {
  .equation {
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 14px;
  }
  .operator.arrow svg {
    transform: none;
  }
}

/* ---------- Instructor ---------- */

.hero-photo {
  width: min(64%, 300px);
  transform: rotate(-2.5deg);
}

.teacher.teacher-solo {
  grid-template-columns: 1fr;
  max-width: 760px;
}


.teacher {
  display: grid;
  gap: 24px;
  align-items: center;
}

.teacher-photo {
  position: relative;
  width: min(78%, 360px);
  aspect-ratio: 1568 / 1736;
  margin-inline: auto;
  border-radius: 28px;
  background: #ffe100;
  overflow: hidden;
  transform: rotate(-2.5deg);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
}

.teacher-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.teacher-photo .tile {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  font-size: 1.5rem;
  color: #171400;
  background: #ffe100;
}

.teacher-copy {
  display: grid;
  gap: 14px;
}

.teacher-copy h2 {
  font-size: clamp(1.6rem, 4.4vw, 2.5rem);
  font-weight: 800;
}

.teacher-copy > p {
  color: var(--muted);
  max-width: 36em;
}

.quotes {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.quotes blockquote {
  margin: 0;
  padding: 12px 16px;
  border-inline-start: 3px solid var(--green);
  border-radius: 4px 12px 12px 4px;
  background: var(--surface);
  font-weight: 500;
}

.quotes blockquote:nth-child(2) {
  border-color: var(--yellow);
}

@media (min-width: 860px) {
  .teacher {
    grid-template-columns: 360px 1fr;
    gap: 56px;
  }
}

/* ---------- Listing pages (courses, subcourses) ---------- */

.page-head {
  padding-block: clamp(28px, 5vw, 56px) clamp(18px, 3vw, 30px);
  display: grid;
  gap: 10px;
}

.page-head h1 {
  font-size: clamp(1.7rem, 5.4vw, 2.8rem);
  font-weight: 800;
}

.page-head p {
  color: var(--muted);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
}

.crumbs a {
  color: var(--green);
}

.courses {
  padding-bottom: clamp(56px, 9vw, 104px);
}

.cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.card[data-active="false"] {
  cursor: default;
  border-style: dashed;
  background: transparent;
}

.card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-2);
}

/* optional subcourse photo: show the whole picture, whatever its shape */
.card-img.subcourse-img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
}

.card-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  padding: 18px 16px;
  flex: 1;
  align-content: start;
}

.card-main .tile {
  grid-row: span 2;
  font-size: 1.35rem;
  color: var(--green);
  align-self: start;
}

.card[data-active="false"] .tile {
  color: var(--muted);
}

.card-header {
  display: contents;
}

.card-header p:first-child,
.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.4;
}

.card-header p + p,
.card-desc {
  grid-column: 2;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

.duration {
  grid-column: 2;
  font-size: 0.82rem;
  color: var(--yellow);
  font-family: var(--font-mono);
}

.tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tags span {
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.76rem;
  color: var(--muted);
}

.card-foot,
.price-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  min-height: 62px;
}

.price-container:empty {
  display: none;
}

.card-foot.enter {
  color: var(--green);
  font-weight: 600;
  font-size: 0.9rem;
}

.salary {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  direction: ltr;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
}

.salary small {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.buy-btn {
  min-height: 44px;
  padding: 8px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: var(--green-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.later {
  color: var(--muted);
  font-size: 0.9rem;
}

.card-note {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.8;
}

.free-card-note {
  background: rgba(53, 224, 138, 0.16);
  color: var(--green);
}

.locked-card-note {
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.card:has(.card-note) .card-main {
  padding-top: 46px;
}

.card:has(.card-img) .card-note {
  background: rgba(6, 16, 12, 0.85);
}

.card:has(.card-img) .card-main {
  padding-top: 18px;
}

.admin-tools {
  display: flex;
  gap: 8px;
  padding: 10px 16px 0;
}

.bi-trash,
.bi-edit {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  font-style: normal;
  color: var(--muted);
  cursor: pointer;
}

.bi-trash.trash1 {
  color: var(--orange);
  border-color: var(--orange);
}

.bi-trash.trash2 {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.admin-tools .toggle-active {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--yellow);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.admin-tools .toggle-active:disabled {
  opacity: 0.5;
  cursor: default;
}

.empty {
  padding: 40px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

@media (hover: hover) {
  .card:not([data-active="false"]):hover {
    border-color: var(--green);
    transform: translateY(-3px);
  }
  .buy-btn:hover {
    background: #5bf0a4;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}

.footer-grid {
  display: grid;
  gap: 28px;
  padding-block: 40px 28px;
}

.site-footer .brand {
  font-size: 1.15rem;
}

.footer-about {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.footer-about p {
  color: var(--muted);
  max-width: 30em;
  font-size: 0.93rem;
}

.column-title {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--green);
  margin-bottom: 12px;
}

.link-list {
  display: grid;
  gap: 8px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  font-weight: 500;
}

.footer-link svg {
  color: var(--green);
}

.footer-link .ltr {
  font-family: var(--font-mono);
  color: var(--yellow);
}

.footer-bottom {
  padding-block: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  direction: ltr;
  text-align: center;
  font-family: var(--font-mono);
}

@media (hover: hover) {
  a.footer-link:hover {
    color: var(--green);
  }
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.6fr 1fr 1fr;
  }
}

/* ---------- Motion preferences ---------- */

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