/* =====================
   FONTS — Suisse Intl (self-hosted)
   ─────────────────────
   Files live in assets/fonts/SuisseIntl-*/Web Fonts/
   To swap the font family: update the @font-face src paths below
   and change --font-primary in :root.
===================== */

@font-face {
  font-family: 'Suisse Intl';
  src: url('assets/fonts/SuisseIntl-Light/Web Fonts/03d5b20d124cd26dc873bd4a8e42313e.woff2') format('woff2'),
       url('assets/fonts/SuisseIntl-Light/Web Fonts/03d5b20d124cd26dc873bd4a8e42313e.woff')  format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Suisse Intl';
  src: url('assets/fonts/SuisseIntl-Regular/Web Fonts/88f10bf18a36407ef36bf30bc25a3618.woff2') format('woff2'),
       url('assets/fonts/SuisseIntl-Regular/Web Fonts/88f10bf18a36407ef36bf30bc25a3618.woff')  format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Suisse Intl';
  src: url('assets/fonts/SuisseIntl-Medium/Web Fonts/c446362802681bacaacbad0f39bfc1a5.woff2') format('woff2'),
       url('assets/fonts/SuisseIntl-Medium/Web Fonts/c446362802681bacaacbad0f39bfc1a5.woff')  format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Suisse Intl';
  src: url('assets/fonts/SuisseIntl-SemiBold/Web Fonts/653d9381828e9577fb1e417dc047f89d.woff2') format('woff2'),
       url('assets/fonts/SuisseIntl-SemiBold/Web Fonts/653d9381828e9577fb1e417dc047f89d.woff')  format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Suisse Intl';
  src: url('assets/fonts/SuisseIntl-Bold/Web Fonts/d1a580023d40c546276decde1c711e60.woff2') format('woff2'),
       url('assets/fonts/SuisseIntl-Bold/Web Fonts/d1a580023d40c546276decde1c711e60.woff')  format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-primary:   'Suisse Intl', system-ui, -apple-system, sans-serif;
  --font-secondary: 'Suisse Intl', system-ui, -apple-system, sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', monospace;
}

/* =====================
   Reset & Base
===================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg:        #ffffff;
  --color-text:      #1a1a1a;
  --color-muted:     #999999;

  --col-margin:      16px;
  --col-gutter:      20px;
  --col-grid-color:  #dfdfdf;

  --transition:      150ms ease;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-primary);
  font-size: 12px;       /* Global — all text inherits this */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Three-row page layout: nav / main / footer */
  display: grid;
  grid-template-rows: auto 1fr auto;
}

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

/* =====================
   Column grid overlay
   ─────────────────────
   12 columns total. Col 1 & 12 are invisible margin columns.
   Inner 10 (2–11) show as dashed-bordered strips.

   Pair logic — every gutter gets TWO dashed lines:
   · Col 1 (margin): border-right only  → left line of first gutter
   · Cols 2–11:     border-left + border-right
   · Col 12 (margin): border-left only  → right line of last gutter
   Outer edges of col 1 (left) and col 12 (right) have no border → clean page margin.
===================== */
.col-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;             /* sits below page content */
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--col-gutter);
  padding: 0 var(--col-margin);
  /* clip-path and reveal are driven by GSAP in main.js */
}

/* Inner 10 visible columns */
.col-grid__col:not(:first-child):not(:last-child) {
  border-left:  1px dashed var(--col-grid-color);
  border-right: 1px dashed var(--col-grid-color);
}

/* First margin column — right line only (pairs with col 2's left) */
.col-grid__col:first-child {
  border-right: 1px dashed var(--col-grid-color);
}

/* Last margin column — left line only (pairs with col 11's right) */
.col-grid__col:last-child {
  border-left: 1px dashed var(--col-grid-color);
}

/* =====================
   Layout grid (reusable)
   Apply to any row container needing 12-col alignment.
===================== */
.layout-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--col-gutter);
  padding: 0 var(--col-margin);
  align-items: center;
  width: 100%;
}

/* =====================
   Navigation
   Nav is a grid row — logo left, links pinned to individual columns.
===================== */
.nav {
  z-index: 2;             /* above col-grid */
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 1.00) 0%,
    rgba(255, 255, 255, 0)    100%
  );
  padding: 14px 0;
}

.nav__logo {
  grid-column: 1 / 4;
  font-size: 12px;
  font-weight: 400;
}

/*
  display: contents removes the <nav> box so its <a> children
  become direct grid items of .layout-grid, enabling per-column placement.
*/
.nav__links {
  display: contents;
}

.nav__links a {
  font-size: 12px;
  font-weight: 400;
  transition: opacity var(--transition);
}

.nav__links a:hover {
  opacity: 0.4;
}

/* Pin each link to its designated column */
.nav__links a:nth-child(1) { grid-column: 7; }  /* Work       */
.nav__links a:nth-child(2) { grid-column: 8; }  /* About      */
.nav__links a:nth-child(3) { grid-column: 9; }  /* Contact    */
.nav__links a:nth-child(4) { grid-column: 10; } /* Playground */

/* =====================
   Main content
===================== */
.main {
  z-index: 2;             /* above col-grid */
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--col-gutter);
  padding: 0 var(--col-margin);
  align-content: center;
  row-gap: 2rem;
  overflow: hidden;
}

/* About label + bio — cols 2–6 */
.content__text {
  grid-column: 2 / 7;
}

.content__label {
  color: var(--color-muted);
  margin-bottom: 0.4rem;
}

.content__bio {
  line-height: 1.6;
}

/* Three preview boxes — cols 2–10 */
.previews {
  grid-column: 2 / 11;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--col-gutter);
}

.preview {
  background: #ebebeb;
  aspect-ratio: 4 / 3;
  position: relative;
}

.preview__label {
  position: absolute;
  top: 10px;
  left: 10px;
  color: var(--color-muted);
}

/* =====================
   Footer
===================== */
.footer {
  z-index: 2;             /* above col-grid */
  padding: 14px 0;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 1.00) 0%,
    rgba(255, 255, 255, 0)    100%
  );
}

.footer__left {
  grid-column: 1 / 6;
  line-height: 1.7;
}

/* Socials / LinkedIn / Instagram → col 7 */
.footer__center {
  grid-column: 7 / 10;
  line-height: 1.7;
}

.footer__center a,
.footer__right a {
  display: block;
  transition: opacity var(--transition);
}

.footer__center a:hover,
.footer__right a:hover {
  opacity: 0.4;
}

/* Contact / email → col 10 */
.footer__right {
  grid-column: 10 / 13;
  line-height: 1.7;
}

/* =====================
   Loader
   GSAP controls all clip-path / opacity / transform animations.
   CSS here is layout only — no transitions.
===================== */

/* Fallback: hide page content before JS runs */
.is-loading .nav,
.is-loading .main,
.is-loading .footer {
  opacity: 0;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Name left, counter right — same row above the square */
.loader__header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.loader__name {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text);
}

.loader__count {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
  text-align: right;
}

.loader__image {
  width: clamp(180px, 25vw, 360px);
  aspect-ratio: 1;
  background: #ebebeb;
}

/* =====================
   Responsive — 6-column (≤980px)
   ─────────────────────
   Cols 1–6 only. Cols 2–5 are visible, col 1 & 6 are margin cols.
   Cols 2–5 already have correct borders from the base rules.
   Only col 6 needs overriding — it becomes the right margin col (left border only).
   The parent selector raises specificity to 0,3,0 to beat the base :not() rule.
===================== */
@media (max-width: 980px) {
  :root {
    --col-gutter: 12px;
  }

  /* Switch overlay to 6 cols, hide surplus */
  .col-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .col-grid__col:nth-child(n+7) {
    display: none;
  }

  /* Col 6 = right margin col: left border only, no right border */
  .col-grid .col-grid__col:nth-child(6) {
    border-left:  1px dashed var(--col-grid-color);
    border-right: none;
  }

  /* Switch all layout grids to 6 cols */
  .layout-grid,
  .main {
    grid-template-columns: repeat(6, 1fr);
  }

  /* Nav */
  .nav__logo                { grid-column: 1 / 3; }
  .nav__links a:nth-child(1) { grid-column: 3; } /* Work       */
  .nav__links a:nth-child(2) { grid-column: 4; } /* About      */
  .nav__links a:nth-child(3) { grid-column: 5; } /* Contact    */
  .nav__links a:nth-child(4) { grid-column: 6; } /* Playground */

  /* Content */
  .content__text { grid-column: 2 / 6; }
  .previews      { grid-column: 2 / 6; }

  /* Footer */
  .footer__left   { grid-column: 1 / 3; }
  .footer__center { grid-column: 3 / 5; }
  .footer__right  { grid-column: 5 / 7; }
}

/* =====================
   Responsive — Mobile (≤640px)
   Inherits 6-col rules from above; just unlocks scroll and stacks.
===================== */
@media (max-width: 640px) {
  html,
  body {
    overflow: auto;
  }

  /* Hide grid overlay on mobile — too dense at this width */
  .col-grid {
    display: none;
  }

  .main {
    align-content: start;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .content__text,
  .previews {
    grid-column: 1 / 7;
  }

  .previews {
    grid-template-columns: 1fr;
  }

  .nav__links a {
    display: none;
  }

  .footer__left,
  .footer__center,
  .footer__right {
    grid-column: 1 / 7;
  }
}
