/* ==========================================================================
   RECAP — Reading English for Career and Academic Purposes
   DHARU Education
   Stylesheet
   --------------------------------------------------------------------------
   Contents
     1.  Design tokens (light)
     2.  Design tokens (dark)
     3.  Base elements
     4.  Layout helpers
     5.  Site header & navigation
     6.  Buttons
     7.  Hero & the stage ladder
     8.  Cards, grids and lists
     9.  Programme phases
     10. Stages demo (interactive)
     11. FAQ
     12. Contact & footer
     13. Motion preferences

   All colours and fonts live in section 1. Section 2 holds the dark-mode
   values; the site follows the visitor's system setting automatically.
   ========================================================================== */


/* 1. Design tokens — light ------------------------------------------------ */

:root {
  /* Palette: paper with a green bias, forest ink, harvest gold */
  --ground:      #F1F3EE;
  --surface:     #FBFCF9;
  --surface-2:   #E4E9E0;
  --ink:         #14201B;
  --ink-2:       #4B5A53;
  --ink-3:       #6F7E76;
  --rule:        #D0D8CC;
  --primary:     #13453A;
  --primary-2:   #1C5F4E;
  --accent:      #A8710F;
  --accent-fill: #E9C97C;
  --spark:       #B23A18;
  --on-primary:  #F1F3EE;

  /* The RECAP logo red. Used only for logo surroundings, never for text. */
  --brand-red:   #C1183F;

  /* Type */
  --f-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-body: "Karla", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Fluid type scale */
  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.85rem);
  --step-0:  clamp(1rem, 0.97rem + 0.16vw, 1.09rem);
  --step-1:  clamp(1.2rem, 1.13rem + 0.34vw, 1.4rem);
  --step-2:  clamp(1.45rem, 1.31rem + 0.66vw, 1.85rem);
  --step-3:  clamp(1.8rem, 1.53rem + 1.3vw, 2.6rem);
  --step-4:  clamp(2.3rem, 1.7rem + 2.8vw, 4.1rem);

  /* Layout */
  --container: 1120px;
  --radius: 3px;

  color-scheme: light dark;
}


/* 2. Design tokens — dark -------------------------------------------------
   Two blocks so all three viewer states resolve correctly:
   - system preference (no attribute on <html>)
   - an explicit data-theme="dark" / data-theme="light"                      */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:      #0D1411;
    --surface:     #141E1A;
    --surface-2:   #1C2823;
    --ink:         #E7EDE6;
    --ink-2:       #A3B2A9;
    --ink-3:       #83928A;
    --rule:        #29372F;
    --primary:     #7CC7AB;
    --primary-2:   #A6DCC6;
    --accent:      #E0AE55;
    --accent-fill: #5C4517;
    --spark:       #F0805C;
    --on-primary:  #0D1411;
    --brand-red:   #C1183F;
  }
}

:root[data-theme="dark"] {
  --ground:      #0D1411;
  --surface:     #141E1A;
  --surface-2:   #1C2823;
  --ink:         #E7EDE6;
  --ink-2:       #A3B2A9;
  --ink-3:       #83928A;
  --rule:        #29372F;
  --primary:     #7CC7AB;
  --primary-2:   #A6DCC6;
  --accent:      #E0AE55;
  --accent-fill: #5C4517;
  --spark:       #F0805C;
  --on-primary:  #0D1411;
  --brand-red:   #C1183F;
}


/* 3. Base elements -------------------------------------------------------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 400;
  text-wrap: balance;
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.012em;
}

p { margin: 0; }
a { color: inherit; }

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 40;
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-size: var(--step--1);
  text-decoration: none;
  transition: top 140ms ease;
}
.skip-link:focus { top: 0.75rem; }


/* 4. Layout helpers ------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}

.prose { max-width: 64ch; }

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

section { padding-block: clamp(3.4rem, 7vw, 6rem); }

section > .wrap {
  display: flex;
  flex-direction: column;
  gap: clamp(1.6rem, 3vw, 2.6rem);
}

.band {
  background: var(--surface);
  border-block: 1px solid var(--rule);
}

.band-deep {
  background: var(--primary);
  color: var(--on-primary);
}
.band-deep h2,
.band-deep h3 { color: var(--on-primary); }
.band-deep .eyebrow { color: var(--accent-fill); }
.band-deep p { color: color-mix(in srgb, var(--on-primary) 82%, transparent); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.section-title { font-size: var(--step-3); }
.lede-muted { color: var(--ink-2); }


/* 5. Site header & navigation --------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 96px;
  padding-block: 0.7rem;
}

/* Wordmark lockup: the logo block, then the expanded name on two lines,
   sized so the pair sits within the logo's height. */
.mark {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}
.mark img {
  display: block;
  height: clamp(56px, 5.4vw, 76px);
  width: auto;
  border-radius: var(--radius);
}
.mark .expansion {
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  line-height: 1.55;
  text-transform: uppercase;
  color: var(--ink-3);
  border-left: 1px solid var(--rule);
  padding-left: 0.75rem;
}

@media (max-width: 560px) {
  .mark .expansion { display: none; }
  .site-header .wrap { min-height: 78px; }
}

.site-nav {
  display: flex;
  gap: clamp(0.9rem, 2vw, 1.7rem);
  align-items: center;
}
.site-nav a {
  font-size: var(--step--1);
  text-decoration: none;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  padding-block: 0.4rem;
  border-bottom: 1px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}
.site-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

@media (max-width: 860px) {
  .site-nav .hide-sm { display: none; }
}


/* 6. Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.72rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--on-primary);
  cursor: pointer;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease;
}
.btn:hover {
  transform: translateY(-1px);
  background: var(--primary-2);
  border-color: var(--primary-2);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn.ghost:hover {
  background: transparent;
  border-color: var(--accent);
}

.band-deep .btn {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: #14201B;
}
.band-deep .btn:hover {
  background: var(--on-primary);
  border-color: var(--on-primary);
  color: var(--primary);
}
.band-deep .btn.ghost {
  background: transparent;
  color: var(--on-primary);
  border-color: color-mix(in srgb, var(--on-primary) 40%, transparent);
}
.band-deep .btn.ghost:hover {
  background: transparent;
  border-color: var(--on-primary);
  color: var(--on-primary);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}


/* 7. Hero & the stage ladder ---------------------------------------------- */

.hero { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 6vw, 5rem); }

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
}

.hero h1 {
  font-size: var(--step-4);
  line-height: 1.02;
  margin-block: 0.6rem 0;
}
.hero h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--primary);
}
.hero .lede {
  font-size: var(--step-1);
  color: var(--ink-2);
  max-width: 34ch;
  margin-top: 1.4rem;
}
.hero .actions { margin-top: 2rem; }

.hero-meta {
  margin-top: 2.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  font-family: var(--f-mono);
  font-size: var(--step--1);
  color: var(--ink-3);
}

.ladder {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 2.4vw, 1.8rem);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.ladder h2 { font-size: var(--step-1); }
.ladder > p { color: var(--ink-2); font-size: var(--step--1); }

.ladder dl {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
}

.rung {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: stretch;
}
.rung .bar {
  width: 6px;
  min-height: 2.4rem;
  background: var(--accent-fill);
  border-radius: 6px;
}
.rung--2 .bar { background: color-mix(in srgb, var(--accent) 60%, var(--accent-fill)); }
.rung--3 .bar { background: var(--primary); }

.rung dt {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.rung dd {
  margin: 0.15rem 0 0;
  color: var(--ink-2);
  font-size: var(--step--1);
  line-height: 1.5;
}

.ladder .foot {
  font-size: var(--step--1);
  color: var(--ink-3);
  border-top: 1px solid var(--rule);
  padding-top: 0.9rem;
  font-style: italic;
  font-family: var(--f-display);
}


/* 8. Cards, grids and lists ----------------------------------------------- */

.grid { display: grid; gap: 1.1rem; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-wide { gap: clamp(1.6rem, 4vw, 3.5rem); }

@media (max-width: 940px) {
  .g-3,
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .g-2,
  .g-3,
  .g-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.4rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.card h3 { font-size: var(--step-1); }
.card p {
  color: var(--ink-2);
  font-size: var(--step--1);
  line-height: 1.6;
}
.card .tag {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.card .plain { margin-top: 0.4rem; }

ul.plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
ul.plain li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--ink-2);
  font-size: var(--step--1);
  line-height: 1.55;
}
ul.plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.55rem;
  height: 1px;
  background: var(--accent);
}

.band-deep ul.plain li { color: color-mix(in srgb, var(--on-primary) 80%, transparent); }
.band-deep ul.plain li::before { background: var(--accent-fill); }


/* 9. Programme phases ----------------------------------------------------- */

.phases {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.phase {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.4rem);
  padding-block: 1.9rem;
  border-top: 1px solid var(--rule);
  align-items: start;
}
.phase:last-child { border-bottom: 1px solid var(--rule); }

@media (max-width: 800px) {
  .phase {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
}

.phase .num {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 0.35rem;
}
.phase .num b {
  display: block;
  color: var(--accent);
  font-weight: 500;
}
.phase h3 {
  font-size: var(--step-2);
  margin-bottom: 0.5rem;
}
.phase .phase-body p {
  color: var(--ink-2);
  font-size: var(--step--1);
}


/* 10. Stages demo (interactive) ------------------------------------------- */

.demo {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.demo .tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
}
.demo .tabs button {
  flex: 1 1 12rem;
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 0.95rem 1rem;
  text-align: left;
  cursor: pointer;
  color: var(--ink-3);
  font-family: var(--f-body);
  font-size: var(--step--1);
  line-height: 1.35;
  transition: color 140ms ease, background 140ms ease;
}
.demo .tabs button + button { border-left: 1px solid var(--rule); }
.demo .tabs button span {
  display: block;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.15rem;
}
.demo .tabs button strong {
  font-weight: 600;
  color: var(--ink-2);
}
.demo .tabs button:hover { background: var(--surface-2); }
.demo .tabs button[aria-selected="true"] {
  border-bottom-color: var(--accent);
  background: var(--surface-2);
}
.demo .tabs button[aria-selected="true"] strong { color: var(--ink); }
.demo .tabs button[aria-selected="true"] span { color: var(--accent); }

.demo .stage {
  padding: clamp(1.3rem, 3vw, 2.2rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(1.2rem, 3vw, 2.4rem);
}
@media (max-width: 760px) {
  .demo .stage { grid-template-columns: 1fr; }
}

.demo .sentence {
  font-family: var(--f-display);
  font-size: var(--step-2);
  line-height: 1.35;
}
.demo .sentence i {
  font-style: normal;
  border-bottom: 2px solid var(--accent-fill);
}

.demo .think {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  color: var(--ink-2);
  line-height: 1.7;
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
}

.demo .meta {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.demo .meta p {
  color: var(--ink-2);
  font-size: var(--step--1);
}

.meter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.meter .lab {
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.meter .track {
  height: 7px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
}
.meter .fill {
  height: 100%;
  background: var(--spark);
  transition: width 320ms ease;
}
.meter.low .fill { background: var(--primary); }


/* 11. FAQ ----------------------------------------------------------------- */

details.faq {
  border-top: 1px solid var(--rule);
  padding-block: 1.05rem;
}
details.faq:last-of-type { border-bottom: 1px solid var(--rule); }

details.faq summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--f-display);
  font-size: var(--step-1);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: baseline;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  font-family: var(--f-mono);
  color: var(--accent);
  font-size: var(--step-0);
  flex: none;
}
details.faq[open] summary::after { content: "\2013"; }

details.faq p {
  margin-top: 0.7rem;
  color: var(--ink-2);
  font-size: var(--step--1);
  max-width: 68ch;
}


/* 12. Contact & footer ---------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(1.6rem, 4vw, 3.5rem);
  align-items: start;
}
@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
}
.detail-list dt {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-fill);
}
.detail-list dd {
  margin: 0.2rem 0 0;
  font-size: var(--step-0);
}
.detail-list a {
  text-decoration: none;
  border-bottom: 1px solid var(--accent-fill);
}

/* Placeholder marker — delete the class once real content is in place. */
.ph {
  font-family: var(--f-mono);
  font-size: 0.85em;
  padding: 0.1rem 0.4rem;
  border: 1px dashed color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 2px;
  opacity: 0.85;
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.4rem;
  background: var(--surface);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer p {
  font-size: var(--step--1);
  color: var(--ink-3);
  max-width: 52ch;
}
.site-footer .foot-brand {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.site-footer img {
  display: block;
  height: 76px;
  width: auto;
  flex: none;
  border-radius: var(--radius);
}


/* 13. Motion preferences -------------------------------------------------- */

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