/* Kiltinou
 *
 * Palette is taken from Port-au-Prince gingerbread houses rather than from the
 * flag alone: saturated blue walls, turquoise and mango trim, white fretwork.
 * Flag red appears rarely, so it still reads as the flag when it does.
 */

:root {
  /* Constants across every theme. The flag red is the thread that holds the
     site together: a chef page and a scholar page share almost no colour
     except this one, and that is deliberate. */
  --nwa:   #12100E;
  --mak:   #D21034;

  /* Semantic layer. A theme overrides these and nothing else, which is why a
     new discipline costs a stylesheet block rather than a redesign. */
  --ground:      #0A2472;
  --ground-deep: #061A54;
  --ground-lift: #1B3FA8;
  --aksan:       #F5A623;
  --aksan-2:     #35B6A6;
  --panel:       #FFF8ED;
  --panel-2:     #F0E6D6;
  --ink:         #12100E;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body:    "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --mono:    "Martian Mono", ui-monospace, "SF Mono", monospace;

  --shell: 1140px;
  --gap:   clamp(3.5rem, 8vw, 7rem);
}

/* Chefs. Charcoal fire and a hot kitchen: burnt aubergine ground, scotch
   bonnet, plantain. Warmer and closer than the scholar blue. */
.theme-chefs {
  --ground:      #3B1A22;
  --ground-deep: #2A1017;
  --ground-lift: #5C2A32;
  --aksan:       #F07021;
  --aksan-2:     #8FBF52;
  --panel:       #FFF4E6;
  --panel-2:     #F5E2CB;
}

/* Musicians. Night and brass. */
.theme-musicians {
  --ground:      #241B4A;
  --ground-deep: #171034;
  --ground-lift: #3A2C70;
  --aksan:       #E8B44A;
  --aksan-2:     #5FBFD4;
  --panel:       #FAF6F0;
  --panel-2:     #EBE3D8;
}

/* Artists. Drapo sequins: saturated, unafraid of clashing. */
.theme-artists {
  --ground:      #10403C;
  --ground-deep: #0A2E2B;
  --ground-lift: #1B5E58;
  --aksan:       #F25C54;
  --aksan-2:     #F2C14E;
  --panel:       #FDF6F0;
  --panel-2:     #F2E4DA;
}

/* Storytellers. Firelight against a night sky. */
.theme-storytellers {
  --ground:      #16233D;
  --ground-deep: #0D1728;
  --ground-lift: #2A3D63;
  --aksan:       #E8A33D;
  --aksan-2:     #C97B84;
  --panel:       #FBF7F0;
  --panel-2:     #EDE4D6;
}

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

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

body {
  margin: 0;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
  background: var(--aksan);
  color: var(--nwa);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  z-index: 50;
}
.skip:focus { left: 1rem; top: 1rem; }

:focus-visible {
  outline: 3px solid var(--aksan);
  outline-offset: 3px;
}

/* ---------------------------------------------------------- masthead */

.masthead {
  padding-block: 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  position: sticky;
  top: 0;
  z-index: 20;
}

.masthead-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  font-variation-settings: "wdth" 88;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark-accent { color: var(--aksan); }

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.9375rem;
}

.nav a {
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  text-decoration: none;
  font-weight: 500;
}

.nav a:hover { color: var(--ink); }

.nav-cta {
  background: var(--ground);
  border-radius: 999px;
  padding: 0.5rem 1.15rem;
  color: var(--panel) !important;
}

.nav-cta:hover { background: var(--ground-deep); }

/* ---------------------------------------------------------- hero */

.hero {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--gap);
  background: var(--panel);
}

.hero-in {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 62rem) {
  .hero-in {
    grid-template-columns: 1.05fr 0.95fr;
    /* The exchange column is taller than the pitch. Centring the pitch
       against it stops the buttons floating in dead space. */
    align-items: center;
  }
}

/* The exchange is the signature: an interview question, the recorded answer
   as raw transcript, and what it becomes. */

.exchange {
  display: grid;
  gap: 1.25rem;
}

.turn {
  position: relative;
  padding: 1.5rem 1.5rem 1.25rem;
  border-radius: 4px;
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}

.turn-ask {
  background: var(--panel-2);
  border-left: 3px solid var(--aksan);
  animation-delay: 0.05s;
}

.turn-answer {
  background: var(--ground-deep);
  border-left: 3px solid var(--aksan-2);
  animation-delay: 0.5s;
}

.turn-result {
  animation-delay: 1.5s;
  padding: 0;
  text-align: center;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.cue {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.cue-ask    { color: var(--aksan); }
.cue-answer { color: var(--aksan-2); }

.question {
  font-family: var(--display);
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.6rem);
  font-weight: 500;
  font-variation-settings: "wdth" 92;
  line-height: 1.3;
  margin: 0 0 0.9rem;
  color: var(--ink);
}

.transcript {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 300;
  line-height: 1.85;
  margin: 0 0 0.9rem;
  color: color-mix(in srgb, var(--panel) 78%, transparent);
}

.tw {
  display: block;
  opacity: 0;
  animation: speak 0.45s ease-out forwards;
}

.tw:nth-child(1) { animation-delay: 0.75s; }
.tw:nth-child(2) { animation-delay: 0.95s; }
.tw:nth-child(3) { animation-delay: 1.15s; }
.tw:nth-child(4) { animation-delay: 1.35s; }
.tw:nth-child(5) { animation-delay: 1.55s; }

@keyframes speak {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.turn-by {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
}

.becomes {
  display: block;
  color: var(--aksan-2);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.lesson-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0;
  padding: 0.7rem 1.25rem;
  background: var(--ground);
  color: var(--panel);
  border-radius: 3px;
  text-align: left;
}

.lesson-no {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--aksan);
  white-space: nowrap;
}

.lesson-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
}

/* ---------------------------------------------------------- pitch */

.pitch h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4rem);
  font-weight: 800;
  font-variation-settings: "wdth" 84;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
}

.lede {
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.65;
  color: color-mix(in srgb, var(--ink) 78%, transparent);
  margin: 0 0 2rem;
  max-width: 46ch;
}

.lede-second {
  font-size: 1rem;
  color: color-mix(in srgb, var(--ink) 62%, transparent);
  padding-left: 1rem;
  border-left: 2px solid var(--aksan-2);
}

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

.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--ground);
  color: var(--panel);
}

.btn-primary:hover { background: var(--ground-deep); }

.btn-ghost {
  border: 1px solid color-mix(in srgb, var(--ink) 26%, transparent);
  color: var(--ink);
}

.btn-ghost:hover { border-color: var(--ink); }

/* ---------------------------------------------------------- fretwork
 *
 * Gingerbread houses are trimmed with cut wooden lace along the eaves. This
 * is the one ornamental element on the page and it earns its place by
 * marking the seam between sections.
 */

.fretwork {
  height: 14px;
  background-color: var(--ground-deep);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='22' viewBox='0 0 48 22'%3E%3Cpath d='M0 0h48v6H0z'/%3E%3Cpath d='M24 6 34 22H14z'/%3E%3Ccircle cx='4' cy='12' r='3'/%3E%3Ccircle cx='44' cy='12' r='3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='22' viewBox='0 0 48 22'%3E%3Cpath d='M0 0h48v6H0z'/%3E%3Cpath d='M24 6 34 22H14z'/%3E%3Ccircle cx='4' cy='12' r='3'/%3E%3Ccircle cx='44' cy='12' r='3'/%3E%3C/svg%3E");
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: 26px 14px;
  mask-size: 26px 14px;
}

.fretwork-flip { transform: scaleY(-1); }

/* ---------------------------------------------------------- bands */

.band { padding-block: var(--gap); }

.band-light {
  background: var(--panel);
  color: var(--nwa);
}

.band-blue {
  background: var(--ground-deep);
  color: var(--panel);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mak);
  margin: 0 0 0.75rem;
}

.eyebrow-light { color: var(--aksan); }

.band-title {
  font-family: var(--display);
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.9rem);
  font-weight: 700;
  font-variation-settings: "wdth" 86;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0 0 1.25rem;
  max-width: 20ch;
}

.band-title-light { color: var(--panel); }

.band-lede {
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 58ch;
  margin: 0 0 2.5rem;
  color: color-mix(in srgb, currentColor 82%, transparent);
}

.band-lede + .band-lede { margin-top: -1.25rem; }

/* ---------------------------------------------------------- stages */

.stages {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.stage {
  position: relative;
  padding: 1.75rem 1.5rem;
  background: color-mix(in srgb, var(--panel-2) 60%, transparent);
  border-top: 3px solid var(--ground-lift);
  border-radius: 2px;
}

.stage-no {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ground-lift);
  display: block;
  margin-bottom: 0.75rem;
}

.stage h3 {
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  color: var(--nwa);
}

.stage p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.62;
  color: color-mix(in srgb, var(--nwa) 76%, transparent);
}

/* Stage two is the only one the scholar does, so it is the only one
   coloured. The emphasis is the point being made. */
.stage-yours {
  background: color-mix(in srgb, var(--aksan-2) 14%, var(--panel));
  border-top-color: var(--aksan-2);
}

.stage-yours .stage-no { color: var(--aksan-2); }

.yours-tag {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #10756a;
}

/* ---------------------------------------------------------- languages */

.langs {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.lang {
  padding: 1.5rem;
  border: 1px solid color-mix(in srgb, var(--panel) 18%, transparent);
  border-radius: 2px;
}

.lang h3 {
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--aksan);
}

.lang p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: color-mix(in srgb, var(--panel) 76%, transparent);
}

/* ---------------------------------------------------------- teach */

.teach {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 56rem) {
  .teach { grid-template-columns: 1.15fr 0.85fr; }
}

.fine {
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--nwa) 60%, transparent);
  max-width: 42ch;
}

.teach-aside {
  padding: 1.75rem;
  background: var(--ground-deep);
  color: var(--panel);
  border-radius: 2px;
}

.aside-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aksan-2);
  margin: 0 0 0.9rem;
}

.aside-label-helps {
  color: var(--aksan);
  margin-top: 1.75rem;
}

.aside-label-not {
  color: color-mix(in srgb, var(--panel) 44%, transparent);
  margin-top: 1.75rem;
}

.need {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
  font-size: 0.9375rem;
}

.need li {
  padding-bottom: 0.7rem;
  border-bottom: 1px solid color-mix(in srgb, var(--panel) 12%, transparent);
  color: color-mix(in srgb, var(--panel) 74%, transparent);
}

.need li:last-child { border-bottom: none; padding-bottom: 0; }

.need span {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  color: var(--panel);
}

.need-not li {
  color: color-mix(in srgb, var(--panel) 42%, transparent);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--mak) 70%, transparent);
  text-decoration-thickness: 1px;
}

/* ---------------------------------------------------------- footer */

.foot {
  background: var(--nwa);
  padding-block: 3rem;
}

.foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem 2.5rem;
}

.foot-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  font-variation-settings: "wdth" 88;
  margin: 0;
  color: var(--panel);
}

.foot-note {
  margin: 0;
  font-size: 0.9375rem;
  color: color-mix(in srgb, var(--panel) 62%, transparent);
  flex: 1 1 20rem;
}

.foot-note a { color: var(--aksan-2); }

.foot-fine {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: color-mix(in srgb, var(--panel) 38%, transparent);
}

/* ---------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .tw, .turn { opacity: 1; transform: none; }
  .btn:hover { transform: none; }
}

/* ---------------------------------------------------------- teach hub
 *
 * A grid of doorways, one per discipline. Each tile carries its own theme's
 * accent and its own sample question, so a chef sees a cooking question
 * before deciding whether this place is for them. That is the whole reason
 * this is a grid and not a dropdown: a dropdown hides the answer to
 * "is this for me" behind a click.
 */

.doors {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  margin-top: 3rem;
}

/* Pinned to three columns above this width. auto-fit would give four, which
   with six tiles leaves two orphans on the second row. Two rows of three
   reads as a decision; four-then-two reads as leftovers. */
@media (min-width: 62rem) {
  .doors { grid-template-columns: repeat(3, 1fr); }
}

.door {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 1.75rem;
  border-radius: 3px;
  text-decoration: none;
  color: var(--panel);
  background: var(--ground-deep);
  border-top: 4px solid var(--aksan);
  overflow: hidden;
  transition: transform 0.18s ease;
}

.door:hover { transform: translateY(-3px); }

.door-photo {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  opacity: 0.28;
}

.door > * { position: relative; }

.door-name {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  font-variation-settings: "wdth" 86;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  color: var(--aksan);
}

.door-tagline {
  font-size: 0.875rem;
  margin: 0 0 1.25rem;
  color: color-mix(in srgb, var(--panel) 66%, transparent);
}

.door-q {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0 0 auto;
  color: color-mix(in srgb, var(--panel) 92%, transparent);
}

.door-go {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--aksan-2);
}

/* ---------------------------------------------------------- hero photo */

.hero-photo-wrap {
  position: relative;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.hero-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.hero-photo-credit {
  position: absolute;
  right: 0.6rem;
  bottom: 0.5rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  color: color-mix(in srgb, var(--panel) 72%, transparent);
  background: color-mix(in srgb, var(--nwa) 55%, transparent);
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}

.hub-title {
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4rem);
  font-weight: 800;
  font-variation-settings: "wdth" 84;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
  max-width: 18ch;
}

.fine-light {
  margin-top: 2rem;
  color: color-mix(in srgb, var(--panel) 52%, transparent);
}

/* ---------------------------------------------------------- doors, on light
 *
 * On a light page the tiles become the colour moments rather than one more
 * shade of the background. Each carries its own theme, so the grid reads as
 * five different places rather than five copies.
 */

.doors {
  margin-top: 2.5rem;
}

.door {
  background: var(--ground);
  border-top: none;
  border-left: 5px solid var(--aksan);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--nwa) 8%, transparent);
}

.door:hover {
  box-shadow: 0 10px 28px color-mix(in srgb, var(--nwa) 18%, transparent);
}

.door-name { color: var(--panel); }
.door-tagline { color: color-mix(in srgb, var(--panel) 60%, transparent); }
.door-q { color: color-mix(in srgb, var(--panel) 88%, transparent); }
.door-go { color: var(--aksan); }

/* ---------------------------------------------------------- band rhythm
 *
 * Light is the default now. The dark band is punctuation: used twice on a
 * page, it lands. Used for the whole page, it was just weight.
 */

.band-light {
  background: var(--panel);
  color: var(--ink);
}

.band-tint {
  background: var(--panel-2);
  color: var(--ink);
}

.band-blue {
  background: var(--ground-deep);
  color: var(--panel);
}

.band-blue .band-lede,
.band-blue .fine {
  color: color-mix(in srgb, var(--panel) 76%, transparent);
}

.stage {
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-top: 3px solid var(--ground-lift);
}

.band-tint .stage { background: var(--panel); }

/* Kreyòl. The one theme that uses the flag directly, because this is the one
   subject that is the flag: indigo ground, flag red as the working accent
   rather than held in reserve. */
.theme-kreyol {
  --ground:      #132A6B;
  --ground-deep: #0C1D4E;
  --ground-lift: #274694;
  --aksan:       #E63946;
  --aksan-2:     #6FB3C9;
  --panel:       #FDF7F2;
  --panel-2:     #EFE3D9;
}
