/*
 * klubfish landing page. One file, no framework, no external requests.
 * Token values are copied 1:1 from src/ui/tokens.css (light = default, dark via prefers-color-scheme);
 * if that file changes, change the matching lines here. Components use the semantic roles only.
 */

@font-face {
  font-family: 'Instrument Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url('../fonts/instrument-sans-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('../fonts/poppins-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('../fonts/poppins-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('../fonts/poppins-latin-700-normal.woff2') format('woff2');
}

@property --len {
  syntax: '<integer>';
  inherits: true;
  initial-value: 62;
}

@layer reset, tokens, base, components;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  * {
    margin: 0;
  }
  img,
  svg,
  picture {
    display: block;
    max-width: 100%;
  }
  ul {
    padding: 0;
    list-style: none;
  }
  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
  }
  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
  }
}

@layer tokens {
  :root {
    --font-body: 'Instrument Sans Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Poppins', 'Instrument Sans Variable', system-ui, sans-serif;
    --t-small: 0.75rem;
    --t-bodys: 0.875rem;
    --t-body: 1rem;
    --t-sub: 1.25rem;
    --t-title: 1.5rem;
    --t-screen: 2rem;
    --t-board: 3rem;
    --lh-body: 1.5;
    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 24px;
    --s6: 32px;
    --s7: 48px;
    --r-s: 6px;
    --r-m: 12px;
    --r-l: 20px;
    --r-pill: 999px;
    --target: 44px;
    --control-h: 48px;
    --control-h-s: 40px;
    --content-max: 1120px;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --focus-w: 3px;
    --focus-offset: 2px;

    /* light (default) */
    --ground: #f1f4f0;
    --raised: #fbfcfa;
    --sunken: #e5eae4;
    --line: #dce2da;
    --line-strong: #767e74;
    --ink: #0f1512;
    --ink-2: #4b554d;
    --ink-3: #5a645c;
    --action: #00d096;
    --on-action: #06231a;
    --action-soft: #dcefe6;
    --action-line: #007450;
    --award: #d9a326;
    --award-ink: #6b4e00;
    --award-soft: #f4e7c6;
    --link: #007450;
    --water: #cfdde0;
    --land: #e5eae4;
    --shadow: 0 1px 2px rgb(20 18 14 / 0.05), 0 8px 20px rgb(20 18 14 / 0.07);
    --float-shadow: 0 10px 26px rgb(0 0 0 / 0.18);
    --ruler: #fbfcfa;
    --ruler-ink: #0f1512;
    --ruler-line: #dce2da;
    --ruler-fill: color-mix(in srgb, var(--action) 22%, transparent);
    --focus: var(--ink);
    /* the bezel of the phone frames: the ink of the app's own dark UI */
    --bezel: #0f1512;
    color-scheme: light;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --ground: #0b0f12;
      --raised: #141a1e;
      --sunken: #070a0c;
      --line: #232c32;
      --line-strong: #667a86;
      --ink: #f2f5f6;
      --ink-2: #a9b4ba;
      --ink-3: #8c99a0;
      --action: #22d39a;
      --on-action: #06231a;
      --action-soft: #0c3a2c;
      --action-line: #22d39a;
      --award-ink: #e3b54a;
      --award-soft: #2c2412;
      --link: #22d39a;
      --water: #16242b;
      --land: #10161a;
      --shadow: 0 8px 20px rgb(0 0 0 / 0.5), 0 2px 5px rgb(0 0 0 / 0.35);
      --float-shadow: 0 10px 26px rgb(0 0 0 / 0.42);
      --ruler: #141a1e;
      --ruler-ink: #f2f5f6;
      --ruler-line: #50636f;
      --bezel: #2b353c;
      color-scheme: dark;
    }
  }
}

@layer base {
  body {
    background: var(--ground);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--t-body);
    line-height: var(--lh-body);
    font-variant-numeric: lining-nums;
    text-rendering: optimizeLegibility;
  }
  h1,
  h2,
  h3 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    text-wrap: balance;
  }
  p,
  li,
  dd {
    text-wrap: pretty;
  }
  a {
    color: inherit;
  }
  :focus-visible {
    outline: var(--focus-w) solid var(--focus);
    outline-offset: var(--focus-offset);
    border-radius: var(--r-s);
  }
  ::selection {
    background: var(--action);
    color: var(--on-action);
  }
}

@layer components {
  .wrap {
    width: min(100% - 2 * var(--s5), var(--content-max));
    margin-inline: auto;
  }
  .skip {
    position: absolute;
    left: var(--s4);
    top: -100px;
    z-index: 10;
    background: var(--ink);
    color: var(--ground);
    padding: var(--s3) var(--s4);
    border-radius: var(--r-m);
    font-weight: 600;
  }
  .skip:focus {
    top: var(--s3);
  }

  /* ---------- buttons ---------- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-h);
    padding: 0 var(--s5);
    border-radius: var(--r-m);
    font-weight: 600;
    font-size: var(--t-body);
    text-decoration: none;
    line-height: 1.2;
    text-align: center;
    border: 1.5px solid transparent;
    transition: transform 0.18s var(--ease), background-color 0.18s var(--ease);
  }
  .btn-s {
    min-height: var(--target);
    padding: 0 var(--s4);
    font-size: var(--t-bodys);
  }
  .btn-primary {
    background: var(--action);
    color: var(--on-action);
  }
  .btn-primary:hover {
    background: color-mix(in srgb, var(--action) 88%, var(--ink));
  }
  .btn-primary:active {
    transform: translateY(1px);
  }
  .btn-quiet {
    border-color: var(--line-strong);
    color: var(--ink);
  }
  .btn-quiet:hover {
    background: var(--sunken);
  }
  .cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s3);
  }

  /* ---------- header ---------- */
  header.site {
    padding-block: var(--s3);
  }
  .bar {
    display: flex;
    align-items: center;
    gap: var(--s4);
  }
  .brand {
    display: block;
    flex: none;
    border-radius: var(--r-s);
  }
  .brand img {
    height: 36px;
    width: auto;
  }
  .primary {
    display: none;
    gap: var(--s5);
    margin-left: var(--s6);
  }
  .primary a {
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
  }
  .primary a:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 4px;
  }
  .langs {
    display: flex;
    margin-left: auto;
  }
  .langs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--target);
    min-height: var(--target);
    padding-inline: var(--s2);
    font-size: var(--t-bodys);
    font-weight: 600;
    color: var(--ink-2);
    text-decoration: none;
    border-radius: var(--r-s);
  }
  .langs a:hover {
    color: var(--ink);
  }
  .langs a[aria-current] {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
    text-decoration-color: var(--action-line);
  }
  .bar-cta {
    display: none;
  }

  /* ---------- hero ---------- */
  .hero {
    position: relative;
    padding-top: var(--s6);
    overflow: clip;
  }
  .hero-grid {
    display: grid;
    gap: var(--s6);
  }
  .hero h1 {
    font-weight: 700;
    font-size: clamp(2.5rem, 11vw, 4.75rem);
    line-height: 1.04;
    letter-spacing: -0.035em;
  }
  .hero h1 span {
    display: block;
    white-space: nowrap;
  }
  .hero-copy {
    padding-bottom: var(--s6);
  }
  .hero h1 .h1b {
    color: var(--action-line);
  }
  .sub {
    margin-top: var(--s5);
    max-width: 34rem;
    font-size: var(--t-sub);
    line-height: 1.45;
    color: var(--ink-2);
  }
  .hero .cta-row {
    margin-top: var(--s6);
  }
  .trust {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s1) var(--s5);
    margin-top: var(--s5);
    font-size: var(--t-bodys);
    color: var(--ink-3);
  }
  .hero-art {
    justify-self: center;
    height: 430px;
    overflow: hidden;
    width: min(100%, 300px);
  }

  /* the phone: a real screenshot in a quiet bezel */
  .phone {
    width: 100%;
    max-width: 300px;
    border: 7px solid var(--bezel);
    border-radius: 38px;
    background: var(--bezel);
    box-shadow: var(--float-shadow);
    overflow: hidden;
  }
  .phone img {
    width: 100%;
    height: auto;
    border-radius: 31px;
    aspect-ratio: 576 / 1248;
    background: var(--sunken);
  }
  .hero-art .phone {
    border-bottom: 0;
    border-radius: 38px 38px 0 0;
  }

  /* the memorable thing: a length ruler that reads 62 */
  .ruler {
    --u: 5px;
    --len: 62;
    position: relative;
    height: 132px;
    margin-top: 0;
    background: var(--ruler);
    border-block: 1px solid var(--ruler-line);
    overflow: hidden;
    background-image:
      linear-gradient(to right, var(--ruler-ink) 0 1.5px, transparent 1.5px),
      linear-gradient(to right, var(--ruler-ink) 0 1px, transparent 1px),
      linear-gradient(to right, var(--ruler-ink) 0 1px, transparent 1px);
    background-size:
      calc(var(--u) * 10) 34px,
      calc(var(--u) * 5) 22px,
      var(--u) 11px;
    background-position: left bottom;
    background-repeat: repeat-x;
    animation: read 1.5s var(--ease) 0.35s both;
  }
  .ruler-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(var(--u) * var(--len));
    background: var(--ruler-fill);
    border-right: 3px solid var(--action-line);
    box-shadow: 8px 0 24px -4px color-mix(in srgb, var(--action) 55%, transparent);
  }
  .ruler-reading {
    position: absolute;
    top: 8px;
    left: 0;
    width: calc(var(--u) * var(--len) - 14px);
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 6px;
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
  }
  .ruler-reading .num {
    font-size: 2.75rem;
    letter-spacing: -0.03em;
    counter-reset: len var(--len);
  }
  .ruler-reading .num::before {
    content: counter(len);
  }
  .ruler-reading .unit {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ink-2);
  }
  .ruler-labels span {
    position: absolute;
    bottom: 42px;
    left: calc(var(--u) * var(--n));
    transform: translateX(-50%);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
  }
  @keyframes read {
    from {
      --len: 0;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .ruler {
      animation: none;
    }
  }

  /* ---------- features ---------- */
  .feature {
    padding-block: var(--s7) 0;
  }
  .feature-grid {
    display: grid;
    gap: var(--s6);
    align-items: center;
  }
  .feature h2,
  .privacy h2,
  .club h2,
  .final h2,
  .faq h2 {
    font-size: clamp(1.75rem, 5.2vw, 2.75rem);
    line-height: 1.1;
    font-weight: 650;
  }
  .lead {
    margin-top: var(--s4);
    max-width: 34rem;
    font-size: 1.125rem;
    line-height: 1.55;
    color: var(--ink-2);
  }
  .ticks {
    display: grid;
    gap: var(--s3);
    margin-top: var(--s5);
    max-width: 34rem;
  }
  .ticks li {
    display: flex;
    gap: var(--s3);
    align-items: flex-start;
  }
  .ticks .ico {
    flex: none;
    margin-top: 2px;
    color: var(--action-line);
  }
  .callout {
    margin-top: var(--s6);
    max-width: 34rem;
    padding: var(--s4) var(--s5);
    border-left: 4px solid var(--action-line);
    background: var(--raised);
    border-radius: 0 var(--r-m) var(--r-m) 0;
  }
  .callout h3 {
    font-size: var(--t-body);
    font-weight: 600;
  }
  .callout p {
    margin-top: var(--s1);
    color: var(--ink-2);
  }
  .feature-art {
    display: flex;
    justify-content: center;
  }
  .feature-art .phone {
    max-width: 280px;
  }

  /* ---------- privacy ---------- */
  .privacy {
    margin-top: calc(var(--s7) * 1.6);
    padding-block: calc(var(--s7) * 1.4);
    background: var(--sunken);
  }
  .privacy-head .lead {
    font-size: 1.25rem;
  }
  .privacy-head h2 {
    max-width: 22ch;
  }
  .tiers {
    display: grid;
    gap: var(--s5);
    margin-top: var(--s7);
  }
  .tier {
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-l);
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  .tier-map svg {
    width: 100%;
    height: auto;
    border-bottom: 1px solid var(--line);
  }
  .tier h3 {
    padding: var(--s4) var(--s5) 0;
    font-size: var(--t-title);
  }
  .tier p {
    padding: var(--s2) var(--s5) var(--s5);
    color: var(--ink-2);
  }
  .m-land {
    fill: var(--land);
  }
  .m-water {
    fill: var(--water);
  }
  .m-road {
    fill: none;
    stroke: var(--line);
    stroke-width: 5;
    stroke-linecap: round;
  }
  .m-pin-halo {
    fill: color-mix(in srgb, var(--action) 30%, transparent);
  }
  .m-pin {
    fill: var(--action-line);
  }
  .m-pin-dot {
    fill: var(--raised);
  }
  .m-area {
    fill: color-mix(in srgb, var(--action) 26%, transparent);
    stroke: var(--action-line);
    stroke-width: 2.5;
    stroke-dasharray: 7 6;
  }
  .m-none {
    fill: none;
    stroke: var(--ink-3);
    stroke-width: 2.5;
    stroke-dasharray: 3 5;
    stroke-linecap: round;
  }
  .m-slash {
    stroke: var(--ink-2);
    stroke-width: 3;
    stroke-linecap: round;
  }
  .rules {
    margin-top: var(--s7);
    padding-top: var(--s5);
    border-top: 1px solid var(--line-strong);
    max-width: 44rem;
  }
  .rules h3 {
    font-size: var(--t-sub);
  }
  .textlink {
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
    margin-top: var(--s3);
    font-weight: 600;
    color: var(--link);
    text-underline-offset: 4px;
  }

  /* ---------- club ---------- */
  .club {
    padding-block: calc(var(--s7) * 1.6) 0;
  }
  .club-head {
    display: grid;
    gap: var(--s6);
    align-items: center;
  }
  .club .cta-row {
    margin-top: var(--s5);
  }
  .small {
    margin-top: var(--s4);
    max-width: 34rem;
    font-size: var(--t-bodys);
    color: var(--ink-3);
  }
  .club-art {
    display: flex;
    justify-content: center;
  }
  .club-art {
    align-self: end;
  }
  .club-art .phone {
    max-width: 280px;
    max-height: 470px;
    border-bottom: 0;
    border-radius: 38px 38px 0 0;
  }
  .club-items {
    display: grid;
    margin-top: var(--s7);
    border-top: 1px solid var(--line-strong);
  }
  .club-item {
    padding-block: var(--s4);
    border-bottom: 1px solid var(--line);
  }
  .club-item dt {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--t-sub);
    letter-spacing: -0.01em;
  }
  .club-item dd {
    margin-top: var(--s1);
    color: var(--ink-2);
    max-width: 38rem;
  }
  .club-note {
    margin-top: var(--s5);
    padding: var(--s4) var(--s5);
    border-radius: var(--r-m);
    background: var(--action-soft);
    max-width: 44rem;
    font-weight: 500;
  }

  /* ---------- faq ---------- */
  .faq {
    padding-block: calc(var(--s7) * 1.6) 0;
  }
  .faq-grid {
    display: grid;
    gap: var(--s5);
  }
  details {
    border-top: 1px solid var(--line-strong);
  }
  details:last-child {
    border-bottom: 1px solid var(--line-strong);
  }
  summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    min-height: 56px;
    padding-block: var(--s3);
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.0625rem;
    line-height: 1.35;
    list-style: none;
  }
  summary::-webkit-details-marker {
    display: none;
  }
  summary::after {
    content: '';
    flex: none;
    width: 12px;
    height: 12px;
    border-right: 2.5px solid var(--ink-2);
    border-bottom: 2.5px solid var(--ink-2);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.26s var(--ease);
  }
  details[open] summary::after {
    transform: rotate(-135deg) translate(-2px, -2px);
  }
  details p {
    padding-bottom: var(--s5);
    max-width: 40rem;
    color: var(--ink-2);
  }
  @media (prefers-reduced-motion: reduce) {
    summary::after {
      transition: none;
    }
  }

  /* ---------- final CTA + footer ---------- */
  .final {
    margin-top: calc(var(--s7) * 1.6);
    padding-block: calc(var(--s7) * 1.4);
    background: var(--raised);
    border-top: 1px solid var(--line);
    position: relative;
  }
  .final .cta-row {
    margin-top: var(--s5);
  }
  .final::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 34px;
    background-image:
      linear-gradient(to right, var(--ruler-ink) 0 1.5px, transparent 1.5px),
      linear-gradient(to right, var(--ruler-ink) 0 1px, transparent 1px),
      linear-gradient(to right, var(--ruler-ink) 0 1px, transparent 1px);
    background-size: 100px 34px, 50px 22px, 10px 11px;
    background-position: left top;
    background-repeat: repeat-x;
    transform: scaleY(-1);
    opacity: 0.5;
  }
  footer.site {
    padding-block: var(--s7) var(--s6);
    background: var(--ground);
    border-top: 1px solid var(--line);
  }
  .foot {
    display: grid;
    gap: var(--s5);
    font-size: var(--t-bodys);
    color: var(--ink-2);
  }
  .foot-brand img {
    height: 31px;
    width: auto;
    margin-bottom: var(--s3);
  }
  .foot-brand .tag {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
  }
  .legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--s5);
  }
  .legal a,
  .foot-langs a {
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
    color: var(--ink-2);
  }
  .foot-langs {
    margin-left: 0;
  }
  .foot-langs a {
    font-weight: 500;
    padding-inline: 0;
    margin-right: var(--s4);
    justify-content: flex-start;
  }

  /* ---------- wider screens ---------- */
  @media (min-width: 720px) {
    .ruler {
      --u: 8px;
      height: 148px;
    }
    .ruler-reading .num {
      font-size: 3.5rem;
    }
    .ruler-labels span {
      bottom: 46px;
      font-size: 0.75rem;
    }
    .tiers {
      grid-template-columns: repeat(3, 1fr);
    }
    .club-items {
      grid-template-columns: repeat(2, 1fr);
      column-gap: var(--s7);
    }
    .faq-grid {
      grid-template-columns: 1fr 2fr;
      gap: var(--s7);
    }
    .bar-cta {
      display: inline-flex;
    }
    .foot {
      grid-template-columns: 1.4fr 1fr;
      align-items: start;
    }
    .credits,
    .foot-langs {
      grid-column: 1;
    }
    .legal {
      grid-column: 2;
      grid-row: 1;
      justify-content: flex-end;
    }
  }
  @media (min-width: 960px) {
    .primary {
      display: flex;
    }
    .ruler {
      --u: 10px;
      height: 164px;
    }
    .ruler-reading .num {
      font-size: 4.25rem;
    }
    .ruler-reading .unit {
      font-size: 1.5rem;
    }
    .ruler-labels span {
      bottom: 50px;
      font-size: 0.8125rem;
    }
    .hero {
      padding-top: calc(var(--s7) * 1.4);
    }
    .hero-grid {
      grid-template-columns: 1.25fr 1fr;
      align-items: end;
      gap: var(--s7);
    }
    .hero-art {
      height: 540px;
      width: 320px;
      justify-self: end;
      margin-right: var(--s6);
    }
    .hero-art .phone {
      max-width: 320px;
    }
    .feature {
      padding-block: calc(var(--s7) * 1.6) 0;
    }
    .feature-grid {
      grid-template-columns: 1.1fr 1fr;
      gap: calc(var(--s7) * 1.5);
    }
    .feature.rev .feature-copy {
      order: 2;
    }
    .feature-art {
      justify-content: center;
    }
    .feature.rev .feature-grid {
      grid-template-columns: 1fr 1.1fr;
    }
    .club-head {
      grid-template-columns: 1.3fr 1fr;
      gap: calc(var(--s7) * 1.5);
    }
    .club-items {
      grid-template-columns: repeat(3, 1fr);
    }
    .final h2 {
      max-width: 18ch;
    }
    .rules {
      display: grid;
      grid-template-columns: 1fr 2fr;
      gap: var(--s6);
      max-width: none;
    }
    .rules .ticks {
      margin-top: 0;
      max-width: 40rem;
    }
    .rules > p {
      grid-column: 2;
    }
    .rules .textlink {
      margin-top: 0;
    }
  }
}
