/* Çakistes — chakistes.com */
:root {
  color-scheme: light;
  /* layout: bowl on the left colours in as each step on the right is finished */
  --paper: #F3F4EC;
  --paper-2: #E7EBDB;
  --white: #FFFEF8;
  --ink: #20261A;
  --ink-2: #4B5541;
  --olive: #7C8B2E;
  --olive-deep: #36421A;
  --lemon: #F2C230;
  --lemon-soft: #FBEAAE;
  --brine: #DCE7D6;
  --coriander: #A8743F;
  --r-l: 28px;
  --r-m: 18px;
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  font-variation-settings: "opsz" 14;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--lemon); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  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: 12px; top: -80px; z-index: 60;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px;
}
.skip-link:focus { top: 12px; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-left: clamp(18px, 4vw, 48px); padding-right: clamp(18px, 4vw, 48px); }

/* ---------- buttons ---------- */
.btn {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-weight: 700; font-size: 16px; line-height: 1;
  padding: 13px 20px; min-height: 46px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--white); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; cursor: pointer; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
  transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease;
  box-shadow: 0 3px 0 var(--ink);
}
.btn:hover { background: #fff; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn-primary { background: var(--olive-deep); color: var(--paper); }
.btn-primary:hover { background: #2a3414; }
.btn-lemon { background: var(--lemon); }
.btn-lemon:hover { background: #f6cf55; }
.btn-ghost { box-shadow: none; background: transparent; }
.btn-sm { min-height: 40px; padding: 9px 14px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 0 3px 0 var(--ink); }
.btn.hold { touch-action: none; }
.btn.is-held { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); background: var(--lemon); }
.linkbtn {
  appearance: none; background: none; border: 0; padding: 6px 2px; margin-left: auto;
  font: inherit; font-size: 15px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.linkbtn:hover { color: var(--ink); }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 6px; }
.top nav { display: flex; flex-wrap: wrap; gap: 6px clamp(14px, 2.4vw, 30px); font-weight: 600; font-size: 16px; }
.top nav a { text-decoration: none; padding: 4px 0; }
.top nav a:hover { text-decoration: underline; }
.sound .mute { display: none; }
.sound[aria-pressed="false"] .wave { display: none; }
.sound[aria-pressed="false"] .mute { display: inline; }
@media (max-width: 560px) {
  .sound-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sound { padding: 9px 11px; }
  .top nav { font-size: 15px; gap: 4px 14px; }
}

/* ---------- hero ---------- */
.hero { padding-top: clamp(10px, 3vw, 34px); padding-bottom: clamp(20px, 3.4vw, 40px); }
.wordmark {
  margin: 0;
  font-weight: 800;
  font-variation-settings: "opsz" 96, "wdth" 75;
  font-size: clamp(74px, 15.5vw, 214px);
  line-height: .86;
  letter-spacing: -.028em;
}
.wm { position: relative; display: inline-block; padding-bottom: .08em; }
.wm-a, .wm-b { display: block; }
.wm-a { clip-path: polygon(0 0, 100% 0, 100% 49%, 91% 55%, 82% 46%, 72% 58%, 63% 48%, 54% 60%, 44% 50%, 35% 57%, 26% 47%, 17% 58%, 8% 50%, 0 56%); }
.wm-b {
  position: absolute; inset: 0;
  clip-path: polygon(0 56%, 8% 50%, 17% 58%, 26% 47%, 35% 57%, 44% 50%, 54% 60%, 63% 48%, 72% 58%, 82% 46%, 91% 55%, 100% 49%, 100% 100%, 0 100%);
  transition: transform .6s cubic-bezier(.3, 1.8, .5, 1);
  transform-origin: 10% 50%;
}
.wordmark.is-cracked .wm-b { transform: translate(.004em, .03em) rotate(.35deg); }
.lede { max-width: 46ch; margin: 18px 0 0; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; }

/* ---------- workshop ---------- */
.workshop { padding-bottom: clamp(48px, 7vw, 96px); scroll-margin-top: 12px; }
.bench {
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
  grid-template-areas:
    "rail rail"
    "bowl head"
    "text text"
    "scene scene"
    "ctrl ctrl"
    "after after"
    "final final";
  gap: 14px 18px;
  align-items: start;
}
.timeline { grid-area: rail; padding: 4px 0 6px; }
.bowl-wrap { grid-area: bowl; margin: 0; }
.step-head { grid-area: head; align-self: center; }
.step-text { grid-area: text; margin: 0; max-width: 54ch; }
.scene { grid-area: scene; }
.ctrl { grid-area: ctrl; }
.after { grid-area: after; }
.final { grid-area: final; }

@media (min-width: 900px) {
  .bench {
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
    grid-template-areas:
      "bowl rail"
      "bowl head"
      "bowl text"
      "bowl scene"
      "bowl ctrl"
      "bowl after"
      "bowl final"
      "bowl .";
    grid-template-rows: auto auto auto auto auto auto auto 1fr;
    column-gap: clamp(32px, 4.6vw, 72px);
    row-gap: 14px;
  }
  .bowl-wrap { position: sticky; top: 18px; }
  .step-head { align-self: end; margin-top: 10px; }
}

/* timeline rail */
.rail { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.node::before {
  content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px;
  background: var(--ink); z-index: 0;
}
.node:first-child::before { display: none; }
.node.is-done::before, .node.is-current::before { height: 4px; top: 14px; background: var(--olive); }
.dot {
  position: relative; z-index: 1;
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--white);
  display: grid; place-items: center;
  font-size: 14px; font-weight: 800; color: var(--ink);
  transition: background-color .3s ease, transform .3s ease;
}
.node.is-current .dot { background: var(--lemon); transform: scale(1.14); }
.node.is-done .dot { background: var(--olive); color: var(--white); }
.node.is-done .num { display: none; }
.node.is-done .dot::after {
  content: ""; width: 10px; height: 6px; margin-top: -3px;
  border-left: 3px solid var(--white); border-bottom: 3px solid var(--white);
  transform: rotate(-45deg);
}
.node.is-current .lbl { color: var(--ink); }
.lbl { white-space: nowrap; }
.phases {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-top: 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.25;
}
.phases span {
  grid-column: var(--a) / var(--b); grid-row: 1;
  position: relative; margin: 0 5px; padding-top: 7px; text-align: center;
  border-top: 2px solid var(--ink-2);
}
.phases span::before, .phases span::after { content: ""; position: absolute; top: -7px; width: 2px; height: 8px; background: var(--ink-2); }
.phases span::before { left: 0; }
.phases span::after { right: 0; }
@media (max-width: 640px) {
  .lbl, .phases { display: none; }
  .dot { width: 28px; height: 28px; font-size: 13px; }
  .node::before { top: 13px; }
  .node.is-done::before, .node.is-current::before { top: 12px; }
}

/* bowl */
.bowl { position: relative; width: 100%; aspect-ratio: 1 / 1; }
.bowl::before {
  content: ""; position: absolute; left: 5.4%; top: 5.4%; width: 89.2%; height: 89.2%;
  border-radius: 50%; background: var(--white);
  box-shadow: 0 26px 44px -26px rgba(32, 38, 26, .5), 0 2px 0 rgba(32, 38, 26, .06);
}
.bowl img { position: absolute; inset: 0; width: 100%; height: 100%; }
.bowl .layer {
  opacity: 0;
  clip-path: circle(0% at var(--o, 50% 50%));
  transition: clip-path 1.5s cubic-bezier(.2, .75, .2, 1), opacity .5s ease, filter 1.8s ease;
}
.bowl .layer.on { opacity: 1; clip-path: circle(76% at var(--o, 50% 50%)); }
.bowl .layer[data-layer="olive"] { filter: saturate(1.3) hue-rotate(14deg) brightness(1.04); }
.bowl.is-cured .layer[data-layer="olive"] { filter: none; }
.bowl .lines { pointer-events: none; }
.bowl .sheen {
  position: absolute; left: 5.4%; top: 5.4%; width: 89.2%; height: 89.2%;
  border-radius: 50%; overflow: hidden; pointer-events: none;
}
.bowl .sheen::before {
  content: ""; position: absolute; inset: -30%;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .55) 50%, transparent 62%);
  transform: translateX(-75%);
}
.bowl.is-done .sheen::before { animation: sheen 1.7s .5s ease-out both; }
@keyframes sheen { to { transform: translateX(75%); } }
.bowl .fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fall {
  position: absolute; top: -3%; width: 14px; height: 9px; border-radius: 50%;
  background: #B98245; border: 2px solid var(--ink);
  animation: fall var(--d, 1.8s) var(--delay, 0s) cubic-bezier(.3, .05, .6, 1) both;
}
@keyframes fall {
  from { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  85% { opacity: 1; }
  to { transform: translate(var(--dx, 0px), var(--dy, 400px)) rotate(var(--rot, 360deg)); opacity: 0; }
}

/* step */
.step-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.pill { display: inline-block; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--brine); color: var(--ink); }
.step-title {
  margin: 0; font-size: clamp(26px, 2.7vw, 36px); line-height: 1.06; font-weight: 800;
  font-variation-settings: "opsz" 48, "wdth" 82; letter-spacing: -.01em;
}
.step-title:focus { outline: none; }
.scene {
  position: relative;
  border: 2px solid var(--ink); border-radius: var(--r-l);
  background: var(--paper-2); overflow: hidden;
  touch-action: manipulation;
}
.scene svg { display: block; width: 100%; height: auto; }
.scene.no-pan svg { touch-action: none; }
.scene .hit { cursor: pointer; }
.scene .hit:focus { outline: none; }
.scene .ring { opacity: 0; transition: opacity .15s; }
.scene .hit:focus-visible .ring { opacity: 1; }
.scene .is-done { cursor: default; }
.scene.is-complete .hit, .scene.is-complete svg { cursor: default; }
.scene .hint { animation: hint 1.6s ease-in-out infinite; }
@keyframes hint { 0%, 100% { opacity: .25; } 50% { opacity: .9; } }

.ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.ctrl-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.ctrl-buttons:empty { display: none; }
.status { margin: 0; font-weight: 700; font-size: 16px; min-height: 1.5em; }
.after {
  border: 2px solid var(--ink); border-radius: var(--r-m);
  background: var(--lemon-soft); padding: 16px 18px;
  display: grid; gap: 14px;
  animation: pop .35s cubic-bezier(.3, 1.5, .5, 1) both;
}
.after p { margin: 0; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

.bench.is-final .step-head,
.bench.is-final .step-text,
.bench.is-final .scene,
.bench.is-final .ctrl,
.bench.is-final .after { display: none; }
.final { display: grid; gap: 12px; align-content: start; }
.final[hidden] { display: none; }
.final p { margin: 0; max-width: 46ch; }
.final-title {
  margin: 0; font-size: clamp(40px, 5vw, 64px); line-height: 1; font-weight: 800;
  font-variation-settings: "opsz" 72, "wdth" 78; letter-spacing: -.02em;
}
.final-title:focus { outline: none; }
.final-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
@media (max-width: 899px) {
  .bench.is-final { grid-template-areas: "rail rail" "bowl bowl" "final final"; }
  .bench.is-final .bowl-wrap { max-width: 560px; justify-self: center; width: 100%; }
}

/* ---------- sections ---------- */
.sec-title {
  margin: 0; font-size: clamp(36px, 4.8vw, 60px); line-height: 1; font-weight: 800;
  font-variation-settings: "opsz" 72, "wdth" 80; letter-spacing: -.015em;
}
.sec-lede { margin: 12px 0 0; font-size: clamp(18px, 1.5vw, 20px); max-width: 52ch; }

.ingredients { padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(56px, 8vw, 110px); border-top: 2px solid var(--ink); }
.ing-list {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px 28px;
}
.ing { display: grid; gap: 10px; align-content: start; }
.ing svg { width: 84px; height: 84px; }
.ing h3 { margin: 0; font-size: 21px; line-height: 1.18; font-weight: 700; font-variation-settings: "opsz" 24; }
.ing p { margin: 0; font-size: 16.5px; color: var(--ink-2); }
@media (max-width: 1000px) { .ing-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .ing-list { grid-template-columns: 1fr; gap: 22px; }
  .ing { grid-template-columns: 64px 1fr; column-gap: 16px; row-gap: 2px; }
  .ing svg { width: 64px; height: 64px; grid-row: span 2; }
}

.recipe { background: var(--olive-deep); color: var(--paper); padding-top: clamp(56px, 8vw, 110px); padding-bottom: clamp(56px, 8vw, 110px); }
.recipe-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.recipe .sec-lede { color: #D9E0C9; }
.steps { list-style: none; counter-reset: s; margin: 36px 0 0; padding: 0; display: grid; gap: 24px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 46px 1fr; column-gap: 18px; }
.steps li::before {
  content: counter(s); grid-row: span 2;
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--paper); color: var(--lemon);
  display: grid; place-items: center; font-weight: 800; font-size: 18px;
}
.steps h3 { margin: 6px 0 0; font-size: 21px; line-height: 1.2; font-weight: 700; }
.steps .when { font-size: 15px; font-weight: 600; color: var(--lemon); margin-left: 6px; white-space: nowrap; }
.steps p { margin: 4px 0 0; color: #DCE3CF; max-width: 58ch; }
.tip { border: 2px solid var(--paper); border-radius: var(--r-l); padding: 22px 24px 26px; position: sticky; top: 20px; }
.tip-art { width: 100%; max-width: 260px; height: auto; margin-bottom: 10px; }
.tip h3 { margin: 0 0 8px; font-size: 24px; color: var(--lemon); font-weight: 750; }
.tip p { margin: 0; color: #E4EAD8; }
@media (max-width: 860px) { .recipe-grid { grid-template-columns: 1fr; } .tip { position: static; } }

.paint { padding-top: clamp(56px, 8vw, 110px); padding-bottom: clamp(56px, 8vw, 110px); }
.paint-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: clamp(24px, 4vw, 64px); align-items: start; margin-top: 32px; }
.canvas-wrap {
  position: relative; aspect-ratio: 1 / 1; width: 100%;
  border: 2px solid var(--ink); border-radius: var(--r-l); background: #fff; overflow: hidden;
}
.canvas-wrap canvas, .canvas-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; }
.canvas-wrap img { pointer-events: none; }
.canvas-wrap canvas { cursor: pointer; touch-action: manipulation; }
.canvas-note {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0;
  background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  transition: opacity .3s;
}
.canvas-note.is-hidden { opacity: 0; }
.tool-label { margin: 0 0 10px; font-weight: 700; }
.palette { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; max-width: 460px; }
.sw {
  appearance: none; aspect-ratio: 1 / 1; width: 100%; padding: 0; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--c); cursor: pointer;
  box-shadow: 0 3px 0 var(--ink); transition: transform .12s;
}
.sw:hover { transform: translateY(-2px); }
.sw[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 3px; transform: none; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn[aria-pressed="true"] { background: var(--lemon); }
@media (max-width: 860px) { .paint-grid { grid-template-columns: 1fr; } .palette { max-width: none; } }

.foot { border-top: 2px solid var(--ink); }
.foot-in { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 28px; padding-top: 26px; padding-bottom: 36px; font-size: 15px; color: var(--ink-2); }
.foot-in p { margin: 0; }
.foot-mark { font-weight: 800; font-size: 20px; color: var(--ink); font-variation-settings: "opsz" 24, "wdth" 80; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; background: rgba(32, 38, 26, .62); }
.modal[hidden] { display: none; }
.modal-card {
  width: 100%; max-width: 480px; max-height: calc(100vh - 36px); overflow: auto;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-l);
  padding: 18px; display: grid; gap: 12px;
}
.modal-title { margin: 0; font-size: 26px; font-weight: 800; font-variation-settings: "opsz" 36, "wdth" 85; }
.modal-card img { width: 100%; border: 2px solid var(--ink); border-radius: var(--r-m); background: #fff; }
.modal-hint { margin: 0; font-size: 14px; color: var(--ink-2); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; }

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