/*
 * Webfoot components
 * ------------------
 * Reusable building blocks for the playful Webfoot look: thick ink
 * borders, hard offset shadows, slight tilts, duck yellow accents.
 * Requires tokens.css. See design-system/index.html for a live guide.
 */

/* ===== Base ============================================================ */

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--wf-bg);
  color: var(--wf-text);
  font-family: var(--wf-font-sans);
  font-size: var(--wf-text-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: var(--wf-ink); }
a:hover { color: var(--wf-fir); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--wf-focus);
  outline-offset: 3px;
}

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

.wf-skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
}
.wf-skip:focus { top: 16px; }

/* ===== Layout ========================================================== */

.wf-container {
  max-width: var(--wf-container);
  margin: 0 auto;
  padding-left: var(--wf-gutter);
  padding-right: var(--wf-gutter);
}

/* ===== Type ============================================================ */

.wf-display {
  margin: 0;
  font-size: var(--wf-text-display);
  line-height: 0.92;
  font-weight: var(--wf-weight-black);
  letter-spacing: var(--wf-tracking-display);
}

.wf-h2 {
  margin: 0;
  font-size: var(--wf-text-h2);
  line-height: 0.95;
  font-weight: var(--wf-weight-black);
  letter-spacing: var(--wf-tracking-h2);
}

.wf-h3 {
  margin: 0;
  font-size: var(--wf-text-h3);
  font-weight: var(--wf-weight-black);
  letter-spacing: var(--wf-tracking-h3);
  line-height: 1.15;
}
.wf-h3--lg { font-size: var(--wf-text-h3-lg); }

.wf-lede {
  margin: 0;
  font-size: var(--wf-text-lede);
  line-height: 1.55;
  color: var(--wf-text-muted);
}

.wf-body-lg {
  margin: 0;
  font-size: var(--wf-text-body-lg);
  line-height: 1.6;
  color: var(--wf-text-muted);
}

.wf-muted { color: var(--wf-text-muted); }

.wf-mono {
  font-family: var(--wf-font-mono);
  font-weight: var(--wf-weight-black);
}

/* Small mono label, e.g. "step 1" */
.wf-label {
  font-family: var(--wf-font-mono);
  font-size: var(--wf-text-small);
  font-weight: var(--wf-weight-bold);
  color: var(--wf-text-subtle);
}

/* ===== Wordmark ========================================================= */
/* webfoot_  — mono, tight tracking, accent underscore */

.wf-wordmark {
  font-family: var(--wf-font-mono);
  font-weight: var(--wf-weight-black);
  letter-spacing: -0.05em;
  line-height: 1;
  white-space: nowrap;
}
.wf-wordmark__cursor { color: var(--wf-bill-deep); }
.wf-wordmark--on-dark { color: var(--wf-white); }
.wf-wordmark--on-dark .wf-wordmark__cursor { color: var(--wf-accent); }

.wf-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--wf-ink);
  text-decoration: none;
}
.wf-logo .wf-wordmark { font-size: 26px; }

/* ===== Duck & footprint marks ========================================== */
/*
 * The duck symbol (#wf-duck in the SVG sprite) reads these variables,
 * so one symbol covers every colorway:
 *   --duck-body   body + head
 *   --duck-bill   bill
 *   --duck-detail eye + wing smile
 *   --duck-outline thick sticker outline (use #wf-duck-sticker)
 */

.wf-mark {
  --duck-body: var(--wf-fir);
  --duck-bill: var(--wf-bill);
  --duck-detail: var(--wf-white);
  --duck-outline: var(--wf-ink);
  display: inline-block;
  flex: none;
}
.wf-mark--yellow {
  --duck-body: var(--wf-accent);
  --duck-detail: var(--wf-ink);
}
.wf-mark--yellow-on-fir {
  --duck-body: var(--wf-accent);
  --duck-detail: var(--wf-fir);
}

/* ===== Buttons ========================================================= */

.wf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 14px 26px;
  font: inherit;
  font-size: var(--wf-text-body-lg);
  font-weight: var(--wf-weight-black);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: var(--wf-ink);
  background: var(--wf-accent);
  border: var(--wf-border);
  border-radius: var(--wf-radius-md);
  box-shadow: var(--wf-shadow-md);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.wf-btn:hover {
  color: var(--wf-ink);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--wf-ink);
}
.wf-btn:active {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 var(--wf-ink);
}
@media (prefers-reduced-motion: reduce) {
  .wf-btn { transition: none; }
  .wf-btn:hover, .wf-btn:active { transform: none; }
}

.wf-btn--light { background: var(--wf-white); }
.wf-btn--dark,
.wf-btn--dark:hover { background: var(--wf-ink); color: var(--wf-white); }

.wf-btn--sm {
  min-height: 44px;
  padding: 9px 20px;
  font-size: var(--wf-text-body);
  border-radius: 14px;
  box-shadow: var(--wf-shadow-xs);
}
.wf-btn--sm:hover { box-shadow: 6px 6px 0 var(--wf-ink); }

.wf-btn--block { display: flex; width: 100%; box-shadow: var(--wf-shadow-sm); }

/* On Fir sections the shadow goes deeper than Ink */
.wf-btn--on-fir { box-shadow: 6px 6px 0 var(--wf-shadow-deep); }
.wf-btn--on-fir:hover { box-shadow: 8px 8px 0 var(--wf-shadow-deep); }

/* ===== Cards =========================================================== */

.wf-card {
  --tilt: 0deg;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  background: var(--wf-surface);
  border: var(--wf-border);
  border-radius: var(--wf-radius-lg);
  box-shadow: var(--wf-shadow-lg);
  transform: rotate(var(--tilt));
}
.wf-card p { margin: 0; font-size: var(--wf-text-body); line-height: 1.55; }

.wf-card--duck { background: var(--wf-accent); }
.wf-card--bill { background: var(--wf-bill); }
.wf-card--fir  { background: var(--wf-fir); color: var(--wf-white); }
.wf-card--fir p { color: var(--wf-on-dark); }
.wf-card--white p { color: var(--wf-text-muted); }

/* Tilts: the hand-placed sticker feel */
.wf-tilt-1 { --tilt: -1deg; }
.wf-tilt-2 { --tilt: 0.8deg; }
.wf-tilt-3 { --tilt: -0.6deg; }
.wf-tilt-4 { --tilt: 1.2deg; }

/* ===== Tags & stickers ================================================= */

.wf-tag {
  display: inline-block;
  padding: 4px 12px;
  font-family: var(--wf-font-mono);
  font-size: var(--wf-text-tiny);
  font-weight: var(--wf-weight-black);
  color: var(--wf-ink);
  background: var(--wf-accent);
  border: var(--wf-border-thin);
  transform: rotate(var(--tilt, -4deg));
}
.wf-tag--bill { background: var(--wf-bill); --tilt: 3deg; }

.wf-pill {
  display: inline-block;
  padding: 6px 14px;
  font-family: var(--wf-font-mono);
  font-size: var(--wf-text-tiny);
  font-weight: var(--wf-weight-black);
  background: var(--wf-bill);
  border: var(--wf-border);
  border-radius: var(--wf-radius-pill);
  transform: rotate(4deg);
}

.wf-bubble {
  display: inline-block;
  padding: 6px 14px;
  font-family: var(--wf-font-mono);
  font-size: 16px;
  font-weight: var(--wf-weight-black);
  background: var(--wf-white);
  border: var(--wf-border);
  border-radius: 16px 16px 16px 4px;
}

/* ===== Browser frame =================================================== */

.wf-browser {
  overflow: hidden;
  background: var(--wf-white);
  border: var(--wf-border);
  border-radius: 18px;
  box-shadow: var(--wf-shadow-lg);
}
.wf-browser__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: var(--wf-rain);
  border-bottom: var(--wf-border);
}
.wf-browser__dot {
  width: 11px;
  height: 11px;
  border: var(--wf-border-thin);
  border-radius: var(--wf-radius-pill);
}
.wf-browser__url {
  margin-left: 8px;
  overflow: hidden;
  font-family: var(--wf-font-mono);
  font-size: 13px;
  color: var(--wf-text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wf-browser__screen {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  background: var(--wf-tint-mint);
  color: var(--wf-text-muted);
  font-weight: 600;
}
.wf-browser__screen--butter { background: var(--wf-tint-butter); }
.wf-browser__screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ===== Terminal ======================================================== */

.wf-terminal {
  overflow: hidden;
  background: var(--wf-ink);
  border: var(--wf-border);
  border-radius: 20px;
  box-shadow: 10px 10px 0 var(--wf-bill);
}
.wf-terminal__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: var(--wf-terminal-bar);
  border-bottom: var(--wf-border);
}
.wf-terminal__light {
  width: 14px;
  height: 14px;
  border-radius: var(--wf-radius-pill);
  background: var(--wf-bill);
}
.wf-terminal__light:nth-child(2) { background: var(--wf-accent); }
.wf-terminal__light:nth-child(3) { background: var(--wf-moss); }
.wf-terminal__path {
  margin-left: 10px;
  font-family: var(--wf-font-mono);
  font-size: var(--wf-text-tiny);
  color: var(--wf-on-dark-muted);
}
.wf-terminal__body {
  padding: 24px 24px 28px;
  font-family: var(--wf-font-mono);
  font-size: 16px;
  line-height: 1.85;
  color: var(--wf-on-dark-strong);
}
.wf-terminal__body p { margin: 0; }
.wf-terminal__prompt { color: var(--wf-moss); }
.wf-terminal__ok { color: var(--wf-accent); }
.wf-terminal__answer { color: var(--wf-white); font-weight: var(--wf-weight-bold); }
.wf-terminal__note { margin-top: 10px !important; color: var(--wf-moss); }
.wf-terminal__caret {
  display: inline-block;
  width: 10px;
  height: 18px;
  vertical-align: -3px;
  background: var(--wf-accent);
}

/* ===== Lists =========================================================== */

.wf-checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wf-checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: var(--wf-text-body);
  line-height: 1.45;
}
.wf-checklist svg { flex: none; width: 22px; height: 22px; margin-top: 1px; }
.wf-checklist .is-off { color: var(--wf-text-off); }

/* ===== Forms =========================================================== */

.wf-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: var(--wf-text-small);
  font-weight: var(--wf-weight-black);
  cursor: pointer;
  transition: color 220ms cubic-bezier(.2, .8, .2, 1);
}
/* The label answers too: it turns orange while its field is in use. */
.wf-field:focus-within { color: var(--wf-bill-deep); }

.wf-input {
  min-height: 54px;
  padding: 13px 15px;
  font: inherit;
  font-size: var(--wf-text-body);
  font-weight: var(--wf-weight-regular);
  color: var(--wf-ink);
  caret-color: var(--wf-bill-deep);
  background: var(--wf-rain);
  border: var(--wf-border);
  border-radius: var(--wf-radius-sm);
  box-shadow: 0 0 0 var(--wf-accent);
  cursor: text;
  /* Ease in and out: a soft lift, brighter fill and a duck-yellow shadow. */
  transition:
    background-color 260ms cubic-bezier(.2, .8, .2, 1),
    box-shadow 260ms cubic-bezier(.2, .8, .2, 1),
    transform 260ms cubic-bezier(.2, .8, .2, 1),
    border-color 260ms ease;
}
.wf-input:hover { background: #F6F8F5; }
.wf-input:focus,
.wf-input:focus-visible {
  outline: none;
  background: var(--wf-white);
  border-color: var(--wf-ink);
  box-shadow: 5px 5px 0 var(--wf-accent), 5px 5px 0 3px var(--wf-ink);
  transform: translate(-2px, -2px);
}
.wf-input::placeholder { color: #7A877F; opacity: 1; transition: opacity 200ms ease; }
.wf-input:focus::placeholder { opacity: .55; }
select.wf-input { cursor: pointer; appearance: none; padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2315201B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
textarea.wf-input { resize: vertical; }
@media (prefers-reduced-motion: reduce) {
  .wf-input { transition: background-color 120ms linear, border-color 120ms linear; }
  .wf-input:focus, .wf-input:focus-visible { transform: none; }
}

/* ===== Accordion ======================================================= */
/* Native <details>/<summary>, so it works without JavaScript. */

.wf-accordion {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wf-accordion__item {
  background: var(--wf-white);
  border: var(--wf-border);
  border-radius: 18px;
  box-shadow: var(--wf-shadow-sm);
}
.wf-accordion__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 18px 20px 18px 24px;
  font-size: 20px;
  font-weight: var(--wf-weight-black);
  letter-spacing: -0.015em;
  line-height: 1.3;
  list-style: none;
  cursor: pointer;
}
.wf-accordion__item summary::-webkit-details-marker { display: none; }
.wf-accordion__item summary:focus-visible {
  outline: 3px solid var(--wf-focus);
  outline-offset: 3px;
  border-radius: 14px;
}
.wf-accordion__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  background: var(--wf-white);
  border: var(--wf-border);
  border-radius: var(--wf-radius-pill);
  transition: transform 160ms ease, background-color 160ms ease;
}
.wf-accordion__item[open] .wf-accordion__icon {
  background: var(--wf-accent);
  transform: rotate(45deg);
}
@media (prefers-reduced-motion: reduce) {
  .wf-accordion__icon { transition: none; }
}
@media (max-width: 640px) {
  .wf-accordion__item summary { font-size: 18px; padding: 16px 16px 16px 20px; }
  .wf-accordion__body { padding: 0 20px 20px; }
}
.wf-accordion__body {
  padding: 0 24px 22px;
}
.wf-accordion__body p {
  margin: 0;
  max-width: 40em;
  font-size: var(--wf-text-body);
  line-height: 1.6;
  color: var(--wf-text-muted);
}

/* ===== Wave divider ==================================================== */
/* Set --wave-from (background above) and --wave-to (fill below). */

.wf-wave {
  display: block;
  width: 100%;
  height: 44px;
  background: var(--wave-from, var(--wf-rain));
}
.wf-wave__fill { fill: var(--wave-to, var(--wf-white)); }
.wf-wave__line { fill: none; stroke: var(--wf-ink); stroke-width: 3; }

/* ===== Ticker ribbon =================================================== */

.wf-ticker {
  margin: 0 -40px;
  padding: 16px 0;
  overflow: hidden;
  white-space: nowrap;
  background: var(--wf-accent);
  border-top: var(--wf-border);
  border-bottom: var(--wf-border);
  transform: rotate(-1.2deg);
}
.wf-ticker__track {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--wf-font-mono);
  font-size: 22px;
  font-weight: var(--wf-weight-black);
  letter-spacing: -0.02em;
}

/* ===== Motion ========================================================== */

@keyframes wf-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.wf-cursor { animation: wf-blink 1.1s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) { .wf-cursor { animation: none; } }

/* ===== Interaction =====================================================
 * Everything you can click shows a pointer and answers back. site.js adds
 * the one-shot classes (.is-boing, .is-quacking) and the click bursts.
 */

a, button, summary, label, select, [role="button"] { cursor: pointer; }
.wf-input { cursor: text; }
button, .wf-btn, summary { -webkit-tap-highlight-color: transparent; }

/* Buttons spring back after a click (uses `scale`, so it stacks with the
   hover/press `transform`). */
@keyframes wf-boing {
  0%   { scale: .9; }
  45%  { scale: 1.07; }
  70%  { scale: .97; }
  100% { scale: 1; }
}
.wf-btn.is-boing { animation: wf-boing 420ms cubic-bezier(.3, 1.4, .5, 1); }

/* Cards lift and straighten on hover */
.wf-card { transition: transform 200ms ease, box-shadow 200ms ease; }
.wf-card:hover {
  transform: rotate(0deg) translate(-3px, -3px);
  box-shadow: 11px 11px 0 var(--wf-ink);
}

/* Accordion: hover tint, and the answer drops in when opened */
.wf-accordion__item summary { transition: background-color 160ms ease; border-radius: 15px; }
.wf-accordion__item summary:hover { background: var(--wf-rain); }
.wf-accordion__item summary:hover .wf-accordion__icon { transform: rotate(90deg); }
.wf-accordion__item[open] summary:hover .wf-accordion__icon { transform: rotate(135deg); }
@keyframes wf-drop { from { opacity: 0; translate: 0 -8px; } to { opacity: 1; translate: 0 0; } }
.wf-accordion__item[open] .wf-accordion__body { animation: wf-drop 260ms ease-out; }

/* Duck buttons: a squeezable duck. Click and it squishes, wobbles and
   says something. */
.duck-btn {
  position: relative;
  display: inline-flex;
  padding: 0;
  font: inherit;
  line-height: 0;
  background: none;
  border: 0;
  border-radius: 24px;
  color: inherit;
}
.duck-btn > svg { transition: translate 160ms ease; }
.duck-btn:hover > svg { translate: 0 -4px; }
.duck-btn:active > svg { translate: 0 2px; }
@keyframes wf-squeak {
  0%   { scale: 1 1; }
  20%  { scale: 1.18 .78; }
  45%  { scale: .9 1.14; }
  65%  { scale: 1.06 .95; }
  85%  { scale: .98 1.02; }
  100% { scale: 1 1; }
}
.duck-btn.is-quacking > svg {
  transform-origin: 50% 90%;
  animation: wf-squeak 520ms cubic-bezier(.3, 1.3, .5, 1);
}
@keyframes wf-quack-up {
  0%   { opacity: 0; translate: -50% 6px; scale: .6; }
  20%  { opacity: 1; translate: -50% -6px; scale: 1.05; }
  75%  { opacity: 1; translate: -50% -22px; scale: 1; }
  100% { opacity: 0; translate: -50% -34px; scale: .95; }
}
.wf-quack {
  position: absolute;
  bottom: 100%;
  left: 50%;
  z-index: 5;
  padding: 5px 12px;
  font-family: var(--wf-font-mono);
  font-size: 15px;
  font-weight: var(--wf-weight-black);
  line-height: 1.3;
  white-space: nowrap;
  color: var(--wf-ink);
  background: var(--wf-white);
  border: var(--wf-border);
  border-radius: 14px 14px 14px 4px;
  pointer-events: none;
  translate: -50% -22px;
  animation: wf-quack-up 1100ms ease-out forwards;
}

/* Click burst: little dots that pop out from where you clicked */
.wf-burst {
  position: fixed;
  z-index: 1000;
  width: 0;
  height: 0;
  pointer-events: none;
}
.wf-burst i {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--wf-ink);
  border-radius: 50%;
  background: var(--dot, var(--wf-accent));
  animation: wf-burst 560ms cubic-bezier(.2, .8, .3, 1) forwards;
}
@keyframes wf-burst {
  0%   { opacity: 1; translate: 0 0; scale: .4; }
  60%  { opacity: 1; }
  100% { opacity: 0; translate: var(--dx) var(--dy); scale: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .wf-btn.is-boing,
  .duck-btn.is-quacking > svg,
  .wf-accordion__item[open] .wf-accordion__body { animation: none; }
  .wf-card,
  .duck-btn > svg,
  .wf-accordion__item summary { transition: none; }
  .wf-card:hover { transform: rotate(var(--tilt)); box-shadow: var(--wf-shadow-lg); }
  .duck-btn:hover > svg,
  .duck-btn:active > svg { translate: none; }
  .wf-quack { animation: none; opacity: 1; }
}
