/* ==========================================================================
   tokens.css
   Every colour, size, shape and timing on liamoliver.dev lives here.
   The other stylesheets only ever read these variables, so a change made
   here changes the whole site.
   ========================================================================== */

:root {
  /* ------------------------------------------------------------------------
     Colour
     A violet night, starlight for text, and copper for anything you can
     press. Copper is the metal inside every cable: the electrons in the
     logo travel through it.
     ------------------------------------------------------------------------ */
  --color-night: #120a26;          /* the sky behind the card */
  --color-night-deep: #07040f;     /* the edges of the sky, and text on copper */
  --color-night-raised: #1d1238;   /* the card when glass is switched off */
  --color-nebula: #4a2390;         /* the violet glow behind the card */
  --color-orchid: #7a3aaa;         /* a second, softer glow */
  --color-lavender: #c9bdf2;       /* quiet text and fine lines */
  --color-starlight: #f7f3ff;      /* main text */
  --color-copper: #f0aa7d;
  --color-copper-light: #ffdcc2;
  --color-copper-deep: #c8774a;

  /* Copper as a metal: light catches the top left edge */
  --copper-sheen: linear-gradient(
    135deg,
    var(--color-copper-light) 0%,
    var(--color-copper) 48%,
    var(--color-copper-deep) 100%
  );

  /* Light in the sky: the same colours, partly see-through */
  --glow-nebula: rgb(74 35 144 / 0.6);
  --glow-orchid: rgb(122 58 170 / 0.26);
  --glow-copper: rgb(240 170 125 / 0.09);
  --sky-edge: rgb(7 4 15 / 0.9);
  --star-bright: rgb(247 243 255 / 0.9);
  --star-dim: rgb(247 243 255 / 0.5);
  --star-lavender: rgb(201 189 242 / 0.8);
  --star-copper: rgb(240 170 125 / 0.7);
  --copper-glow: rgb(240 170 125 / 0.45); /* the light under the copper button */

  /* ------------------------------------------------------------------------
     Glass (the card)
     ------------------------------------------------------------------------ */
  --glass-fill: rgb(247 243 255 / 0.055);
  --glass-fill-hover: rgb(247 243 255 / 0.1);
  --glass-edge: rgb(247 243 255 / 0.14);
  --glass-edge-strong: rgb(247 243 255 / 0.3);
  --glass-highlight: rgb(247 243 255 / 0.1);
  --glass-blur: 22px;
  --glass-fallback: rgb(29 18 56 / 0.94); /* used where blur isn't supported */
  --card-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 48px 96px -40px rgb(4 2 10 / 0.85);

  /* ------------------------------------------------------------------------
     Type
     Cormorant Garamond carries the greeting and the name. Everything else
     uses the phone's own sans serif, so it loads instantly.
     ------------------------------------------------------------------------ */
  --font-display: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --weight-display: 600;
  --weight-body: 400;
  --weight-button: 600;

  --text-small: 0.9375rem;                                     /* 15px */
  --text-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);     /* 17–19px */
  --text-display: clamp(2.75rem, 1.9rem + 4.2vw, 4.25rem);     /* 44–68px, by screen */
  /* Inside the card the title is sized by the card itself: "I’m Liam
     Oliver" is 6.1em wide, so 15.4% of the card's width keeps the name on
     one line at 94% of the space on any phone. */
  --text-display-card: clamp(2rem, 15.4cqi, 4.25rem);
  --text-notice-card: clamp(1.75rem, 10.5cqi, 3rem);
  --text-display-short: clamp(2rem, 11svh, 3rem);             /* landscape phones */

  --leading-display: 1.05;
  /* Each greeting gets a slot 1.2em tall: measured from the font, that holds
     the highest accent (á) and the deepest tails (j, р) without either one
     reaching into the next word's slot. */
  --roller-slot: 1.2;
  --leading-body: 1.55;
  --tracking-display: -0.012em;
  --measure: 34ch;         /* longest line of body text */

  /* ------------------------------------------------------------------------
     Space (a 4px grid)
     ------------------------------------------------------------------------ */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.75rem;
  --space-8: 4rem;

  /* ------------------------------------------------------------------------
     Shape
     The card has the proportions of a UK business card: 85 × 55 mm.
     Landscape on wide screens, portrait on phones.
     ------------------------------------------------------------------------ */
  --card-ratio-landscape: 85 / 55;
  --card-ratio-portrait: 55 / 85;
  --card-width-portrait: 24rem;
  --card-width-landscape: 44rem;
  --radius-card: 1.375rem;
  --radius-control: 0.75rem;
  --control-height: 3rem; /* 48px: a comfortable thumb target */
  --mark-size: 2.75rem;

  /* ------------------------------------------------------------------------
     Motion
     One moment only: the greeting rolls through languages once and stops.
     ------------------------------------------------------------------------ */
  --roll-duration: 2.6s;
  --roll-delay: 0.45s;
  --roll-easing: cubic-bezier(0.22, 0.61, 0.24, 1);
  --press-duration: 160ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* ------------------------------------------------------------------------
     Focus
     ------------------------------------------------------------------------ */
  --focus-ring: 2px solid var(--color-copper);
  --focus-offset: 3px;
}
