/* ==========================================================================
   Design tokens
   The only file where raw values (colours, pixel sizes, durations) live.
   Every other stylesheet uses var(--token). Change a value here and the
   whole site follows. Rendered live at /design (dev and previews only).

   Colours
   - Defined in OKLCH (lightness, chroma, hue): equal lightness looks equally
     bright, so the accents carry the same weight and contrast is predictable.
   - Each colour holds its light and dark value: light-dark(light, dark).
     The page follows the visitor's system setting; the theme toggle sets
     data-theme="light" or "dark" on <html> to override it.
   - Accent colours (iris, sky, coral, mint) are for large text, figures and
     icons. Body-size text uses --color-text or --color-text-muted.
   - Contrast (checked): text 15:1, muted text 6:1 or more, white on the
     primary button 5:1 or more, accents 4.3:1 or more, in both themes.

   Breakpoints can't be custom properties. Use exactly these three:
     sm  40rem (640px)    md  48rem (768px)    lg  64rem (1024px)
   ========================================================================== */

/* Layer order for the whole site. Later layers win, whatever the specificity. */
@layer tokens, base, components, layout, sections, pages, print;

@layer tokens {
  :root {
    color-scheme: light dark;

    /* ------------------------------------------------------ Constants */
    --white: oklch(1 0 0);
    --black: oklch(0 0 0);

    /* ------------------------------------------------------ Colour roles */
    --color-page: light-dark(oklch(0.975 0.012 280), oklch(0.16 0.03 278));
    --color-surface: light-dark(oklch(1 0 0), oklch(0.205 0.035 278));
    --color-surface-tint: light-dark(oklch(0.985 0.006 280), oklch(0.18 0.032 278));
    --color-surface-tint-warm: light-dark(oklch(0.975 0.012 20), oklch(0.19 0.03 330));
    --color-surface-soft: light-dark(oklch(0.95 0.021 280), oklch(0.27 0.045 278));

    --color-text: light-dark(oklch(0.24 0.05 272), oklch(0.95 0.01 280));
    --color-text-muted: light-dark(oklch(0.47 0.04 272), oklch(0.75 0.03 280));
    --color-line: light-dark(oklch(0.915 0.022 280), oklch(0.29 0.04 278));

    --color-action: light-dark(oklch(0.54 0.22 277), oklch(0.56 0.21 277));
    --color-action-hover: light-dark(oklch(0.49 0.22 277), oklch(0.61 0.2 277));
    --color-action-badge: light-dark(oklch(0.44 0.2 277), oklch(0.46 0.2 277));
    --color-on-action: var(--white);
    --color-focus: color-mix(in oklch, var(--color-action) 70%, transparent);
    --color-scrim: light-dark(oklch(0.24 0.05 272 / 0.3), oklch(0.08 0.02 278 / 0.6)); /* behind the phone menu */

    --color-success: light-dark(oklch(0.52 0.13 150), oklch(0.76 0.15 150));
    --color-success-soft: light-dark(oklch(0.95 0.035 150), oklch(0.3 0.06 150));

    /* Night: the dark sections (featured project, contact). Dark in both themes. */
    --color-night: light-dark(oklch(0.21 0.06 277), oklch(0.125 0.035 278));
    --color-on-night: oklch(0.96 0.01 280);
    --color-on-night-muted: oklch(0.76 0.035 280);
    --color-on-night-strong: var(--white);
    --color-success-on-night: oklch(0.8 0.15 150);

    /* Accents: heading words, icon tiles, figures. Each has a -soft tint. */
    --accent-iris: light-dark(oklch(0.52 0.23 280), oklch(0.76 0.125 282));
    --accent-iris-soft: light-dark(oklch(0.95 0.024 280), oklch(0.3 0.07 280));
    --accent-iris-on-night: oklch(0.78 0.115 285);
    --accent-sky: light-dark(oklch(0.57 0.115 235), oklch(0.79 0.11 232));
    --accent-sky-soft: light-dark(oklch(0.95 0.025 235), oklch(0.3 0.05 235));
    --accent-coral: light-dark(oklch(0.6 0.19 28), oklch(0.76 0.14 30));
    --accent-coral-soft: light-dark(oklch(0.95 0.025 28), oklch(0.3 0.06 28));
    --accent-mint: light-dark(oklch(0.56 0.105 165), oklch(0.8 0.12 165));
    --accent-mint-soft: light-dark(oklch(0.95 0.03 165), oklch(0.3 0.05 165));

    /* Glass: translucent surfaces over the page, and over night sections. */
    --glass-edge: light-dark(oklch(1 0 0 / 0.9), oklch(1 0 0 / 0.08));
    --glass-fill: light-dark(oklch(1 0 0 / 0.82), oklch(0.205 0.035 278 / 0.78));
    --glass-fill-faint: light-dark(oklch(1 0 0 / 0.4), oklch(0.25 0.04 278 / 0.35));
    --glass-hover: light-dark(oklch(1 0 0 / 0.6), oklch(1 0 0 / 0.06));
    --glass-night-fill: oklch(1 0 0 / 0.06);
    --glass-night-fill-hover: oklch(1 0 0 / 0.12);
    --glass-night-line: oklch(1 0 0 / 0.16);
    --glass-night-line-hover: oklch(1 0 0 / 0.3);
    --glass-night-divider: oklch(1 0 0 / 0.12);

    /* ------------------------------------------------------ Typography */
    --font-body: var(--font-sans), ui-sans-serif, system-ui, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; /* code samples only */
    --weight-regular: 400;
    --weight-bold: 700;

    --text-xs: 0.82rem; /* labels, tags, eyebrows */
    --text-sm: 0.93rem; /* secondary text, chips, nav */
    --text-md: 1rem; /* buttons, dense body */
    --text-base: 1.0625rem; /* body */
    --text-lead: clamp(1.08rem, 1rem + 0.35vw, 1.25rem); /* intro paragraphs */
    --text-title: 1.15rem; /* card and row titles */
    --text-heading-sm: clamp(1.45rem, 1.15rem + 0.9vw, 2rem); /* card headings */
    --text-heading-md: clamp(1.7rem, 1.2rem + 1.6vw, 2.6rem); /* featured card heading */
    --text-heading: clamp(2.2rem, 1.3rem + 3vw, 3.6rem); /* section h2 */
    --text-display: clamp(2.2rem, 1.1rem + 4.6vw, 4.7rem); /* hero h1 */
    --text-stat: clamp(1.7rem, 1.3rem + 1.2vw, 2.1rem); /* numbers */

    --leading-display: 1.02;
    --leading-heading: 1.08;
    --leading-title: 1.3;
    --leading-compact: 1.42;
    --leading-body: 1.6;

    --tracking-display: -0.025em; /* awork, measured */
    --tracking-title: -0.015em;

    /* ------------------------------------------------------ Space (4px steps, then larger) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-7: 2rem;
    --space-8: 2.5rem;
    --space-9: 3rem;
    --space-10: 3.5rem;
    --space-11: 4rem;
    --space-section: clamp(4rem, 8vw, 6.5rem); /* top padding of a section sheet */
    --space-section-end: clamp(5rem, 9vw, 7.5rem); /* bottom padding, room for the next sheet's curve */
    --space-card: clamp(1.5rem, 3vw, 2.2rem); /* padding of large cards */

    /* ------------------------------------------------------ Shape */
    --radius-sm: 10px;
    --radius-tile: 14px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-sheet: 48px;
    --radius-pill: 999px;

    --border-width: 1px;
    --border: var(--border-width) solid var(--color-line);

    /* ------------------------------------------------------ Elevation */
    --shadow-ink: light-dark(oklch(0.24 0.05 272), var(--black));
    --shadow-color: light-dark(oklch(0.38 0.17 280), var(--black));
    --shadow-sm:
      0 1px 2px color-mix(in oklch, var(--shadow-ink) 5%, transparent),
      0 8px 24px -14px color-mix(in oklch, var(--shadow-color) 24%, transparent);
    --shadow-md:
      0 2px 6px color-mix(in oklch, var(--shadow-ink) 5%, transparent),
      0 22px 50px -24px color-mix(in oklch, var(--shadow-color) 34%, transparent);
    --shadow-lg: 0 40px 90px -40px color-mix(in oklch, var(--color-action) 45%, transparent);
    --shadow-sheet: 0 -18px 40px -32px color-mix(in oklch, var(--shadow-color) 36%, transparent);
    --shadow-glow: 0 10px 28px -8px color-mix(in oklch, var(--color-action) 60%, transparent);
    --shadow-glow-hover: 0 14px 34px -8px color-mix(in oklch, var(--color-action) 70%, transparent);
    --shadow-glow-night: 0 40px 90px -40px color-mix(in oklch, var(--color-action) 50%, transparent);
    --inset-highlight: inset 0 1px 0 oklch(1 0 0 / 0.25);
    --inset-highlight-night: inset 0 1px 0 oklch(1 0 0 / 0.08);
    --blur-glass: 14px;
    --blur-scrim: 4px;

    /* Soft colour fields behind the hero and on night surfaces. */
    --glow-hero:
      radial-gradient(34% 40% at 20% 22%, color-mix(in oklch, var(--color-surface) 90%, transparent), transparent 70%),
      radial-gradient(30% 38% at 82% 18%, color-mix(in oklch, var(--accent-coral) 18%, transparent), transparent 72%),
      radial-gradient(40% 36% at 50% 62%, color-mix(in oklch, var(--color-action) 26%, transparent), transparent 72%),
      radial-gradient(30% 30% at 14% 78%, color-mix(in oklch, var(--accent-sky) 18%, transparent), transparent 72%);
    --glow-night:
      radial-gradient(45% 75% at 95% 0%, color-mix(in oklch, var(--color-action) 50%, transparent), transparent 72%),
      radial-gradient(35% 60% at 0% 100%, color-mix(in oklch, var(--accent-sky) 22%, transparent), transparent 72%);
    --glow-night-section:
      radial-gradient(40% 34% at 50% 0%, color-mix(in oklch, var(--color-action) 42%, transparent), transparent 72%),
      radial-gradient(30% 30% at 10% 60%, color-mix(in oklch, var(--accent-sky) 16%, transparent), transparent 72%);
    --gradient-tint: linear-gradient(
      180deg,
      var(--color-surface-tint),
      var(--color-surface-tint-warm) 70%,
      var(--color-surface-tint)
    );
    --gradient-brand: linear-gradient(135deg, var(--color-action), var(--color-action-badge));
    /* Behind the top bar: content fades out under it instead of showing between the chips. */
    --fade-topbar: linear-gradient(var(--color-page) 30%, color-mix(in oklch, var(--color-page) 75%, transparent) 60%, transparent);
    --gradient-glass-night: linear-gradient(160deg, oklch(1 0 0 / 0.07), oklch(1 0 0 / 0.02));

    /* ------------------------------------------------------ Motion */
    --duration-fast: 200ms;
    --duration-base: 250ms;
    --duration-pulse: 2.4s;
    --ease-standard: ease;
    --lift: translateY(-1px);
    --lift-card: translateY(-2px);

    /* ------------------------------------------------------ Layout */
    --frame: 72rem; /* page width */
    --frame-md: 50rem; /* timeline, CV */
    --frame-sm: 40rem; /* single-column lists */
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --size-mark: 2rem; /* logo mark in the top bar */
    --size-touch: 2.75rem; /* smallest tap target (44px) */
    --size-bar: 3.25rem; /* height of the top bar chips */
    --z-topbar: 20;
    --z-skip: 30;
  }

  /* Theme override from the toggle (stored per visitor). */
  :root[data-theme="light"] {
    color-scheme: light;
  }

  :root[data-theme="dark"] {
    color-scheme: dark;
  }
}

/* ==========================================================================
   tools.junaidahmed.dev
   The tokens above are copied unchanged from junaidahmed.dev
   (app/styles/tokens.css). The rules below are the subset of its base,
   components and layout layers this page uses, plus a small pages layer.
   Light and dark follow the system setting; there is no toggle here.
   ========================================================================== */

/* Outfit 400 and 700, self-hosted (OFL licence in fonts/). */
@font-face {
  font-family: "Outfit";
  src: url("/fonts/Outfit-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("/fonts/Outfit-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@layer tokens {
  :root {
    --font-sans: "Outfit"; /* set by next/font on the main site */
  }
}

/* ---------------------------------------------------------- Base */
@layer base {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    margin: 0;
    overflow-x: clip;
    background: var(--color-page);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  main {
    flex: 1;
  }

  h1,
  h2,
  p,
  ul {
    margin: 0;
  }

  h1,
  h2 {
    font-weight: var(--weight-bold);
    text-wrap: balance;
  }

  p,
  li {
    text-wrap: pretty;
  }

  a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
  }

  :focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
  }

  .frame {
    width: min(100% - 2 * var(--gutter), var(--frame));
    margin-inline: auto;
  }

  .accent-iris {
    color: var(--accent-iris);
  }

  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .skip {
    position: absolute;
    left: var(--space-4);
    top: -4rem;
    z-index: var(--z-skip);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-pill);
    background: var(--color-text);
    color: var(--white);
    font-weight: var(--weight-bold);
    text-decoration: none;
  }

  .skip:focus {
    top: var(--space-3);
  }
}

/* ---------------------------------------------------------- Components */
@layer components {
  .pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 3rem;
    padding: 0 var(--space-6);
    border: var(--border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    color: var(--color-text);
    font: var(--weight-bold) var(--text-md) / 1 var(--font-body);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition:
      background-color var(--duration-fast) var(--ease-standard),
      border-color var(--duration-fast) var(--ease-standard),
      transform var(--duration-fast) var(--ease-standard),
      box-shadow var(--duration-fast) var(--ease-standard);
  }

  .pill:hover {
    transform: var(--lift);
    box-shadow: var(--shadow-md);
  }

  .pill-primary {
    padding-left: 0.4rem;
    border-color: transparent;
    background: var(--color-action);
    box-shadow: var(--shadow-glow);
    color: var(--color-on-action);
  }

  .pill-primary:hover {
    background: var(--color-action-hover);
    box-shadow: var(--shadow-glow-hover);
  }

  .pill-badge {
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: var(--color-action-badge);
    box-shadow: var(--inset-highlight);
  }

  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-7);
  }

  .actions-center {
    justify-content: center;
  }

  .logo-node {
    fill: var(--accent-coral);
  }

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    padding: 0.32rem 0.85rem 0.32rem 0.6rem;
    border: var(--border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    color: var(--color-text);
    font-size: var(--text-xs);
  }

  .eyebrow-ring {
    width: 0.7rem;
    height: 0.7rem;
    border: 1.5px solid currentColor;
    border-radius: 50%;
  }

  .tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--accent-iris-soft);
    color: var(--accent-iris);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
  }

  .tile {
    display: grid;
    flex: none;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-tile);
    background: var(--accent-iris-soft);
    color: var(--accent-iris);
  }

  .tile-sky {
    background: var(--accent-sky-soft);
    color: var(--accent-sky);
  }

  .card {
    padding: var(--space-5) var(--space-6);
    border: var(--border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
  }

  .card-lg {
    padding: var(--space-card);
    border-radius: var(--radius-xl);
  }

  .card-flat {
    box-shadow: var(--shadow-sm);
  }

  .lift {
    transition:
      transform var(--duration-base) var(--ease-standard),
      box-shadow var(--duration-base) var(--ease-standard);
  }

  .lift:hover {
    transform: var(--lift-card);
  }
}

/* ---------------------------------------------------------- Layout */
@layer layout {
  .topbar {
    position: sticky;
    top: 0;
    z-index: var(--z-topbar);
    padding-block: var(--space-4);
    pointer-events: none;
  }

  .topbar::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 0 calc(-1 * var(--space-4));
    background: var(--fade-topbar);
  }

  .topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
  }

  .brand,
  .nav {
    min-height: var(--size-bar);
    pointer-events: auto;
    border: var(--border-width) solid var(--glass-edge);
    background: var(--glass-fill);
    box-shadow: var(--shadow-sm);
    -webkit-backdrop-filter: blur(var(--blur-glass));
    backdrop-filter: blur(var(--blur-glass));
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    padding: 0 var(--space-4) 0 0.55rem;
    border-radius: var(--radius-md);
    font-size: var(--text-title);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-title);
    text-decoration: none;
    white-space: nowrap;
  }

  .brand-mark {
    display: block;
    flex: none;
    width: var(--size-mark);
    height: var(--size-mark);
    color: var(--color-text);
  }

  .nav {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    padding: calc((var(--size-bar) - var(--size-touch)) / 2 - var(--border-width));
    border-radius: var(--radius-pill);
  }

  .nav > a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: var(--size-touch);
    padding: 0 0.85rem;
    border-radius: var(--radius-pill);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    text-decoration: none;
    transition:
      background-color var(--duration-fast) var(--ease-standard),
      color var(--duration-fast) var(--ease-standard);
  }

  .nav > a:hover {
    background: var(--color-surface-soft);
    color: var(--color-text);
  }

  .footer {
    padding-block: var(--space-8) var(--space-9);
    font-size: var(--text-sm);
  }

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

  .footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-2) var(--space-7);
  }
}

/* ---------------------------------------------------------- This page */
@layer pages {
  /* Page head: the hero glow and centred heading of the main site, smaller. */
  .page-head {
    position: relative;
    isolation: isolate;
    margin-top: -4.6rem; /* slide under the floating top bar */
    padding: 7rem 0 var(--space-9);
    text-align: center;
  }

  .page-head::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: var(--glow-hero);
    pointer-events: none;
  }

  .page-head-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .page-title {
    font-size: var(--text-display);
    line-height: var(--leading-display);
    letter-spacing: var(--tracking-display);
  }

  .page-intro {
    max-width: 38rem;
    margin-top: var(--space-5);
    color: var(--color-text-muted);
    font-size: var(--text-lead);
    line-height: 1.55;
  }

  .tools {
    display: grid;
    gap: var(--space-4);
    max-width: var(--frame-md);
    margin: 0 auto;
    padding: 0;
    list-style: none;
  }

  .tool {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    min-width: 0;
  }

  .tool h2 {
    font-size: var(--text-title);
    line-height: var(--leading-title);
    letter-spacing: var(--tracking-title);
  }

  .tool p {
    color: var(--color-text-muted);
    font-size: var(--text-md);
    line-height: 1.45;
  }

  .tool .tag {
    margin-top: auto;
  }

  .tool .pill {
    max-width: 100%;
  }

  /* The placeholder: same card, quieter, dashed edge. */
  .tool-soon {
    justify-content: center;
    align-items: center;
    min-height: 12rem;
    border-style: dashed;
    background: var(--color-surface-tint);
    box-shadow: none;
    color: var(--color-text-muted);
    text-align: center;
  }

  .tool-soon .tile {
    background: var(--color-surface-soft);
    color: var(--color-text-muted);
  }

  .tool-soon h2 {
    color: var(--color-text-muted);
  }

  @media (min-width: 48rem) {
    .tools {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
}
