/* Zaid Berjis — site styles */
:root {
  --pair1-a: #F19000; --pair1-b: #E4007D;
  --pair2-a: #EB5293; --pair2-b: #8E2A81;
  --pair3-a: #E9E000; --pair3-b: #87BB25;
  --pair4-a: #F9C13C; --pair4-b: #ED670A;
  --pair5-a: #004EA2; --pair5-b: #87BB25;
  --pair6-a: #662281; --pair6-b: #4BA0D9;

  --ink: #1D1D1B;
  --text-soft: #3C3C3B;
  --text-muted: #575756;
  --axis: #878786;
  --check: #9D9D9C;
  --border: #B2B2B1;
  --panel-head: #D9D9D9;
  --paper: #FFFFFF;

  --tint-yellow: #FFF1AF;
  --tint-sky: #D4ECFC;
  --tint-lavender: #ECE8F3;
  --tint-butter: #FFF7DA;

  --link: #004EA2;
  --math: #004EA2;
  --physics: #662281;
  --books: #E4007D;
  --workbooks: #ED670A;

  --font-head: "Schibsted Grotesk", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;

  --wrap: 1120px;
  --gutter: 24px;
  --radius: 10px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

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

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

h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }

p { margin: 0 0 1em; max-width: 68ch; }

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

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--paper); padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { border-bottom: 1px solid var(--panel-head); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 72px; flex-wrap: wrap;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 1.15rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
.wordmark svg { width: 28px; height: 28px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.nav a {
  color: var(--text-soft); text-decoration: none; font-size: 0.98rem;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

@media (max-width: 640px) {
  .site-header .wrap { padding-top: 12px; padding-bottom: 10px; }
  .nav { gap: 2px 16px; width: 100%; }
  .nav a { font-size: 0.95rem; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  padding: 12px 22px; border-radius: 999px; text-decoration: none;
  border: 2px solid var(--ink); cursor: pointer; line-height: 1.2;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--tint-butter); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Hero */
.hero { padding: 64px 0 72px; }
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 56px; align-items: center;
}
.hero .lede { font-size: 1.2rem; color: var(--text-soft); margin-top: 20px; }
@media (max-width: 900px) {
  .hero { padding: 40px 0 48px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; }
}

/* Visualization panel */
.viz {
  border: 1px solid var(--border); border-radius: 16px;
  padding: 20px 20px 18px; background: var(--paper);
}
.viz canvas { width: 100%; height: auto; aspect-ratio: 16 / 10; }
.viz-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.viz-title { font-family: var(--font-head); font-weight: 600; font-size: 1rem; margin: 0; }
.viz-formula { color: var(--text-soft); font-size: 0.95rem; overflow-x: auto; max-width: 100%; }
.viz-controls {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 10px; font-size: 0.95rem; color: var(--text-muted);
}
.viz-controls label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; flex: 1 1 260px; }
.viz-controls .lbl { white-space: nowrap; }
.viz-controls input[type="range"] { flex: 1 1 160px; accent-color: var(--pair1-b); min-width: 120px; }
.viz-controls output {
  font-family: var(--font-head); font-weight: 600; color: var(--ink);
  min-width: 2ch; text-align: right;
}
.viz-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.88rem; color: var(--text-muted); }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }

/* Sections */
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--panel-head); }
.section-intro { color: var(--text-soft); font-size: 1.1rem; margin-bottom: 36px; }
@media (max-width: 640px) { .section { padding: 52px 0; } }

/* Offer list (home) */
.offers { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.offers li {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 20px; align-items: start; padding: 26px 0;
  border-top: 1px solid var(--panel-head);
}
.offers li:last-child { border-bottom: 1px solid var(--panel-head); }
.offers h3 { margin-bottom: 4px; }
.offers p { margin: 0; color: var(--text-muted); }
.offers .go { align-self: center; white-space: nowrap; font-weight: 600; }
@media (max-width: 640px) {
  .offers li { grid-template-columns: 44px minmax(0, 1fr); }
  .offers .go { grid-column: 2; }
}

.mark { width: 44px; height: 44px; border-radius: 50%; position: relative; flex: none; }
.mark::after {
  content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  right: -4px; bottom: -4px; border: 3px solid var(--paper);
}
.mark-books { background: var(--pair1-a); } .mark-books::after { background: var(--pair1-b); }
.mark-work { background: var(--pair4-a); } .mark-work::after { background: var(--pair4-b); }
.mark-math { background: var(--pair5-a); } .mark-math::after { background: var(--pair5-b); }
.mark-phys { background: var(--pair6-a); } .mark-phys::after { background: var(--pair6-b); }
.mark-lessons { background: var(--pair2-a); } .mark-lessons::after { background: var(--pair2-b); }

/* Subject tags */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; font-weight: 600; color: var(--text-soft);
}
.tag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; }
.tag-math::before { background: var(--math); }
.tag-physics::before { background: var(--physics); }
.tag-books::before { background: var(--books); }
.tag-work::before { background: var(--workbooks); }

/* Lesson / post lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 22px 0; border-top: 1px solid var(--panel-head); }
.list li:last-child { border-bottom: 1px solid var(--panel-head); }
.list h3 { margin: 6px 0 6px; }
.list h3 a { color: var(--ink); text-decoration: none; }
.list h3 a:hover { text-decoration: underline; }
.list p { margin: 0; color: var(--text-muted); }
.meta { color: var(--text-muted); font-size: 0.9rem; }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; gap: 36px; } }

/* Page header */
.page-head { padding: 56px 0 8px; }
.page-head p { font-size: 1.15rem; color: var(--text-soft); }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); }

/* Note box */
.note {
  background: var(--tint-butter); border-left: 4px solid var(--pair4-a);
  padding: 18px 22px; border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-soft); max-width: 72ch;
}
.note p:last-child { margin-bottom: 0; }

/* Signup */
.signup {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px; align-items: center;
}
@media (max-width: 760px) { .signup { grid-template-columns: 1fr; gap: 20px; } }

/* Forms */
form { display: grid; gap: 16px; max-width: 560px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; }
input[type="text"], input[type="email"], textarea {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; width: 100%;
}
input:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--tint-sky); }
textarea { min-height: 160px; resize: vertical; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; max-width: none; }
.inline-form input { flex: 1 1 220px; }
.hp { position: absolute; left: -9999px; }
.form-hint { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

/* Article */
.article { padding: 40px 0 72px; }
.article .wrap { max-width: 760px; }
.article h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); }
.article h2 { font-size: 1.5rem; margin-top: 1.8em; }
.article p, .article li { color: var(--text-soft); }
.article .viz { margin: 28px 0; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 6px 0; }
.back { display: inline-block; margin-bottom: 18px; font-size: 0.95rem; }

/* About */
.about-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
.monogram {
  width: 200px; aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(from 200deg, var(--pair6-a), var(--pair6-b), var(--pair5-a), var(--pair2-b), var(--pair1-b), var(--pair1-a), var(--pair6-a));
  display: grid; place-items: center;
}
.monogram span {
  width: 74%; aspect-ratio: 1; border-radius: 50%; background: var(--paper);
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 3rem; color: var(--ink); letter-spacing: -0.03em;
}
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .monogram { width: 140px; }
  .monogram span { font-size: 2.1rem; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--panel-head); padding: 36px 0 44px; color: var(--text-muted); font-size: 0.92rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Self-hosted fonts */
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/atkinson-hyperlegible-next-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/schibsted-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/schibsted-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/schibsted-grotesk-latin-700-normal.woff2") format("woff2"); }
