/*
 * wah.css — the weareheavy design DNA.                                 v2.6.0
 *
 * Copied from heavyy/wah-skills (plugins/wah/skills/wah-design-language/css).
 * Don't edit this file in a project: when the studio changes it, the new copy
 * should drop straight in. A project's own choices (its signal colour, a
 * deviation it has written down) go in the project's stylesheet, after this
 * import.
 *
 * Needs the font at /fonts/PretendardStdVariable.woff2 (assets/fonts in the
 * skill). Works on its own in plain CSS; Tailwind and shadcn projects also
 * import wah-tailwind.css after it.
 *
 * Product is the default register. Set data-register="expression" on <html>
 * for a site. Dark mode is the .dark class on <html>, as shadcn expects.
 */

@font-face {
  font-family: "Pretendard Std Variable";
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/PretendardStdVariable.woff2") format("woff2-variations");
}

:root {
  /* The red thread. These are the same in every project; never override them. */
  /*
   * The palette: five neutrals, and that's all of them. Every grey and black
   * below is one of these in a role; hairlines are black at an opacity.
   */
  --wah-version: v2.6.0;
  --wah-black: #000;
  --wah-white: #fff;
  --wah-paper: #f2f1ec;
  --wah-ground: #e6e6e3;
  --wah-muted: #66635c;
  --wah-font: "Pretendard Std Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --wah-ease: cubic-bezier(.16, 1, .3, 1);
  --wah-ease-inout: cubic-bezier(.7, 0, .2, 1);

  /*
   * Product register, light: roles, each pointing at the palette. Hover
   * reuses them instead of adding greys: on a surface it goes to stage, on
   * the ground it goes to surface.
   */
  --ink: var(--wah-black);
  --ink-muted: var(--wah-muted);
  --ink-inverse: var(--wah-white);
  --ground: var(--wah-ground);
  --surface: var(--wah-white);
  --stage: var(--wah-paper);
  --line: rgb(0 0 0 / .09);
  --line-strong: rgb(0 0 0 / .16);
  /* Two status colours, set by hand. Danger's fill and edge are mixed from it below. */
  --danger: #b42318;
  --warn: #a15c07;
  --wah-shadow-pop: 0 12px 32px -8px rgba(0, 0, 0, .22), 0 2px 6px rgba(0, 0, 0, .06);

  /*
   * Charts: six colours in a fixed ring (cobalt, ember, pink, amber, violet,
   * mint), checked for colour blindness and 3:1 against the surface in both
   * modes. A product starts the ring at its signal's family (WAH OS at mint)
   * by setting --chart-1 to --chart-6 in its stylesheet; studio work starts at
   * cobalt. Status colours are never a series. See references/charts.md.
   */
  --wah-chart-cobalt: #2749c0;
  --wah-chart-ember: #f46623;
  --wah-chart-pink: #b0277d;
  --wah-chart-amber: #c28403;
  --wah-chart-violet: #795fe2;
  --wah-chart-mint: #09a764;
  /* Diverging, for over and under: cobalt below the midpoint, pink above. */
  --wah-chart-under-strong: #3e61c4;
  --wah-chart-under: #82a2f0;
  --wah-chart-mid: #e6e6e3;
  --wah-chart-over: #db85b3;
  --wah-chart-over-strong: #a9337c;

  /* Six sizes and nothing between them: four for working text, two for titles. */
  --wah-text-2xs: 10px;
  --wah-text-xs: 12px;
  --wah-text-sm: 14px;
  --wah-text-base: 16px;
  --wah-text-heading: 20px;
  --wah-text-title: 30px;
  --wah-text-body: var(--wah-text-sm);
  --wah-weight-body: 400;

  /*
   * Each size brings its line height and tracking, so text sits on a 2px
   * rhythm (14/20, 16/24, 20/26, 30/36) without anyone choosing a leading.
   * Tracking tightens only from the heading up; UI text keeps the face's own.
   * Display is Expression's statement size and the only fluid one.
   */
  --wah-leading-2xs: 1.4;
  --wah-leading-xs: 1.3333;
  --wah-leading-sm: 1.4286;
  --wah-leading-base: 1.5;
  --wah-leading-heading: 1.3;
  --wah-leading-title: 1.2;
  --wah-tracking-heading: -.01em;
  --wah-tracking-title: -.02em;
  --wah-text-display: clamp(1.75rem, 1rem + 2.6vw, 3.25rem);
  --wah-leading-display: 1.18;
  --wah-tracking-display: -.025em;
  --wah-leading-body: var(--wah-leading-sm);

  /* Icons are Phosphor, regular weight: 16px in controls and rows, 20px alone in a header or empty state. */
  --wah-icon: 16px;
  --wah-icon-lg: 20px;

  /*
   * Two corners and a pill. Buttons, chips and tags are pills in every
   * register; 8px is for what you type in or pick from (inputs, menu items),
   * 16px for what holds things. Something nested inside a rounded thing takes the outer
   * radius minus its padding, so corners stay concentric without a new token.
   */
  --wah-radius-control: 8px;
  --wah-radius-panel: 16px;
  --wah-radius-pill: 999px;

  /*
   * Space comes in Tailwind's 4px steps, and only these: 4, 8, 12, 16, 24, 32,
   * 48, 64. The 10px shell gap is the one deliberate exception.
   */
  --wah-space-1: 4px;
  --wah-space-2: 8px;
  --wah-space-3: 12px;
  --wah-space-4: 16px;
  --wah-space-6: 24px;
  --wah-space-8: 32px;
  --wah-space-12: 48px;
  --wah-space-16: 64px;
  --wah-gap: 10px;
  --wah-page-pad: clamp(20px, 4vw, 40px);
  --wah-control-h: 32px;
  --wah-control-h-lg: 44px;
  --wah-header-h: 56px;

  /*
   * Breakpoints, for reference and for scripts: custom properties can't sit in
   * a media query, so CSS writes the number (@media (width >= 768px)) and
   * Tailwind gets them as sm/md/lg/xl from wah-tailwind.css. sm, md and lg are
   * Tailwind's own, because shadcn's components switch on them (an app's
   * sidebar becomes a sheet below md). xl is the Expression container: past
   * it the page stops widening and the margins grow.
   */
  --wah-bp-sm: 640px;
  --wah-bp-md: 768px;
  --wah-bp-lg: 1024px;
  --wah-bp-xl: 1340px;
  --wah-container: 1340px;
  --wah-dur-state: 150ms;
  --wah-dur-tooltip: 120ms;
  --wah-dur-enter: 220ms;
  --wah-dur-sheet: 300ms;
}

/*
 * The project's one signal colour: selection, focus, the active thing. It
 * falls back to ink so a project without a choice still looks finished, and
 * so picking one is a decision rather than a default. Declared on each element
 * that changes the palette, so a nested .dark re-resolves it. A project sets
 * its own in its stylesheet, on the same selectors.
 */
:root,
.dark,
[data-register],
[data-pair] {
  --signal: var(--ink);
  --signal-ink: var(--surface);
  --danger-bg: color-mix(in srgb, var(--danger) 9%, var(--surface));
  --danger-line: color-mix(in srgb, var(--danger) 40%, var(--surface));
  --chart-1: var(--wah-chart-cobalt);
  --chart-2: var(--wah-chart-ember);
  --chart-3: var(--wah-chart-pink);
  --chart-4: var(--wah-chart-amber);
  --chart-5: var(--wah-chart-violet);
  --chart-6: var(--wah-chart-mint);
}

.dark {
  /* Dark: the same five roles on their own five values. */
  --ink: #f2f2f0;
  --ink-muted: #9a9a94;
  --ink-inverse: #17191b;
  --ground: #17191b;
  --surface: #212325;
  --stage: #2a2c2f;
  --line: rgb(255 255 255 / .11);
  --line-strong: rgb(255 255 255 / .2);
  --danger: #f7a8a0;
  --warn: #f2c14e;
  --wah-shadow-pop: 0 12px 32px -8px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);
  --wah-chart-cobalt: #4b76f0;
  --wah-chart-ember: #dd5404;
  --wah-chart-pink: #bd3689;
  --wah-chart-amber: #b27901;
  --wah-chart-violet: #795fe2;
  --wah-chart-mint: #03ae69;
  --wah-chart-under-strong: #7ba0ff;
  --wah-chart-under: #415ead;
  --wah-chart-mid: #3a3c3f;
  --wah-chart-over: #963f71;
  --wah-chart-over-strong: #e77bb7;
}

/*
 * Expression register: sites, showcases, pitches. A black stage that ends on
 * paper, bigger type, slower entrances, pills for buttons. --reveal (0 to 1,
 * written by scroll) blends the page from black to paper; never hard-switch.
 */
[data-register="expression"] {
  --ink: var(--wah-white);
  --ink-muted: #7c7c7c;
  --ink-inverse: var(--wah-black);
  --ground: var(--wah-black);
  --surface: #161616;
  --stage: #232325;
  --line: rgb(255 255 255 / .11);
  --line-strong: rgb(255 255 255 / .2);
  --signal-ink: var(--wah-black);

  --page-bg: color-mix(in srgb, var(--wah-paper) calc(var(--reveal, 0) * 100%), var(--ground));
  --page-ink: color-mix(in srgb, var(--wah-black) calc(var(--reveal, 0) * 100%), var(--ink));
  /* Muted on paper is the palette's muted; Labs' #adadad read too pale for body text. */
  --page-muted: color-mix(in srgb, var(--wah-muted) calc(var(--reveal, 0) * 100%), var(--ink-muted));

  --wah-text-body: clamp(.8125rem, .75rem + .25vw, .9375rem);
  --wah-text-lead: 1.25rem;
  --wah-text-head: clamp(1.375rem, 1rem + 1.2vw, 2.125rem);
  --wah-text-display: clamp(1.75rem, 1rem + 2.6vw, 3.25rem);

  --wah-radius-panel: 20px;
  --wah-radius-sheet: 32px;
  --wah-dur-enter: .7s;
}

/*
 * Colour pairings: eight light-and-dark pairs, each usable either way round, so
 * sixteen themes. Set data-pair on <html> for a whole page or on any section.
 * A pairing is two colours; every role is derived from them, so a page in a
 * pairing needs nothing else. Every pair passes WCAG AA, most AAA. The light
 * colours are Labs' auras, Labs' paper, WAH OS's green and Presswork's orange;
 * the dark partners were drawn for them.
 */
[data-pair="paper-ink"] { --pair-bg: #f2f1ec; --pair-fg: #000000; }
[data-pair="ink-paper"] { --pair-bg: #000000; --pair-fg: #f2f1ec; }
[data-pair="lime-forest"] { --pair-bg: #7cff6b; --pair-fg: #0f3a14; }
[data-pair="forest-lime"] { --pair-bg: #0f3a14; --pair-fg: #7cff6b; }
[data-pair="cyan-deepsea"] { --pair-bg: #6be9ff; --pair-fg: #062f3a; }
[data-pair="deepsea-cyan"] { --pair-bg: #062f3a; --pair-fg: #6be9ff; }
[data-pair="amber-cobalt"] { --pair-bg: #ffc46b; --pair-fg: #1f3fd1; }
[data-pair="cobalt-amber"] { --pair-bg: #1f3fd1; --pair-fg: #ffc46b; }
[data-pair="pink-plum"] { --pair-bg: #ff6bc1; --pair-fg: #3a0a28; }
[data-pair="plum-pink"] { --pair-bg: #3a0a28; --pair-fg: #ff6bc1; }
[data-pair="violet-night"] { --pair-bg: #b58bff; --pair-fg: #1a0c3d; }
[data-pair="night-violet"] { --pair-bg: #1a0c3d; --pair-fg: #b58bff; }
[data-pair="mint-pine"] { --pair-bg: #00b26b; --pair-fg: #032b1a; }
[data-pair="pine-mint"] { --pair-bg: #032b1a; --pair-fg: #00b26b; }
[data-pair="ember-char"] { --pair-bg: #fd753b; --pair-fg: #2a0f04; }
[data-pair="char-ember"] { --pair-bg: #2a0f04; --pair-fg: #fd753b; }

[data-pair] {
  --ink: var(--pair-fg);
  --ink-muted: color-mix(in srgb, var(--pair-fg) 64%, var(--pair-bg));
  --ink-inverse: var(--pair-bg);
  --ground: var(--pair-bg);
  --surface: var(--pair-bg);
  --stage: color-mix(in srgb, var(--pair-fg) 10%, var(--pair-bg));
  --line: color-mix(in srgb, var(--pair-fg) 14%, transparent);
  --line-strong: color-mix(in srgb, var(--pair-fg) 24%, transparent);
  --signal: var(--pair-fg);
  --signal-ink: var(--pair-bg);
  --page-bg: var(--pair-bg);
  --page-ink: var(--pair-fg);
  --page-muted: var(--ink-muted);
}

@layer base {
  html {
    font-family: var(--wah-font);
    font-weight: var(--wah-weight-body);
    font-size: 100%;
    color: var(--ink);
    background: var(--ground);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  [data-register="expression"] {
    color: var(--page-ink);
    background: var(--page-bg);
  }

  [data-pair] {
    color: var(--pair-fg);
    background: var(--pair-bg);
  }

  body {
    font-size: var(--wah-text-body);
    line-height: var(--wah-leading-body);
  }

  ::selection {
    background: var(--signal);
    color: var(--signal-ink);
  }

  :focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 2px;
  }

  table,
  time,
  [data-numeric] {
    font-variant-numeric: tabular-nums;
  }

  /* Reduced motion is static, not slower. */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 1ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 1ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/*
 * The button. One family in every app and every site: a pill, five variants,
 * two sizes. A border is drawn on every variant, filled ones too, so a row of
 * mixed buttons lines up to the pixel. [data-hover] shows the hover state on a
 * styleguide page without a pointer.
 */
@layer components {
  .wah-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--wah-space-2);
    height: var(--wah-control-h);
    padding-inline: var(--wah-space-4);
    border: 1px solid transparent;
    border-radius: var(--wah-radius-pill);
    font: inherit;
    font-size: var(--wah-text-sm);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: background-color var(--wah-dur-state) var(--wah-ease), border-color var(--wah-dur-state) var(--wah-ease),
                color var(--wah-dur-state) var(--wah-ease), filter var(--wah-dur-state) var(--wah-ease);
  }
  .wah-btn:disabled,
  .wah-btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }

  .wah-btn-lg { height: var(--wah-control-h-lg); padding-inline: var(--wah-space-6); font-size: var(--wah-text-base); }
  .wah-btn-icon { width: var(--wah-control-h); padding-inline: 0; }
  .wah-btn-lg.wah-btn-icon { width: var(--wah-control-h-lg); }
  .wah-btn svg { width: var(--wah-icon); height: var(--wah-icon); flex: none; }

  /*
   * On touch, a 32px button is hard to hit. The hit area grows to 44px tall
   * without the button growing, so working screens keep their density.
   */
  @media (pointer: coarse) {
    .wah-btn:not(.wah-btn-lg)::after { content: ""; position: absolute; inset: -6px 0; }
  }

  /* The action the screen exists for. */
  .wah-btn-primary { border-color: var(--ink); background: var(--ink); color: var(--ink-inverse); }
  /* An action available beside it. */
  .wah-btn-secondary { border-color: var(--stage); background: var(--stage); color: var(--ink); }
  /* The one thing most wanted, in the product's signal. */
  .wah-btn-accent { border-color: var(--signal); background: var(--signal); color: var(--signal-ink); }
  /* An offer that shouldn't carry weight. */
  .wah-btn-outline { border-color: var(--ink); background: transparent; color: var(--ink); }
  /* What destroys something; it can't borrow an ordinary button's clothes. */
  .wah-btn-danger { border-color: var(--danger-bg); background: var(--danger-bg); color: var(--danger); }

  .wah-btn-primary:not(:disabled)[data-hover] { background: color-mix(in srgb, var(--ink) 80%, transparent); border-color: transparent; }
  .wah-btn-secondary:not(:disabled)[data-hover] { background: var(--ground); border-color: var(--ground); }
  .wah-btn-accent:not(:disabled)[data-hover] { filter: brightness(.95); }
  .wah-btn-outline:not(:disabled)[data-hover] { background: var(--stage); }
  .wah-btn-danger:not(:disabled)[data-hover] { border-color: var(--danger-line); }

  /* Hover only where something can hover, so a tap doesn't leave a button lit. */
  @media (hover: hover) {
    .wah-btn-primary:not(:disabled):hover { background: color-mix(in srgb, var(--ink) 80%, transparent); border-color: transparent; }
    .wah-btn-secondary:not(:disabled):hover { background: var(--ground); border-color: var(--ground); }
    .wah-btn-accent:not(:disabled):hover { filter: brightness(.95); }
    .wah-btn-outline:not(:disabled):hover { background: var(--stage); }
    .wah-btn-danger:not(:disabled):hover { border-color: var(--danger-line); }
  }

  /*
   * A text link: the text's own colour, underlined in a hairline that turns
   * to ink on hover. Muted when it sits under muted body text.
   */
  .wah-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .22em;
    text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
    transition: text-decoration-color var(--wah-dur-state) var(--wah-ease), color var(--wah-dur-state) var(--wah-ease);
  }
  .wah-link[data-hover] { text-decoration-color: currentColor; }
  @media (hover: hover) {
    .wah-link:hover { text-decoration-color: currentColor; }
  }

  /* Tags and counts: small pills with a hairline, so they show on any ground. */
  .wah-tag {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: var(--wah-space-1);
    height: 22px;
    padding-inline: var(--wah-space-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--wah-radius-pill);
    font-size: var(--wah-text-xs);
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
  }
}
