/* Kobri web: the Kobri 3 tactics board. Chalk on a green board, masking tape for actions,
   magnets for players, sticky notes for the details. Flat and hand-made: no glass, glow or
   gradients beyond the board's own chalk dust. Tokens match the app and the approved gallery. */

@font-face { font-family: Caveat; src: url(/assets/fonts/caveat.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: Inter; src: url(/assets/fonts/inter.woff2) format("woff2"); font-weight: 500 700; font-display: swap; }
/* Arabic faces load only when Arabic text is on the page (unicode-range). */
@font-face { font-family: "Aref Ruqaa"; src: url(/assets/fonts/ruqaa-bold.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0600-06FF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url(/assets/fonts/plex-arabic-500.woff2) format("woff2"); font-weight: 400 600; font-display: swap; unicode-range: U+0600-06FF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url(/assets/fonts/plex-arabic-700.woff2) format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+FE70-FEFF; }

:root {
  --board: #20382B;
  --chalk: #F4F1E6;
  --chalk2: rgba(244, 241, 230, .64);
  --chalk3: rgba(244, 241, 230, .26);
  --yel: #F2D16B;
  --red: #C8302A;
  --tape: #E9DDB8;
  --ink: #2B2A22;
  --hand: Caveat, "Segoe Print", cursive;
  --text: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tex: radial-gradient(rgba(244,241,230,.055) 1px, transparent 1.4px) 0 0/13px 13px,
         radial-gradient(rgba(0,0,0,.16) 1px, transparent 1.4px) 6px 7px/9px 9px;
  color-scheme: dark;
}
/* Arabic: Ruqaa for the big hand-lettered headings, Plex for everything else, never letter-spaced. */
:root[dir="rtl"] { --hand: "Aref Ruqaa", Caveat, serif; --text: "IBM Plex Sans Arabic", Inter, system-ui, sans-serif; }
[dir="rtl"] * { letter-spacing: 0 !important; }

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--tex),
    radial-gradient(ellipse 70% 28% at 22% 14%, rgba(244,241,230,.05), transparent 70%),
    radial-gradient(ellipse 60% 34% at 86% 72%, rgba(244,241,230,.04), transparent 70%),
    var(--board);
  color: var(--chalk);
  font: 500 16px/1.5 var(--text);
  overflow-x: hidden;
}
a { color: var(--yel); text-underline-offset: 3px; }
bdi { unicode-bidi: isolate; }
svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ball path { fill: currentColor; stroke: none; }
:focus-visible { outline: 2px dashed var(--yel); outline-offset: 3px; }

/* ---------------------------------------------------------------------------- layout */
.wrap { width: 100%; max-width: 620px; margin: 0 auto; padding: 8px 16px 56px; flex: 1; }
.wrap.wide { max-width: 980px; }
.enter { animation: cWrite .36s cubic-bezier(.2,.8,.25,1) both; }
@keyframes cWrite { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
[dir="rtl"] .enter { animation-name: cWriteR; }
@keyframes cWriteR { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes cDraw { to { stroke-dashoffset: 0; } }
@keyframes cPop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.dr { stroke-dasharray: 1.01; stroke-dashoffset: 1.01; animation: cDraw .6s var(--d, .15s) cubic-bezier(.4,0,.2,1) forwards; }

/* ---------------------------------------------------------------------------- top bar */
.bar { width: 100%; max-width: 980px; margin: 0 auto; padding: 14px 16px 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: var(--chalk); text-decoration: none; display: inline-flex; }
.bar-links { display: flex; gap: 4px 16px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.bar-links a, .linkish {
  color: var(--chalk2); text-decoration: none; background: none; border: 0; cursor: pointer;
  font: 700 21px/1 var(--hand); padding: 10px 2px; min-height: 44px; display: inline-flex; align-items: center;
}
[dir="rtl"] .bar-links a, [dir="rtl"] .linkish { font-size: 18px; }
.bar-links a:hover, .linkish:hover, .bar-links a[aria-current="page"] { color: var(--chalk); }
.bar-links a[aria-current="page"] { text-decoration: underline wavy var(--yel) 1.5px; text-underline-offset: 6px; }
.linkish[lang="ar"] { font-family: "Aref Ruqaa", serif; font-size: 18px; }
.linkish[lang="en"] { font-family: Caveat, cursive; font-size: 21px; }

/* The wordmark: "K", the ball as the o mid-bounce, "bri"; tilted like the app. Arabic: Ruqaa
   كوٮري with a dotless beh and the ball placed under it as the dot. */
.logo { display: inline-flex; align-items: flex-end; font: 700 var(--size, 42px)/1 Caveat, cursive; transform: rotate(-4deg); color: inherit; }
.logo .ball { width: .5em; height: .5em; margin: 0 .04em .2em; transform: rotate(-12deg); fill: currentColor; flex: none; }
.logo-ar { position: relative; display: inline-block; font: 700 var(--size, 34px)/1.3 "Aref Ruqaa", serif; padding-bottom: .3em; color: inherit; }
.logo-ar .ball { position: absolute; width: .4em; height: .4em; fill: currentColor; bottom: .02em; left: 47%; transform: translateX(-50%); }

/* ---------------------------------------------------------------------------- type */
h1, h2, h3 { font-family: var(--hand); font-weight: 700; color: var(--chalk); margin: 0; }
h1, h2 { position: relative; }
h2:has(> .ul) { display: inline-block; }
h1 { position: relative; display: inline-block; font-size: 46px; line-height: .98; margin: 18px 0 26px; }
h2 { font-size: 32px; line-height: 1; margin: 30px 0 12px; }
h3 { font-size: 26px; line-height: 1.05; }
[dir="rtl"] h1 { font-size: 38px; line-height: 1.4; margin-bottom: 22px; }
[dir="rtl"] h2 { font-size: 27px; line-height: 1.45; }
[dir="rtl"] h3 { font-size: 22px; line-height: 1.45; }
.ul { position: absolute; left: 0; bottom: -12px; width: 70%; height: 12px; overflow: visible; }
.ul path { stroke: var(--yel); stroke-width: 3.2; }
[dir="rtl"] .ul { left: auto; right: 0; bottom: -6px; }
p { margin: 8px 0; }
.muted { color: var(--chalk2); }
.small { font-size: 14px; }
.lbl { font: 600 11.5px/1.3 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--chalk2); }
.center { text-align: center; }

/* ---------------------------------------------------------------------------- surfaces */
/* A chalk frame: a slightly wobbly double line, as if drawn twice. */
.card {
  position: relative; margin: 22px 4px; padding: 18px 18px 20px;
  border: 2px solid rgba(244,241,230,.78); border-radius: 4px 10px 6px 12px / 10px 5px 12px 6px;
}
.card::after {
  content: ""; position: absolute; inset: -5px -3px -3px -5px; pointer-events: none;
  border: 1.5px solid rgba(244,241,230,.2); border-radius: 12px 5px 10px 4px / 5px 12px 6px 10px; transform: rotate(-.4deg);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 2px; }
.card.center h1 { margin-top: 6px; }
.rule { border: 0; border-top: 2px dashed var(--chalk3); margin: 20px 0; }

/* Sticky notes: the slips the organiser pins on the board. */
.stickies { display: flex; flex-wrap: wrap; gap: 18px 14px; margin: 20px 2px 10px; }
.sticky {
  position: relative; min-width: 100px; padding: 12px 14px 10px; background: var(--yel); color: var(--ink);
  transform: rotate(2.2deg); box-shadow: 0 7px 12px -2px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.25);
}
.sticky:nth-child(even) { transform: rotate(-1.6deg); background: var(--tape); }
.sticky::before { content: ""; position: absolute; top: -8px; left: 50%; width: 44px; height: 16px; margin-left: -22px; background: rgba(233,221,184,.86); transform: rotate(-4deg); }
.sticky:nth-child(even)::before { background: rgba(242,209,107,.8); }
.sticky small { display: block; font: 600 10px/1.3 var(--text); letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.sticky b { display: block; font: 700 28px/1.05 var(--hand); margin-top: 2px; }
[dir="rtl"] .sticky b { font-size: 21px; line-height: 1.5; }

/* ---------------------------------------------------------------------------- buttons */
/* Masking tape torn from the roll: jagged ends, a slight tilt, pressed flat on tap. */
.btn {
  position: relative; z-index: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 10px 22px; border: 0; background: none; cursor: pointer; text-decoration: none; text-align: center;
  color: var(--ink); font: 700 27px/1 var(--hand);
  filter: drop-shadow(0 2px 1.5px rgba(0,0,0,.4)); transform: rotate(-.8deg);
  transition: transform .15s cubic-bezier(.3,1.3,.5,1);
}
[dir="rtl"] .btn { font-size: 21px; line-height: 1.3; }
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--tape);
  clip-path: polygon(0 0,100% 0,calc(100% - 5px) 14%,100% 28%,calc(100% - 4px) 43%,100% 57%,calc(100% - 5px) 72%,100% 86%,calc(100% - 3px) 100%,0 100%,5px 86%,0 72%,4px 57%,0 43%,5px 28%,0 14%);
}
.btn:nth-child(even) { transform: rotate(.7deg); }
.btn:hover { transform: rotate(0) translateY(-1px); }
.btn:active { transform: rotate(0) scale(.96); }
.btn-tape::before { background: var(--yel); }
.btn-danger { color: #fff; }
.btn-danger::before { background: var(--red); }
/* Secondary: a chalk outline rather than tape. */
.btn-line { color: var(--chalk); filter: none; }
.btn-line::before { background: none; clip-path: none; border: 2px solid rgba(244,241,230,.8); border-radius: 22px 18px 20px 24px / 18px 22px 18px 22px; }
.btn-line:hover::before { background: rgba(244,241,230,.07); }
.btn:disabled { opacity: .35; pointer-events: none; filter: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0 6px; }
.btn-row .btn { flex: 1 1 150px; }
.full { width: 100%; }

/* ---------------------------------------------------------------------------- forms */
label { display: block; margin: 16px 0 6px; font: 600 11.5px/1.3 var(--text); letter-spacing: .12em; text-transform: uppercase; color: var(--chalk2); }
input {
  width: 100%; min-height: 50px; padding: 10px 2px 6px; color: var(--chalk); background: transparent;
  border: 0; border-bottom: 2px solid rgba(244,241,230,.55); border-radius: 0; font: 500 18px/1.3 var(--text);
}
input:focus { outline: none; border-bottom-color: var(--yel); }
.or { display: flex; align-items: center; gap: 12px; margin: 22px 0 4px; color: var(--chalk2); font: 700 22px/1.3 var(--hand); }
[dir="rtl"] .or { font-size: 17px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 2px dashed var(--chalk3); }

/* ---------------------------------------------------------------------------- magnets */
.mag {
  --m: #E9ECEA; --md: #C9CEC9; --mi: #111;
  position: relative; display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--m); color: var(--mi); font: 700 14px/1 Inter, var(--text);
  box-shadow: inset 0 -2.5px 0 var(--md), 0 2px 3px rgba(0,0,0,.5), 0 5px 8px -3px rgba(0,0,0,.35);
}
.mag::after { content: ""; position: absolute; left: 22%; top: 16%; width: 24%; height: 18%; border-radius: 50%; background: rgba(255,255,255,.38); }
.mag.blue { --m: #2A5CC0; --md: #173F8A; --mi: #fff; }
.mag.red { --m: #C8302A; --md: #8A1F1A; --mi: #fff; }
.mag.yel { --m: #F2D16B; --md: #C9A640; --mi: var(--ink); }
.mag.ghost { --m: transparent; --md: transparent; --mi: var(--chalk2); box-shadow: none; border: 2px dashed var(--chalk3); }
.mag.ghost::after { display: none; }
.mag.pop { animation: cPop .42s var(--d, .2s) cubic-bezier(.3,1.3,.5,1) both; }

/* ---------------------------------------------------------------------------- lists */
.list { list-style: none; padding: 0; margin: 6px 0; }
.list li { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 2px; border-bottom: 1px dashed rgba(244,241,230,.2); }
.list li .who { flex: 1; min-width: 0; font-weight: 600; }
.list li .nick { color: var(--chalk2); font-size: 14px; font-weight: 500; }
.list li.out .who { color: var(--chalk2); text-decoration: line-through; text-decoration-color: rgba(200,48,42,.85); text-decoration-thickness: 2px; }
.pick {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; margin: 10px 0; padding: 8px 12px;
  color: var(--chalk); background: none; cursor: pointer; text-align: start; font: 600 17px/1.3 var(--text);
  border: 2px solid rgba(244,241,230,.35); border-radius: 18px 14px 16px 20px / 14px 18px 14px 18px;
  transition: border-color .15s, transform .15s;
}
.pick:hover { border-color: rgba(244,241,230,.7); }
.pick[aria-pressed="true"] { border-color: var(--yel); transform: rotate(-.5deg); }
.pick[aria-pressed="true"] .mag { animation: cJump .5s cubic-bezier(.3,1.4,.5,1); --m: #F2D16B; --md: #C9A640; --mi: var(--ink); }
@keyframes cJump { 0% { transform: none; } 35% { transform: translateY(-8px) scale(1.12); } 100% { transform: none; } }

/* Status written in chalk next to a name. */
.tag { flex: none; font: 700 21px/1 var(--hand); color: var(--chalk2); white-space: nowrap; }
[dir="rtl"] .tag { font-size: 17px; line-height: 1.5; }
.tag-in { color: var(--yel); }
.tag-wait { color: var(--tape); }
.tag-out { color: #F08A84; }

/* ---------------------------------------------------------------------------- notices */
.notice, .error {
  position: relative; margin: 16px 2px; padding: 12px 16px; color: var(--ink); font-weight: 600;
  background: var(--tape); transform: rotate(-.4deg); box-shadow: 0 5px 10px -3px rgba(0,0,0,.4);
}
.error { background: #F08A84; }
.notice a, .error a { color: var(--ink); }

/* ---------------------------------------------------------------------------- match card */
.when { font: 700 34px/1.05 var(--hand); margin: 2px 0 6px; color: var(--chalk); }
[dir="rtl"] .when { font-size: 25px; line-height: 1.55; }
.count { display: flex; align-items: center; gap: 14px; margin: 16px 0 4px; }
.count .big { position: relative; display: grid; place-items: center; min-width: 76px; height: 62px; padding: 0 10px; font: 700 48px/1 Caveat, var(--hand); }
.count .big svg { position: absolute; inset: -6px -10px; width: calc(100% + 20px); height: calc(100% + 12px); overflow: visible; }
.count .big path { stroke: var(--yel); stroke-width: 2.6; }
.count .of { font: 700 23px/1.15 var(--hand); color: var(--chalk2); }
[dir="rtl"] .count .of { font-size: 18px; line-height: 1.5; }
.mags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }

/* ---------------------------------------------------------------------------- landing */
.hero { position: relative; padding: 18px 0 6px; }
.hero h1 { font-size: clamp(48px, 12.5vw, 96px); line-height: .9; margin: 12px 0 34px; }
[dir="rtl"] .hero h1 { font-size: clamp(42px, 11vw, 74px); line-height: 1.4; margin-bottom: 24px; }
.hero h1 .ul { width: 86%; bottom: -18px; height: 16px; }
[dir="rtl"] .hero h1 .ul { bottom: -4px; }
.hero .lead { font-size: 19px; line-height: 1.5; color: var(--chalk); max-width: 30em; }
.hero .btn-row { max-width: 520px; margin-top: 22px; }

.steps { display: grid; gap: 26px; margin: 14px 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 60px 1fr; gap: 14px; align-items: start; }
.steps .num { position: relative; display: grid; place-items: center; width: 60px; height: 54px; font: 700 38px/1 Caveat, cursive; color: var(--yel); }
.steps .num svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.steps .num path { stroke: rgba(244,241,230,.8); stroke-width: 2.2; }
.steps h3 { margin: 6px 0 4px; }
.steps p { margin: 0; color: var(--chalk2); }

.demo { margin-top: 30px; }
.demo .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.demo .stamp { font: 700 20px/1 var(--hand); color: var(--chalk2); transform: rotate(-5deg); border: 2px solid var(--chalk3); padding: 4px 10px 2px; border-radius: 6px 4px 7px 5px; }
.demo .board { position: relative; height: 150px; margin: 12px 0 4px; }
.demo .board svg.pitch { position: absolute; inset: 0; width: 100%; height: 100%; }
.demo .board svg.pitch path { stroke: rgba(244,241,230,.25); stroke-width: 2; }
.demo .board svg.run { position: absolute; left: 30%; top: 30%; width: 34%; height: 40%; overflow: visible; }
.demo .board svg.run path { stroke: var(--chalk); stroke-width: 2.4; }
.demo .board .mag { position: absolute; transform: translate(-50%, -50%); }
.demo .board .mag.pop { animation-name: cPopC; }
@keyframes cPopC { 0% { transform: translate(-50%,-50%) scale(0); } 70% { transform: translate(-50%,-50%) scale(1.15); } 100% { transform: translate(-50%,-50%) scale(1); } }
.tally { height: 28px; width: auto; }
.tally path { stroke: var(--chalk); stroke-width: 2.4; }

.section h2 { position: relative; display: inline-block; }
.get { display: grid; gap: 26px; margin: 18px 0; }
.get .card { margin: 0 4px; }
.get p { color: var(--chalk2); }

@media (min-width: 820px) {
  .home { display: grid; grid-template-columns: 1.15fr .85fr; gap: 10px 56px; align-items: start; }
  .home .demo { margin-top: 84px; transform: rotate(1deg); }
  .home .section { grid-column: 1 / -1; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 34px; }
  .steps li { display: flex; flex-direction: column; gap: 8px; }
  .get { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------------------------- footer */
footer { width: 100%; max-width: 980px; margin: 0 auto; padding: 20px 16px 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; border-top: 2px dashed var(--chalk3); color: var(--chalk2); font-size: 14px; }
footer a { color: var(--chalk2); min-height: 32px; display: inline-flex; align-items: center; }
footer .spacer { flex: 1; }

@media (max-width: 480px) {
  .stickies { gap: 16px 10px; }
  .sticky { min-width: 0; padding: 10px 11px 8px; }
  .sticky b { font-size: 23px; }
  [dir="rtl"] .sticky b { font-size: 18px; }
}
@media (max-width: 380px) {
  h1 { font-size: 40px; }
  .bar-links { gap: 2px 12px; }
  .bar-links a, .linkish { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .dr { stroke-dashoffset: 0; }
}
