/* ============================================
   froes.design — index.css
   Design tokens, reset, and all styles.
   Edit the :root variables below to tweak
   colors, spacing, typography, and rhythm.
   ============================================ */

/* --- FONTS --- */

@font-face {
  font-family: "Geist Sans";
  src: url("/fonts/geist-sans/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- CUSTOM PROPERTIES --- */

:root {
  /* Spacing — 8pt grid
     Multiply the number by 8 to get px value.
     --space-1 = 8px, --space-2 = 16px, etc. */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 2.5rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-10: 5rem;
  --space-12: 6rem;
  --space-16: 8rem;

  /* Vertical rhythm
     Built on a 27px baseline (--text-base 18px * --leading-base 1.5).
     Use rhythm tokens for all vertical spacing to keep
     the page harmonically aligned. */
  --baseline: 1.6875rem;
  --rhythm-half: 0.844rem;
  --rhythm-1: 1.6875rem;
  --rhythm-2: 3.375rem;
  --rhythm-3: 5.0625rem;
  --rhythm-4: 6.75rem;
  --rhythm-6: 10.125rem;
  --rhythm-8: 13.5rem;

  /* Typography — Font families */
  --font-sans: "Geist Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", monospace;

  /* Typography — Modular scale
     Ratio:  φ (golden ratio) = 1.618
     Base:   18px = 1.125rem
     Step -1:  18 ÷ φ   ≈ 11px
     Step  0:  18        = 18px
     Step +1:  18 × φ    ≈ 29px
     Step +2:  18 × φ²   ≈ 47px
     Step +3:  18 × φ³   ≈ 76px
     Step +4:  18 × φ⁴   ≈ 123px */
  --type-ratio: 1.618;
  --text-sm: 0.695rem;
  --text-base: 1.125rem;
  --text-lg: 1.82rem;
  --text-xl: 2.944rem;
  --text-2xl: 4.763rem;
  --text-3xl: 7.705rem;

  /* Typography — Font weights */
  --weight-normal: 400;
  --weight-medium: 500;

  /* Typography — Line heights (rhythm-aligned) */
  --leading-tight: 1.25;
  --leading-base: 1.5;
  --leading-loose: 1.75;

  /* Typography — Letter spacing */
  --tracking-tighter: -0.03em;
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.05em;

  /* Colors — white, black, light grey only */
  --color-black: #000000;
  --color-white: #ffffff;
  --color-grey: #e0e0e0;

  /* Semantic color aliases */
  --color-bg: var(--color-white);
  --color-text: var(--color-black);
  --color-subtle: var(--color-grey);

  /* Layout */
  --max-width: 120rem;
  --gutter: var(--space-3);
  --gutter-desktop: var(--space-6);

  /* Two-column text layout — text sits in the 2nd column */
  --col-split: 1fr 1fr;
}

/* --- RESET --- */

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul,
ol {
  list-style: none;
}

/* --- BASE --- */

*,
*::before,
*::after {
  text-box-trim: trim-both;
  text-box-edge: cap alphabetic;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  font-feature-settings: 'ss03' on, 'ss06' on, 'ss08' on;
  line-height: var(--leading-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- SITE HEADER (sticky) --- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-block-start: var(--rhythm-1);
  padding-inline: var(--gutter);
}

.site-name {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tight);
}

/* --- MAIN --- */

main {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block-end: var(--rhythm-4);
}

/* --- INTRO --- */

.intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-block-start: var(--rhythm-1);
  margin-block-end: var(--rhythm-3);
}

.intro__text {
  font-size: var(--text-lg);
  line-height: var(--leading-base);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tighter);
}

.intro__links {
  display: flex;
  gap: var(--space-3);
}

.intro__link {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tight);
}

/* --- WORK LIST (homepage) --- */

.work-list {
  display: flex;
  flex-direction: column;
  gap: var(--rhythm-3);
}

/* --- CASE STUDY --- */

.case-study__header {
  margin-block-end: var(--rhythm-3);
}

.case-study__title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-block-end: var(--space-2);
}

.case-study__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.case-study__tag {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.case-study__body {
  margin-block-end: var(--rhythm-3);
}

.case-study__body p {
  margin-block-end: var(--rhythm-1);
}

.case-study__body p:last-child {
  margin-block-end: 0;
}

.case-study__images {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.case-study__figure img {
  width: 100%;
  background-color: var(--color-subtle);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* --- SITE FOOTER --- */

.site-footer {
  padding-inline: var(--gutter);
  padding-block: var(--rhythm-2);
  font-size: var(--text-sm);
  max-width: var(--max-width);
  margin: 0 auto
}

/* --- RESPONSIVE --- */

@media (min-width: 48rem) {
  :root {
    --gutter: var(--space-6);
  }

  /* Two-column text layout kicks in */
  .intro {
    display: grid;
    grid-template-columns: var(--col-split);
    grid-template-rows: 1fr auto;
    min-height: 50vh;
  }

  .intro__text {
    grid-column: 2;
    grid-row: 1;
  }

  .intro__links {
    grid-column: 2;
    grid-row: 2;
  }

  .case-study {
    display: grid;
    grid-template-columns: var(--col-split);
  }

  .case-study__header,
  .case-study__body {
    grid-column: 2;
  }

  .case-study__images {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
}

@media (min-width: 64rem) {
  .case-study__images {
    grid-template-columns: repeat(3, 1fr);
  }
}
