/* DigiSkillHub design tokens + component specs. One template set, two themes.
   Usage: <html data-theme="clean"> or <html data-theme="noir">. Clean is the default.
   Fonts (load once in <head>):
   https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400..700&family=Inter:wght@400..700&display=swap
   Contrast: every text/background pair below is asserted by build/contrast_check.py (WCAG AA). */

:root {
  /* Type. Fraunces = display (warm, editorial, premium). Inter = everything you read or tap. */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-12: 0.75rem;  --fs-14: 0.875rem; --fs-16: 1rem;   --fs-18: 1.125rem;
  --fs-20: 1.25rem;  --fs-24: 1.5rem;   --fs-32: 2rem;   --fs-44: 2.75rem;
  --fs-60: 3.75rem;  --fs-76: 4.75rem;
  --lh-tight: 1.06; --lh-snug: 1.25; --lh-body: 1.6;
  --track-display: -0.022em; --track-caps: 0.14em;

  /* Spacing: 4px base. Sections breathe at 96 to 128. */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px; --sp-10: 128px;
  --container: 1160px; --measure: 62ch;

  /* Radius */
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 28px; --r-pill: 999px;

  /* Brand constants (same in both themes) */
  --ink: #0B0B0F;
  --ivory: #F7F5F0;
  --gold-1: #F3D27A; --gold-2: #D4A017; --gold-3: #8C6408;
  --red-1: #F0575A; --red-2: #D92B2F; --red-3: #8E1418;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- THEME: clean (light, trust) ---------- */
:root, [data-theme="clean"] {
  color-scheme: light;
  --bg: #FFFFFF;
  --bg-soft: #F7F5F0;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --text: #111114;
  --text-2: #45454D;
  --muted: #65656E;
  --border: #E7E3DA;
  --border-strong: #111114;
  --cta: #CC3D27;            /* spec coral #E0533D darkened so white text passes AA */
  --cta-hover: #B53320;
  --cta-text: #FFFFFF;
  --btn-dark: #111114;
  --btn-dark-text: #FFFFFF;
  --accent: #7A5800;         /* gold as text on light */
  --accent-fill: #F6EBCB;    /* gold wash behind badges */
  --accent-line: #C9971A;
  --ok: #14713D;
  --ok-fill: #E4F3EA;
  --ring: #CC3D27;
  --hero-glow: radial-gradient(900px 480px at 78% 10%, #FBEFD6 0%, rgba(251, 239, 214, 0) 62%);
  --edge-light: inset 0 1px 0 rgba(255, 255, 255, .9);
  --sh-1: 0 1px 2px rgba(17, 17, 20, .06), 0 2px 6px rgba(17, 17, 20, .04);
  --sh-2: 0 2px 4px rgba(17, 17, 20, .05), 0 10px 24px -6px rgba(17, 17, 20, .10);
  --sh-3: 0 4px 8px rgba(17, 17, 20, .05), 0 24px 48px -12px rgba(17, 17, 20, .18), 0 48px 96px -32px rgba(17, 17, 20, .16);
  --sh-cta: 0 1px 0 rgba(255, 255, 255, .28) inset, 0 -2px 0 rgba(0, 0, 0, .16) inset, 0 8px 20px -6px rgba(204, 61, 39, .55);
}

/* ---------- THEME: noir (dark, premium) ---------- */
[data-theme="noir"] {
  color-scheme: dark;
  --bg: #0B0B0F;
  --bg-soft: #101015;
  --surface: #15151B;
  --surface-2: #1C1C24;
  --text: #F5F3EE;
  --text-2: #CFCDC6;
  --muted: #A09EA6;
  --border: #2B2B35;
  --border-strong: #F5F3EE;
  --cta: #D92B2F;            /* spec red #E5383B darkened so white text passes AA */
  --cta-hover: #C22327;
  --cta-text: #FFFFFF;
  --btn-dark: #F5F3EE;
  --btn-dark-text: #0B0B0F;
  --accent: #E2B43C;         /* gold as text on dark */
  --accent-fill: #2A2210;
  --accent-line: #D4A017;
  --ok: #5FD38D;
  --ok-fill: #11261A;
  --ring: #E5383B;
  --hero-glow: radial-gradient(900px 520px at 78% 0%, rgba(212, 160, 23, .16) 0%, rgba(212, 160, 23, 0) 60%),
               radial-gradient(700px 420px at 8% 30%, rgba(217, 43, 47, .12) 0%, rgba(217, 43, 47, 0) 60%);
  --edge-light: inset 0 1px 0 rgba(255, 255, 255, .07);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .5);
  --sh-2: 0 2px 4px rgba(0, 0, 0, .4), 0 12px 28px -8px rgba(0, 0, 0, .7);
  --sh-3: 0 4px 10px rgba(0, 0, 0, .45), 0 28px 60px -12px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .03);
  --sh-cta: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 -2px 0 rgba(0, 0, 0, .25) inset, 0 10px 28px -6px rgba(229, 56, 59, .6);
}

/* ---------- Base ---------- */
.dsh { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: var(--fs-16);
  line-height: var(--lh-body); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
.dsh *, .dsh *::before, .dsh *::after { box-sizing: border-box; }
.dsh-container { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-5); }
.dsh-display { font-family: var(--font-display); font-weight: 560; letter-spacing: var(--track-display);
  line-height: var(--lh-tight); font-optical-sizing: auto; margin: 0; text-wrap: balance; }
.dsh-h1 { font-size: clamp(var(--fs-44), 6.2vw, var(--fs-76)); }
.dsh-h2 { font-size: clamp(var(--fs-32), 4vw, var(--fs-44)); }
.dsh-h3 { font-size: var(--fs-24); line-height: var(--lh-snug); }
.dsh-lead { font-size: var(--fs-20); color: var(--text-2); max-width: var(--measure); margin: 0; }
.dsh-eyebrow { font-size: var(--fs-12); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--accent); display: inline-flex; align-items: center; gap: var(--sp-2); }
.dsh-eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--accent-line); }
.dsh-muted { color: var(--muted); }
.dsh-num { font-variant-numeric: tabular-nums lining-nums; }
.dsh a:focus-visible, .dsh button:focus-visible, .dsh-btn:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }

/* ---------- Buttons: min height 48 (tap target), physical top light + bottom shade ---------- */
.dsh-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 48px;
  padding: 0 var(--sp-5); border-radius: var(--r-md); border: 1px solid transparent; font: 600 var(--fs-16)/1 var(--font-body);
  letter-spacing: -0.005em; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease); }
.dsh-btn:active { transform: translateY(1px); }
.dsh-btn--cta { background: linear-gradient(180deg, var(--cta) 40%, color-mix(in srgb, var(--cta) 86%, #000) 100%); color: var(--cta-text); box-shadow: var(--sh-cta); }
.dsh-btn--cta:hover { background: var(--cta-hover); transform: translateY(-1px); }
.dsh-btn--dark { background: var(--btn-dark); color: var(--btn-dark-text); box-shadow: var(--sh-1); }
.dsh-btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.dsh-btn--quiet { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.dsh-btn--lg { min-height: 58px; padding: 0 var(--sp-6); font-size: var(--fs-18); border-radius: 14px; }
.dsh-btn--block { width: 100%; }

/* ---------- Badges ---------- */
.dsh-badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  font: 600 var(--fs-12)/1 var(--font-body); letter-spacing: .02em; white-space: nowrap; border: 1px solid var(--border); color: var(--text-2); background: var(--surface-2); }
.dsh-badge--gold { color: var(--accent); background: var(--accent-fill); border-color: color-mix(in srgb, var(--accent-line) 45%, transparent); }
.dsh-badge--ok { color: var(--ok); background: var(--ok-fill); border-color: transparent; }
.dsh-badge--solid { color: var(--cta-text); background: var(--cta); border-color: transparent; }
.dsh-badge--caps { text-transform: uppercase; letter-spacing: var(--track-caps); font-size: 11px; }

/* ---------- Cards ---------- */
.dsh-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-5);
  box-shadow: var(--sh-1), var(--edge-light); }
.dsh-card--raised { box-shadow: var(--sh-2), var(--edge-light); }
.dsh-card--locked { background: transparent; border-style: dashed; border-color: color-mix(in srgb, var(--muted) 55%, transparent); box-shadow: none; }
.dsh-card__title { font: 600 var(--fs-18)/var(--lh-snug) var(--font-body); margin: 0 0 var(--sp-1); }
.dsh-price { font: 600 var(--fs-32)/1 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: lining-nums; }
.dsh-price small { font: 500 var(--fs-14)/1 var(--font-body); color: var(--muted); letter-spacing: 0; }

/* rupee sign: Fraunces has no good one, so the currency mark is always set in Inter */
.dsh-cur { font-family: var(--font-body); font-weight: 500; font-size: .78em; margin-right: .04em; }

/* ---------- Tier cards: three ways in. The middle one is lifted, ringed, pre-selected ---------- */
.dsh-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); align-items: stretch; }
.dsh-tier { position: relative; display: flex; flex-direction: column; gap: var(--sp-4); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--sp-6) var(--sp-5) var(--sp-5); box-shadow: var(--sh-1), var(--edge-light); }
.dsh-tier--pick { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent), var(--sh-3), var(--edge-light);
  transform: translateY(-14px); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.dsh-tier__flag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); }
.dsh-tier__name { font: 600 var(--fs-14)/1 var(--font-body); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--muted); }
.dsh-tier ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: var(--fs-14); color: var(--text-2); }
.dsh-tier li { position: relative; padding-left: 28px; }  /* not grid: inline children (prices, links) must stay in the text flow */
.dsh-tier li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ok-fill)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.4l2.6 2.6L13 6.6' fill='none' stroke='%232F9E62' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat; }
.dsh-tier li.no { color: var(--muted); }
.dsh-tier li.no::before { background: var(--surface-2)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M6 9h6' fill='none' stroke='%23909099' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/18px no-repeat; }
.dsh-tier .dsh-btn { margin-top: auto; }

/* ---------- Trust row ---------- */
.dsh-trust { display: flex; flex-wrap: wrap; gap: 10px var(--sp-5); align-items: center; font-size: var(--fs-14); color: var(--text-2); }
.dsh-trust > * { display: inline-flex; align-items: center; gap: var(--sp-2); }
.dsh-trust svg { width: 18px; height: 18px; flex: none; color: var(--accent); }

/* ---------- Sticky buy bar ---------- */
.dsh-sticky { position: sticky; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--border); box-shadow: 0 -12px 32px -16px rgba(0, 0, 0, .28); }
.dsh-sticky__in { max-width: var(--container); margin: 0 auto; padding: var(--sp-3) var(--sp-5); display: flex; align-items: center; gap: var(--sp-5); }
.dsh-sticky__name { font: 600 var(--fs-16)/1.2 var(--font-body); }
.dsh-sticky__note { font-size: var(--fs-12); color: var(--muted); }
.dsh-sticky__price { margin-left: auto; font: 600 var(--fs-24)/1 var(--font-display); font-variant-numeric: lining-nums; }

/* ---------- Form field ---------- */
.dsh-field { display: grid; gap: 6px; font-size: var(--fs-14); font-weight: 500; }
.dsh-input { min-height: 48px; padding: 0 var(--sp-4); border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: 400 var(--fs-16)/1 var(--font-body); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .05); }
.dsh-input::placeholder { color: var(--muted); }
.dsh-input:focus { outline: 3px solid color-mix(in srgb, var(--ring) 35%, transparent); border-color: var(--ring); }

/* ---------- Layout helpers ---------- */
.dsh-section { padding: var(--sp-9) 0; }
.dsh-rule { height: 1px; border: 0; background: linear-gradient(90deg, transparent, var(--border) 15%, var(--border) 85%, transparent); margin: 0; }
.dsh-goldrule { height: 1px; border: 0; background: linear-gradient(90deg, transparent, var(--accent-line), transparent); opacity: .7; margin: 0; }

@media (max-width: 820px) {
  .dsh-tiers { grid-template-columns: 1fr; }
  .dsh-tier--pick { transform: none; order: -1; }
  .dsh-section { padding: var(--sp-8) 0; }
  .dsh-lead { font-size: var(--fs-18); }
  .dsh-sticky__in { gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); }
  .dsh-sticky__note { display: none; }
}
@media (prefers-reduced-motion: reduce) { .dsh-btn { transition: none; } }
