/* ==========================================================================
   FounderPanda — stylesheet
   Design system built from the vocabulary of a word game:
   letter tiles and their three feedback states.
   ========================================================================== */

:root {
  /* Palette */
  --canvas:       #E7EBE4;   /* pale sage paper */
  --canvas-deep:  #DCE2D8;   /* recessed panels */
  --ink:          #16211C;   /* deep forest ink */
  --ink-soft:     #4A5952;   /* secondary text */
  --tile-correct: #2E7D5B;   /* right letter, right place */
  --tile-present: #E2A32B;   /* right letter, wrong place */
  --tile-absent:  #AFB8AC;   /* not in the word */
  --cobalt:       #2F55EA;   /* interactive */
  --cobalt-deep:  #1F3BB0;
  --bone:         #F7F8F5;

  /* Type */
  --display: "Bricolage Grotesque", "Archivo", system-ui, sans-serif;
  --body:    "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  /* Rhythm */
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --maxw: 1180px;
  --tile: clamp(2.6rem, 6.2vw, 4.1rem);
}

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

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }

a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--cobalt-deep); }

:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------- Type ---- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 1.7rem + 4vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3.05rem); }
h3 { font-size: clamp(1.2rem, 1.08rem + 0.6vw, 1.45rem); letter-spacing: -0.015em; }
h4 { font-size: 1.0625rem; letter-spacing: -0.01em; }

p { margin: 0 0 1.1em; max-width: 68ch; }

.lede {
  font-size: clamp(1.1rem, 1rem + 0.65vw, 1.42rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 44ch;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.4rem;
}

.eyebrow::before {
  content: "";
  width: 0.72rem;
  height: 0.72rem;
  background: var(--tile-correct);
  border-radius: 2px;
  flex: none;
}

.eyebrow--amber::before { background: var(--tile-present); }
.eyebrow--cobalt::before { background: var(--cobalt); }

/* ------------------------------------------------------------- Layout ---- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section--tight { padding-block: clamp(2.75rem, 6vw, 4.5rem); }
.section--sunken { background: var(--canvas-deep); }
.section--ink { background: var(--ink); color: var(--bone); }
.section--ink h2, .section--ink h3 { color: var(--bone); }
.section--ink .lede, .section--ink .eyebrow { color: #A8B5AD; }

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

@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split--sticky > :first-child { position: sticky; top: 6.5rem; }
}

/* ---------------------------------------------------- Tile primitives ---- */

.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tile);
  height: var(--tile);
  border-radius: 7px;
  font-family: var(--display);
  font-weight: 800;
  font-size: calc(var(--tile) * 0.5);
  line-height: 1;
  letter-spacing: 0;
  color: var(--bone);
  background: var(--tile-absent);
  user-select: none;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.14);
}

.tile--correct { background: var(--tile-correct); }
.tile--present { background: var(--tile-present); color: #2A1F05; }
.tile--absent  { background: var(--tile-absent); color: #38423A; }
.tile--blank   { background: transparent; box-shadow: inset 0 0 0 2px rgba(22,33,28,0.16); }

.tilerow {
  display: flex;
  gap: clamp(0.3rem, 1vw, 0.5rem);
  flex-wrap: wrap;
}

/* Divider made of tiles instead of a rule */
.tiledivider {
  display: flex;
  gap: 6px;
  padding-block: clamp(1.5rem, 4vw, 2.5rem);
}
.tiledivider span {
  width: 14px; height: 14px; border-radius: 3px;
  background: var(--tile-absent);
}
.tiledivider span:nth-child(3n+1) { background: var(--tile-correct); }
.tiledivider span:nth-child(4n+2) { background: var(--tile-present); }

/* ---------------------------------------------------------- Nav / Foot --- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(22, 33, 28, 0.09);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  display: inline-flex;
  gap: 3px;
}
.brand__mark i {
  width: 11px; height: 20px; border-radius: 3px; display: block;
}
.brand__mark i:nth-child(1) { background: var(--ink); }
.brand__mark i:nth-child(2) { background: var(--tile-correct); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.4vw, 2rem);
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-block: 0.35rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--tile-present); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--tile-correct); }

.foot {
  background: var(--ink);
  color: #9FAEA5;
  padding-block: clamp(3rem, 7vw, 5rem) 2rem;
  font-size: 0.94rem;
}
.foot h4 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6E7F75;
  margin-bottom: 1rem;
}
.foot a { color: var(--bone); text-decoration: none; }
.foot a:hover { color: var(--tile-present); text-decoration: underline; }
.foot__grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .foot__grid { grid-template-columns: 2fr 1fr 1fr; }
}
.foot__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.foot__base {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  color: #6E7F75;
}
.foot p { color: #9FAEA5; }

/* --------------------------------------------------------------- Hero --- */

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

.hero__tiles {
  display: grid;
  gap: clamp(0.3rem, 1vw, 0.5rem);
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.hero__tiles .tilerow { gap: clamp(0.3rem, 1vw, 0.5rem); }

.hero__tiles .tile {
  opacity: 0;
  transform: rotateX(-92deg);
  animation: flip-in 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes flip-in {
  from { opacity: 0; transform: rotateX(-92deg); }
  60%  { opacity: 1; transform: rotateX(12deg); }
  to   { opacity: 1; transform: rotateX(0); }
}

.hero__claim {
  margin: 0 0 1rem;
  max-width: 20ch;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  margin-top: clamp(2rem, 5vw, 3rem);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.hero__meta span { display: inline-flex; align-items: center; gap: 0.5rem; }
.hero__meta span::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--tile-correct);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__tiles .tile { opacity: 1; transform: none; animation: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* -------------------------------------------------------------- Cards --- */

.cards {
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.6rem);
  grid-template-columns: 1fr;
}
@media (min-width: 700px) { .cards--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 700px) { .cards--2 { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--bone);
  border-radius: 14px;
  padding: clamp(1.5rem, 3vw, 2.1rem);
  border: 1px solid rgba(22, 33, 28, 0.08);
}
.card h3 { margin-bottom: 0.5rem; }
.card p { margin-bottom: 0; color: var(--ink-soft); }
.card__key {
  display: inline-flex;
  margin-bottom: 1.15rem;
}
.card__key .tile { --tile: 2.15rem; font-size: 1rem; border-radius: 5px; }

.section--ink .card {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.1);
}
.section--ink .card p { color: #A8B5AD; }

/* ------------------------------------------------------------ Project --- */

.project {
  background: var(--bone);
  border-radius: 18px;
  border: 1px solid rgba(22, 33, 28, 0.08);
  padding: clamp(1.6rem, 4vw, 3.2rem);
}

.project__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.8rem 1.4rem;
  margin-bottom: 1.2rem;
}

.badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: var(--tile-correct);
  color: var(--bone);
  white-space: nowrap;
}
.badge--amber { background: var(--tile-present); color: #2A1F05; }
.badge--quiet { background: transparent; color: var(--ink-soft); box-shadow: inset 0 0 0 1px rgba(22,33,28,0.2); }

.modes {
  list-style: none;
  margin: 1.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) { .modes { grid-template-columns: repeat(2, 1fr); } }

.modes li {
  padding-left: 1.6rem;
  position: relative;
  color: var(--ink-soft);
}
.modes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  background: var(--tile-present);
}
.modes li strong { color: var(--ink); font-weight: 600; }

.specs {
  margin: 2rem 0 0;
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(22, 33, 28, 0.1);
}
.specs div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  justify-content: space-between;
  padding-block: 0.85rem;
  border-bottom: 1px solid rgba(22, 33, 28, 0.1);
}
.specs dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}
.specs dd { margin: 0; font-weight: 500; }

/* ------------------------------------------------------------ Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 0.85rem 1.4rem;
  border-radius: 8px;
  background: var(--cobalt);
  color: var(--bone);
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: var(--cobalt-deep); color: var(--bone); transform: translateY(-2px); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px rgba(22, 33, 28, 0.22);
}
.btn--ghost:hover { background: rgba(22, 33, 28, 0.05); color: var(--ink); }

.section--ink .btn--ghost { color: var(--bone); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.28); }
.section--ink .btn--ghost:hover { background: rgba(255,255,255,0.08); color: var(--bone); }

.btnrow { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.8rem; }

/* --------------------------------------------------------------- Prose -- */

.prose h2 { margin-top: 2.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 2rem; }
.prose ul { padding-left: 1.15rem; max-width: 68ch; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--tile-correct); }

.callout {
  background: var(--bone);
  border-left: 4px solid var(--tile-present);
  border-radius: 0 10px 10px 0;
  padding: 1.2rem 1.4rem;
  margin: 2rem 0;
}
.callout p:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------- Timeline --- */

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li {
  display: grid;
  gap: 0.3rem 1.6rem;
  grid-template-columns: 1fr;
  padding-block: 1.3rem;
  border-bottom: 1px solid rgba(22, 33, 28, 0.11);
}
@media (min-width: 620px) {
  .timeline li { grid-template-columns: 8rem 1fr; }
}
.timeline dt, .timeline .when {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 0.25rem;
}
.timeline p { margin: 0.25rem 0 0; color: var(--ink-soft); }
.timeline strong { font-family: var(--display); font-weight: 700; font-size: 1.08rem; }

/* --------------------------------------------------------------- FAQ ---- */

.faq { display: grid; gap: 0; margin-top: 2rem; }
.faq details {
  border-bottom: 1px solid rgba(22, 33, 28, 0.12);
  padding-block: 1.1rem;
}
.faq summary {
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 14px; height: 14px;
  border-radius: 3px;
  background: var(--tile-absent);
  transition: background 0.2s ease;
}
.faq details[open] summary::after { background: var(--tile-correct); }
.faq details p { margin: 0.9rem 0 0; color: var(--ink-soft); }

/* --------------------------------------------------------- Mail block --- */

.mailcard {
  background: var(--ink);
  color: var(--bone);
  border-radius: 16px;
  padding: clamp(1.8rem, 4vw, 2.8rem);
}
.mailcard a {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.15rem, 0.9rem + 1.4vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--tile-present);
  text-decoration: none;
  word-break: break-word;
}
.mailcard a:hover { text-decoration: underline; }
.mailcard p { color: #A8B5AD; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: 0.6rem;
  z-index: 100;
  background: var(--ink);
  color: var(--bone);
  padding: 0.7rem 1rem;
  border-radius: 6px;
  text-decoration: none;
}
