/* hack55 site, minimal. Type sets the hierarchy; full-bleed bands separate the sections.
   Palette and faces come from the brand guide (project/tokens.json). */

:root {
  --bg: #FDF7EE;
  --paper: #FFFFFF;
  --tint: #F3E6D2;
  --ink: #141D26;
  --ink-2: #222E3B;
  --muted: #3B4652;
  --accent: #E62B37;
  --on-accent: #FDF7EE;
  --ink-muted: #B9B0A3;

  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-text: Inter, system-ui, sans-serif;

  --gutter: clamp(20px, 5vw, 64px);
  --column: 1040px;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, dl, dd, dt, p { margin: 0; }

a { color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 2px; }
a:hover { color: var(--ink); }
a:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* Every section is a full-width band; its content sits on one shared column. */
main > section,
.foot {
  padding-inline: max(var(--gutter), calc((100% - var(--column)) / 2));
}
/* Anchor jumps stop short of the floating dock (about 111px tall when it wraps at 375px). */
main > section[id] { scroll-margin-top: 120px; }

/* Lenis smooth scroll (open source) needs native scrolling reset to auto. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* Floating dock: the only navigation, fixed to the top. */

.dock {
  position: fixed;
  top: max(18px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px;
  max-width: calc(100vw - 2 * var(--gutter));
  background: var(--ink);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(20, 29, 38, 0.28); /* taste-skill-ignore: the dock floats over the page as an overlay */
  transition: transform 260ms ease, opacity 260ms ease;
}
.dock.is-hidden { transform: translate(-50%, calc(-100% - 40px)); opacity: 0; pointer-events: none; }
.dock-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  color: var(--accent);
  text-decoration: none;
  padding: 10px 14px 10px 16px;
  margin-right: 6px;
}
.dock-link {
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  padding: 10px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.dock-link:hover { background: var(--ink-2); color: var(--bg); }
.dock-link[aria-current="true"] { background: var(--ink-2); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.dock-cta {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 999px;
  margin-left: 6px;
  white-space: nowrap;
}
.dock-cta:hover { background: var(--accent); color: var(--on-accent); }
.dock a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Hero: the banner leads, and its base fades into the band below. */

.hero {
  padding-top: 112px;
  padding-bottom: 96px;
  background: linear-gradient(to bottom, var(--bg) 62%, var(--tint) 100%); /* taste-skill-ignore: the fade into the intro was requested */
}
.hero-flip {
  font-family: var(--font-display);
  font-weight: 600; /* static part: lighter than the flipping word (800) */
  font-size: clamp(30px, 8.4vw, 90px); /* the longest line ("build something" + longest word) must fit one line from 721px up, see the 721px rule */
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: -0.15em 0 40px;
  padding-block: 0.15em; /* room for the blur halo inside the clipping box */
  overflow: hidden;
}
@media (min-width: 721px) {
  .hero-flip { font-size: clamp(30px, 7.5vw, 90px); } /* about 7.5vw keeps the longest line inside the column, so it stays on one line */
}
/* --flip-ms is set by the script to fit the current gap; --blur-ms sets the blur's own duration (120ms on the final snap) */
.flip-word {
  display: inline-grid; /* every word sits in grid cell 1 / 1, so the cell is as wide as the longest word */
  white-space: nowrap;
  color: var(--accent);
  font-weight: 800;
  transition: opacity var(--flip-ms, 220ms) ease, transform var(--flip-ms, 220ms) ease, filter var(--blur-ms, var(--flip-ms, 220ms)) ease;
}
.flip-item { grid-area: 1 / 1; opacity: 0; }
.flip-item.is-active { opacity: 1; }
.hero-br { display: none; }
.flip-word.is-out { opacity: 0; transform: translateY(-0.4em); }
.flip-word.is-below { opacity: 0; transform: translateY(0.4em); transition: filter var(--blur-ms, var(--flip-ms, 220ms)) ease; }
.hero-art { margin: 0 0 56px; }
.hero-art img { width: 100%; height: auto; }

.lede {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.2;
  max-width: 34ch;
}
.meta { margin-top: 20px; color: var(--muted); font-size: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; margin-top: 40px; }

.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.1;
  padding: 16px 24px;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-quiet { background: transparent; color: var(--ink); padding-inline: 0; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.btn-quiet:hover { background: transparent; color: var(--accent); }

/* Intro: the statement, then a quieter note. Fades in from the hero. */

.intro {
  padding-block: 80px 112px;
  background: linear-gradient(to bottom, var(--tint) 0%, var(--bg) 70%); /* taste-skill-ignore: the fade into the intro was requested */
}
.intro-lead {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 3.2vw, 40px);
  line-height: 1.15;
  max-width: 22ch;
  color: var(--ink);
}
.intro-note { margin-top: 24px; color: var(--muted); max-width: 60ch; }

/* How it works: numbered steps, then what to submit. */

.how { padding-block: 40px 112px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 18px; color: var(--muted); }
.steps li::before { content: counter(step); display: block; font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; color: var(--accent); margin-bottom: 12px; }
.steps strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.2; color: var(--ink); margin-bottom: 6px; }
.steps strong a { color: var(--ink); }
.steps strong a:hover { color: var(--accent); }
.steps-label { margin-top: 64px; font-weight: 700; color: var(--ink); }
.submit-list { margin: 12px 0 0; padding-left: 1.2em; color: var(--muted); max-width: 62ch; }
.submit-list li { padding-block: 4px; }

/* Section bands: each one a different ground, so the page reads in chapters. */

.band-paper { background: var(--paper); }
.band-cream { background: var(--bg); }

.block { padding-block: 112px; }
h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 40px;
}

.rows > div {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 32px;
  padding-block: 20px;
}
.rows dt { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.2; color: var(--ink); }
.rows dd { color: var(--muted); align-self: center; }

.faq > div { padding-block: 26px; }
.faq dt { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1.15; color: var(--ink); margin-bottom: 8px; }
.faq dd { color: var(--muted); max-width: 60ch; }
.faq dd a { color: var(--ink); }

.small { margin-top: 36px; color: var(--muted); font-size: 16px; }
.small a { color: var(--ink); }

/* Schedule: grouped by day. */

.days { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 64px; }
.day-name { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.1; margin-bottom: 14px; }
.day-items { list-style: none; padding: 0; margin: 0; }
.day-items li { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding-block: 12px; border-top: 0; }
.time { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.what { color: var(--muted); }

/* Prizes: two tiers. */

.lead { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.2; margin: -16px 0 48px; }
.tiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; }
.tier-name { font-weight: 700; color: var(--muted); margin-bottom: 16px; }
.award-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 28px; }
.award-list li { display: grid; gap: 6px; }
.award-list strong { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.1; color: var(--ink); }
.award-list span { color: var(--muted); }

/* Chapters alternate: dark (band-ink) and light (band-light), so no two neighbours match.
   Both share one vertical padding. Each band sets the ink of its section kicker. */

.band-ink { background: var(--ink); color: var(--bg); padding-block: 120px; --kicker-rule: #3A4550; --kicker-ink: var(--ink-muted); }
.band-light { background: var(--tint); color: var(--ink); padding-block: 120px; --kicker-rule: var(--ink); --kicker-ink: var(--muted); }

/* Section kicker: a 1px rule, then a small lowercase label with the section number. Not a heading. */

.kicker {
  margin: 0 0 40px;
  padding-top: 14px;
  border-top: 1px solid var(--kicker-rule);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--kicker-ink);
  font-variant-numeric: tabular-nums;
}
.centre .kicker { text-align: center; }
.band-ink h2 { color: var(--bg); margin-bottom: 48px; }
.band-ink .note-ink { color: var(--ink-muted); font-size: 16px; margin-top: 28px; }
.band-ink a { color: var(--bg); }
.band-ink a:hover { color: var(--accent); }

/* Schedule: a hairline table. Real tables may carry lines. */

table.sched { width: 100%; border-collapse: collapse; font-size: 18px; }
table.sched th { text-align: left; font-weight: 400; font-size: 15px; color: var(--ink-muted); padding: 0 0 14px; }
table.sched td { padding: 22px 16px 22px 0; border-top: 1px solid #3A4550; vertical-align: top; } /* taste-skill-ignore: a real table */
table.sched td:first-child { font-weight: 700; white-space: nowrap; width: 300px; }
table.sched td:nth-child(2) { width: 300px; }
table.sched td:nth-child(3) { color: var(--ink-muted); }
table.sched tbody tr:last-child td { border-bottom: 1px solid #3A4550; } /* taste-skill-ignore: a real table */

/* Prizes: centred, two tiers, hairline tops. */

.centre { text-align: center; }
.centre h2 { margin-inline: auto; }
.sub { font-size: 18px; color: var(--ink-muted); max-width: 52ch; margin: -24px auto 56px; }
.tier-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 64px; max-width: 900px; margin-inline: auto; text-align: left; }
.tier { border-top: 1px solid #3A4550; padding-top: 18px; margin-bottom: 40px; } /* taste-skill-ignore: the reference layout uses hairline tops on each tier */
.tier-label { font-size: 15px; color: var(--ink-muted); margin-bottom: 18px; }
.tier-item { margin-bottom: 20px; color: var(--bg); font-size: 18px; }
.tier-item strong { display: block; font-weight: 600; font-size: 22px; line-height: 1.2; margin-bottom: 4px; }

/* Judging: rubric table with weight bars, then judge cards (one .judge block per judge). */
.band-ink .sub { color: var(--ink-muted); margin-bottom: 40px; }
table.rubric { width: 100%; border-collapse: collapse; font-size: 18px; }
table.rubric thead th { text-align: left; font-weight: 400; font-size: 15px; color: var(--ink-muted); padding: 0 16px 14px 0; }
table.rubric tbody th, table.rubric td { text-align: left; padding: 22px 16px 22px 0; border-top: 1px solid #3A4550; vertical-align: top; } /* taste-skill-ignore: a real table */
table.rubric tbody th { font-weight: 700; width: 240px; }
table.rubric td:nth-child(2) { width: 180px; }
table.rubric td:nth-child(3) { color: var(--ink-muted); }
table.rubric tbody tr:last-child > * { border-bottom: 1px solid #3A4550; } /* taste-skill-ignore: a real table */
.weight { display: block; font-weight: 700; margin-bottom: 8px; }
.bar { display: block; height: 6px; width: 100%; max-width: 140px; background: #3A4550; border-radius: 3px; position: relative; }
.bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--w) * 3.3); max-width: 100%; background: var(--accent); border-radius: 3px; }
.judges-h { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.2; color: var(--bg); margin: 72px 0 28px; }
.judge-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.judge-photo { aspect-ratio: 1; width: 100%; max-width: 160px; border-radius: 50%; background: var(--ink-2); border: 1px solid #3A4550; }
.judge-name { margin-top: 14px; font-weight: 600; font-size: 18px; }
.judge-title { color: var(--ink-muted); font-size: 15px; }

/* Questions: heading on the left, accordion on the right. */

.split-q { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 64px; align-items: start; }
.split-q h2 { margin-bottom: 12px; }
.acc details { border-top: 1px solid #3A4550; } /* taste-skill-ignore: the reference accordion uses hairline rows */
.acc details:last-child { border-bottom: 1px solid #3A4550; } /* taste-skill-ignore: the reference accordion uses hairline rows */
.acc summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0; font-size: 19px; color: var(--bg); }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-size: 26px; line-height: 1; color: var(--ink-muted); transition: transform 200ms ease; }
.acc details[open] summary::after { content: "–"; }
.acc details p { padding: 0 0 24px; color: var(--ink-muted); max-width: 60ch; }
.acc details a { color: var(--bg); }
.rules-note { max-width: 1040px; margin: 40px auto 0; }

/* Light chapters: ink text, muted secondary text, hairlines in --muted (the dark bands keep their #3A4550 rules). */

.band-light h2 { color: var(--ink); margin-bottom: 48px; }
.band-light .sub { color: var(--muted); margin-bottom: 40px; }
.band-light .note-ink { color: var(--muted); font-size: 16px; margin-top: 28px; }
.band-light a { color: var(--ink); }
.band-light a:hover { color: var(--accent); }
.band-light .tier { border-top-color: var(--muted); }
.band-light .tier-label, .band-light .rules-list, .band-light .safe-text { color: var(--muted); }
.band-light .tier-item { color: var(--ink); }
.band-light .rules-list strong { color: var(--ink); }
.band-light .judges-h { color: var(--ink); }
.band-light .qa-item { border-color: var(--muted); }
.band-light .qa-btn { color: var(--ink); }
.band-light .qa-plus::before, .band-light .qa-plus::after { background: var(--muted); }
.band-light .qa-a p { color: var(--muted); }

/* Questions: animated accordion. Height animates with grid rows, so no fixed heights. */

.qa-item { border-top: 1px solid #3A4550; } /* taste-skill-ignore: the reference accordion uses hairline rows */
.qa-item:last-child { border-bottom: 1px solid #3A4550; } /* taste-skill-ignore: the reference accordion uses hairline rows */
.qa-q { margin: 0; font-size: inherit; font-weight: 400; }
.qa-btn {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
  font-family: var(--font-text);
  font-size: 19px;
  color: var(--bg);
}
.qa-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.qa-plus { position: relative; width: 16px; height: 16px; flex-shrink: 0; }
.qa-plus::before, .qa-plus::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--ink-muted); transition: transform 320ms ease; }
.qa-plus::after { transform: rotate(90deg); }
.qa-item.is-open .qa-plus::after { transform: rotate(0deg); }
.qa-item.is-open .qa-plus::before { transform: rotate(180deg); }
.qa-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 380ms cubic-bezier(.2,.7,.2,1), opacity 380ms ease, visibility 380ms; opacity: 0; visibility: hidden; }
.qa-a > div { overflow: hidden; min-height: 0; }
.qa-item.is-open .qa-a { grid-template-rows: 1fr; opacity: 1; visibility: visible; }
.qa-a p { padding: 0 0 24px; color: var(--ink-muted); max-width: 60ch; }
.no-js .qa-a { grid-template-rows: 1fr; opacity: 1; visibility: visible; }

/* Reveal: blocks rise into place as they enter the screen. */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 760ms cubic-bezier(.2,.7,.2,1), transform 760ms cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--delay, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* Close: the red field. */

.close { background: var(--accent); color: var(--on-accent); }
.close h2 { color: var(--on-accent); }
.close .btn { background: var(--ink); color: var(--bg); }
.close .btn:hover { background: var(--bg); color: var(--ink); }
.close .btn-quiet { background: transparent; color: var(--on-accent); }
.close .btn-quiet:hover { color: var(--bg); background: transparent; }

/* Close: the full-width ink band. */

.close { padding-block: 128px 136px; }
.close .actions { margin-top: 0; }

/* Rules and winners. One .winner block per prize; later add .winner-team (first names), a description p and a devpost link inside it. */
#judging .sub, #rules .sub, #winners .sub { margin-inline: 0; }
.rules-list { margin: 0; padding-left: 1.6em; max-width: 72ch; color: var(--ink-muted); }
.rules-list li { padding-block: 10px; padding-left: 6px; }
.rules-list strong { color: var(--bg); font-weight: 700; }
.safe-text { max-width: 72ch; color: var(--ink-muted); }
.winner-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 64px; }
.winner { border-top: 1px solid #3A4550; padding: 22px 0 36px; } /* taste-skill-ignore: hairline tops match the tier cards */
.winner-prize { font-size: 15px; color: var(--ink-muted); margin-bottom: 10px; }
.winner-name { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.2; color: var(--bg); }
.winner-team, .winner-desc { color: var(--ink-muted); margin-top: 8px; }

/* Footer */

.foot { padding-block: 48px 56px; }
.foot p { color: var(--muted); font-size: 15px; }

@media (max-width: 720px) {
  body { font-size: 17px; }
  main > section, .foot { padding-inline: var(--gutter); }
  .hero-br { display: inline; } /* narrow: the flipping word always starts line two */
  .hero { padding-top: 136px; } /* the dock wraps to two rows here and ends near 111px, so the headline starts below it */
  .dock { gap: 0; padding: 6px; flex-wrap: wrap; justify-content: center; border-radius: 28px; width: max-content; } /* seven items do not fit one row at 375px, so they wrap to two */
  .dock-mark { display: none; }
  .dock-link { font-size: 14px; padding: 9px 10px; }
  .dock-cta { font-size: 14px; padding: 9px 14px; margin-left: 4px; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .how { padding-block: 24px 84px; }
  .rows > div { grid-template-columns: 1fr; gap: 4px; }
  .winner-grid { grid-template-columns: 1fr; }
  .tier-grid, .split-q { grid-template-columns: 1fr; gap: 40px; }
  table.sched td:first-child, table.sched td:nth-child(2) { width: auto; }
  table.sched td:first-child { white-space: normal; }
  /* narrow: each row stacks, with the note under its "what" cell. Roles on the table restore semantics lost by display changes. */
  table.sched, table.sched tbody, table.sched thead { display: block; }
  table.sched tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; }
  table.sched td, table.sched th { display: block; }
  table.sched tbody tr:last-child td { border-bottom: 0; }
  table.sched tbody tr:last-child td:nth-child(3) { border-bottom: 1px solid #3A4550; }
  table.sched td:nth-child(3) { grid-column: 2; padding-top: 0; border-top: 0; font-size: 16px; }
  table.sched td:nth-child(1), table.sched td:nth-child(2) { padding-bottom: 6px; }
  table.sched th:nth-child(3) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  table.rubric, table.rubric tbody, table.rubric thead { display: block; }
  table.rubric thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.rubric tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; border-top: 1px solid #3A4550; padding: 20px 0; }
  table.rubric tbody th, table.rubric td { display: block; width: auto; border: 0 !important; padding: 0; }
  table.rubric td:nth-child(2) { width: auto; text-align: right; }
  table.rubric td:nth-child(3) { grid-column: 1 / -1; margin-top: 8px; font-size: 16px; }
  .bar { margin-left: auto; width: 100px; }
  .judge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  .band-ink, .band-light { padding-block: 88px; }
  .day-items li { grid-template-columns: 120px minmax(0, 1fr); }
  .block { padding-block: 84px; }
  .close { padding-block: 96px 104px; }
  h2 { font-size: 40px; margin-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
