/* =====================================================================
   TESSARY DESIGN SYSTEM: "Expressive Precision" (Handoff V1, sections 6, 10, 12, 16)
   The one source of values. Loaded by login.html (landing), index.html (signed-in app via tessary-app.css),
   privacy.html, terms.html and refund.html. Change a value here; never copy it into a page.
   Lives under /landing/ because that path is public (netlify.toml), and the legal pages need it before sign-in.
   Contrast checked: #111323 on #F8F8FC 17:1 | #555A73 on #F8F8FC 6.4:1 | #A9ADC9 on #111323 8.3:1 |
                     white on the primary button (#6F5CEB to #5543D4) at least 4.7:1 | #5340D0 on white 7.2:1
   Layers: palette -> neutrals -> type -> motion -> brand surfaces -> material (glass M2)
   ===================================================================== */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* palette (handoff 6.1 seed colours) */
  --ink: #111323;
  --ink-2: #181b30;
  --ink-3: #22264a;
  --cloud: #f8f8fc;
  --iris: #6b58e8;
  --iris-d: #5340d0;
  --iris-l: #b7a8fa;
  --aqua: #69d8cf;
  --coral: #ff947f;
  --gold: #f0ce77;

  /* neutrals derived by contrast testing */
  --slate: #555a73;          /* secondary text on Cloud */
  --slate-d: #a9adc9;        /* secondary text on Ink */
  --hair-l: rgba(17, 19, 35, 0.1);
  --hair-d: rgba(255, 255, 255, 0.12);

  /* page width (signed-in app and legal pages): content fills the screen up to 2200px, with a fluid gutter. The top bar, main,
     intro tip and footer all use it so their edges line up; inner columns cap their own line length, not the page */
  --page-gutter: clamp(16px, 3vw, 48px);
  --page-max: min(2200px, 100% - 2 * var(--page-gutter));
  --rail-w: clamp(320px, 26vw, 520px);   /* the right rail on Home, Practice, Me */

  /* type */
  --font-brand: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font: var(--font-brand);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  /* motion (handoff 12.2): press 80-160 ms, hover/focus 120-200 ms, panels 180-320 ms */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.3, 1.15, 0.4, 1);
  --t-press: 0.12s;
  --t-fast: 0.16s;
  --t-panel: 0.25s;

  /* brand surfaces: the one primary action, the active pill, the progress thread */
  --grad-primary: linear-gradient(180deg, #6f5ceb, #5543d4);
  --grad-primary-deep: linear-gradient(160deg, #6f5ceb, #3d2dab);
  --grad-thread: linear-gradient(90deg, var(--iris-l), var(--aqua));
  --shadow-primary: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -1px 0 rgba(0, 0, 0, 0.18), 0 10px 28px -8px rgba(107, 88, 232, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.1);
  --shadow-primary-hover: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -1px 0 rgba(0, 0, 0, 0.18), 0 14px 34px -8px rgba(107, 88, 232, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.14);
  --shadow-primary-calm: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.16), 0 1px 2px rgba(17, 19, 35, 0.2);

  /* glass (M2): fill, rim, edge, drop and sheen. Dark is the default (the landing sits on Ink); --light re-points them,
     and the signed-in app re-points them for its Light theme (tessary-app.css), so .glass follows the theme with no copied values */
  --glass-fill-dark: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  --glass-rim-dark: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.08) 38%, rgba(255, 255, 255, 0.03) 62%, rgba(255, 255, 255, 0.42));
  --glass-edge-dark: inset 0 1px 0 rgba(255, 255, 255, 0.32), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  --glass-drop-dark: 0 12px 32px -8px rgba(6, 6, 20, 0.5);
  --glass-sheen-dark: rgba(255, 255, 255, 0.22);  /* a colour: the pointer position (--mx, --my) is read where the sheen is drawn */
  --glass-solid-dark: linear-gradient(145deg, #2a2e57, #1a1d38);
  --glass-fill: var(--glass-fill-dark);
  --glass-rim: var(--glass-rim-dark);
  --glass-edge: var(--glass-edge-dark);
  --glass-drop: var(--glass-drop-dark);
  --glass-sheen: var(--glass-sheen-dark);
  --glass-solid: var(--glass-solid-dark);

  --glass-fill-light: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.55));
  --glass-rim-light: linear-gradient(135deg, #fff, rgba(17, 19, 35, 0.1) 40%, rgba(17, 19, 35, 0.06) 70%, rgba(255, 255, 255, 0.95));
  --glass-edge-light: inset 0 1px 0 #fff;
  --glass-drop-light: 0 14px 34px -14px rgba(50, 36, 140, 0.35);
  --glass-sheen-light: rgba(107, 88, 232, 0.14);
  --glass-solid-light: #fff;
}

/* =====================================================================
   MATERIAL: Liquid Glass-inspired interaction layer
   M0 opaque content | M1 soft cards | M2 interactive glass | M3 hero object
   Glass belongs on the layer that carries controls, never on the content a student reads.
   ===================================================================== */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(18px) saturate(1.7);
  backdrop-filter: blur(18px) saturate(1.7);
  box-shadow: var(--glass-edge), var(--glass-drop);
}
/* the thin specular rim: a gradient border built with a mask */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--glass-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  z-index: 2;
}
/* a soft sheen that follows the pointer */
.glass::after, .sheen::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(160px circle at var(--mx, 50%) var(--my, 0%), var(--glass-sheen), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  z-index: 1;
}
.glass:hover::after, .sheen:hover::after { opacity: 1; }
.glass--light {
  --glass-fill: var(--glass-fill-light);
  --glass-rim: var(--glass-rim-light);
  --glass-edge: var(--glass-edge-light);
  --glass-drop: var(--glass-drop-light);
  --glass-sheen: var(--glass-sheen-light);
  --glass-solid: var(--glass-solid-light);
}

/* the fallback is a first-class material, not a broken downgrade */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-solid); }
}
html[data-glass="solid"] .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-solid); }
