/* ============================================================
   MICHAEL LAWSON — PORTFOLIO
   style.css  v2 — light palette, Inter-dominant typography

   Design system:
   · Background: #f2ede5 (warm off-white)
   · Text: #111111 (near-black)
   · Muted: #8c8885 (warm mid-grey)
   · No accent colour — hierarchy via weight, scale, and opacity only
   · Playfair Display: hero name (Panel 1) + closing heading (Panel 6)
   · Inter: all section headings, body, labels, skills, stats
   · Exception: stat numbers use Playfair italic — data as editorial callout

   Structure:
   1.  Design tokens
   2.  Reset & base
   3.  Grain overlay
   4.  Custom cursor
   5.  Progress bar
   6.  Horizontal scroll infrastructure
   7.  Panel — shared
   8.  Panel 1 — The Hook
   9.  Panel 2 — Origin
   10. Panel 3 — Myst
   11. Panel 4 — Rendered
   12. Panel 5 — Tools / Skills
   13. Panel 6 — Contact
   14. Mobile (<768px) — vertical fallback
   ============================================================ */


/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */

:root {
  --bg:          #f2ede5;
  --text:        #111111;
  --muted:       #8c8885;
  --border:      rgba(0, 0, 0, 0.07);
  --ghost:       rgba(0, 0, 0, 0.04); /* fills for decorative type elements */

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --transition:   0.2s ease;
  --panel-pad:    96px;
}


/* ============================================================
   2. RESET & BASE
   ============================================================ */

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

html {
  overflow-x: hidden;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  cursor: none;
}

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

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


/* ============================================================
   3. GRAIN OVERLAY
   multiply blend mode darkens the light background slightly —
   the inverse of soft-light on dark. Keeps the texture subtle.
   Tiled SVG feTurbulence pattern; stitchTiles ensures seamless edges.
   ============================================================ */

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  background-repeat: repeat;
}


/* ============================================================
   4. CUSTOM CURSOR
   Near-black dot. Expands into a thin-ringed circle over links.
   Movement driven by GSAP quickTo in main.js.
   ============================================================ */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 7px;
  height: 7px;
  background: var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  will-change: transform;
  transition: width var(--transition), height var(--transition),
              background var(--transition), opacity var(--transition);
}

.cursor--hover {
  width: 20px;
  height: 20px;
  background: transparent;
  border: 1px solid rgba(17, 17, 17, 0.25);
}

.cursor--hidden {
  opacity: 0;
}


/* ============================================================
   5. PROGRESS BAR
   ============================================================ */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 1px;
  width: 0%;
  background: rgba(17, 17, 17, 0.35);
  z-index: 9999;
  pointer-events: none;
}


/* ============================================================
   6. HORIZONTAL SCROLL INFRASTRUCTURE
   ============================================================ */

.h-wrapper {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.h-container {
  display: flex;
  flex-direction: row;
  height: 100vh;
  will-change: transform;
}


/* ============================================================
   7. PANEL — SHARED
   ============================================================ */

.panel {
  width: 100vw;
  height: 100vh;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  padding: var(--panel-pad);
}

/* Section labels — all panels */
.section-label {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}


/* ============================================================
   8. PANEL 1 — THE HOOK
   ============================================================ */

.panel-1 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Faint "01" behind the name — near-black fill at ghost opacity */
.panel-1__bg-number {
  position: absolute;
  right: 3%;
  bottom: -6%;
  font-family: var(--font-display);
  font-size: clamp(200px, 30vw, 420px);
  font-weight: 900;
  line-height: 1;
  color: var(--ghost);
  user-select: none;
  pointer-events: none;
  z-index: 0;
  letter-spacing: -0.04em;
}

.panel-1__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 880px;
  width: 100%;
}

/* Hero name — the one moment of Playfair on the page (aside from the close) */
.panel-1__name {
  font-family: var(--font-display);
  font-size: clamp(54px, 8.5vw, 100px);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 30px;
}

.panel-1__name .word {
  display: inline-block;
}

.panel-1__name .word + .word {
  margin-left: 0.28em;
}

.panel-1__subtitle {
  font-family: var(--font-body);
  font-size: clamp(13px, 1.3vw, 16px);
  font-weight: 400;
  color: var(--muted);
  line-height: 1.65;
  max-width: 400px;
  margin: 0 auto;
  letter-spacing: 0.01em;
}

/* Scroll indicator — bottom left */
.panel-1__scroll-indicator {
  position: absolute;
  bottom: var(--panel-pad);
  left: var(--panel-pad);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.scroll-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.scroll-arrow {
  display: flex;
  align-items: center;
  animation: arrow-nudge 1.8s ease-in-out infinite;
}

@keyframes arrow-nudge {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(5px); }
}

/* Nav — bottom right */
.panel-1__nav {
  position: absolute;
  bottom: var(--panel-pad);
  right: var(--panel-pad);
  z-index: 1;
  display: flex;
  gap: 36px;
}

.nav-link {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--transition);
  cursor: none;
}

.nav-link:hover {
  color: var(--text);
}


/* ============================================================
   9. PANEL 2 — ORIGIN
   Left: text (55%). Right: ghost typographic element (45%).
   ============================================================ */

.panel-2 {
  display: grid;
  grid-template-columns: 55% 45%;
  align-items: center;
}

.panel-2__left {
  padding-right: 80px;
}

/* Heading in Inter 700 — direct, no editorial softening */
.panel-2__heading {
  font-family: var(--font-body);
  font-size: clamp(34px, 4.2vw, 56px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}

.panel-2__body p {
  font-size: 15px;
  line-height: 1.85;
  color: rgba(17, 17, 17, 0.5);
  max-width: 400px;
}

.panel-2__body p + p {
  margin-top: 18px;
}

/* Right: "RENDERED" rotated 90° — ghost fill, no stroke */
.panel-2__right {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  overflow: hidden;
}

.panel-2__bg-word {
  font-family: var(--font-display);
  font-size: clamp(72px, 11vw, 148px);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--ghost); /* near-black at 4% — barely there */
  transform: rotate(90deg);
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}


/* ============================================================
   10. PANEL 3 — MYST
   Left: text (58%). Right: stat blocks behind a border (42%).
   ============================================================ */

.panel-3 {
  display: grid;
  grid-template-columns: 58% 42%;
  align-items: center;
}

.panel-3__left {
  padding-right: 80px;
}

.panel-3__heading {
  font-family: var(--font-body);
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}

.panel-3__body p {
  font-size: 14px;
  line-height: 1.9;
  color: rgba(17, 17, 17, 0.48);
  max-width: 440px;
}

.panel-3__body p + p {
  margin-top: 16px;
}

/* Stat blocks — right column */
.panel-3__right {
  padding-left: 72px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 48px;
  justify-content: center;
}

.stat-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/*
   Stat numbers use Playfair Display italic —
   data as an editorial callout rather than a dashboard metric.
   The contrast with Inter everywhere else makes them land harder.
   TO UPDATE: swap data-target values for live Rendered metrics when available.
*/
.stat-number {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(42px, 5.2vw, 68px);
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.stat-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}


/* ============================================================
   11. PANEL 4 — RENDERED
   Mirror of Panel 3: image/placeholder left (42%), text right (58%).
   ============================================================ */

.panel-4 {
  display: grid;
  grid-template-columns: 42% 58%;
  align-items: center;
}

.panel-4__left {
  height: 70%;
  padding-right: 72px;
}

/*
   IMAGE PLACEHOLDER
   ─────────────────
   Replace the entire .rendered-placeholder div with:

     <img src="images/rendered-product.jpg"
          alt="Rendered beef tallow balm"
          class="panel-4__product-image">

   Recommended: 900×900px minimum, clean background, product-focused.
*/
.rendered-placeholder {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.02);
  overflow: hidden;
}

.rendered-placeholder__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.rendered-placeholder__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.rendered-placeholder__brand {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.8vw, 36px);
  font-weight: 900;
  letter-spacing: 0.22em;
  color: rgba(17, 17, 17, 0.07);
}

.rendered-placeholder__hint {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.5;
}

.panel-4__product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Right column */
.panel-4__right {
  padding-left: 72px;
  border-left: 1px solid var(--border);
}

.panel-4__heading {
  font-family: var(--font-body);
  font-size: clamp(28px, 3.3vw, 46px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}

.panel-4__body p {
  font-size: 14px;
  line-height: 1.9;
  color: rgba(17, 17, 17, 0.48);
  max-width: 400px;
}

.panel-4__body p + p {
  margin-top: 16px;
}


/* ============================================================
   12. PANEL 5 — TOOLS / SKILLS
   Full-width. Label top-left. 2-column skill grid below.
   ============================================================ */

.panel-5 {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-label--standalone {
  margin-bottom: 52px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
}

.skill-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: clamp(18px, 2.2vw, 30px);
  font-weight: 500;
  color: rgba(17, 17, 17, 0.32); /* dimmed — hover reveals to full */
  cursor: none;
  overflow: hidden;
  transition: color var(--transition);
}

.skill-item:nth-child(odd) {
  padding-right: 48px;
}

.skill-item:nth-child(even) {
  padding-left: 48px;
  border-left: 1px solid var(--border);
}

/* Top border on row 1 only */
.skill-item:nth-child(1),
.skill-item:nth-child(2) {
  border-top: 1px solid var(--border);
}

/* span carries the sliding underline */
.skill-item span {
  position: relative;
  display: inline-block;
}

.skill-item span::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width 0.3s ease;
}

.skill-item:hover {
  color: var(--text);
}

.skill-item:hover span::after {
  width: 100%;
}


/* ============================================================
   13. PANEL 6 — CONTACT
   Full screen, centred, minimal.
   Playfair returns here — bookends the hero name on Panel 1.
   ============================================================ */

.panel-6 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.panel-6__content {
  max-width: 600px;
}

/* Playfair reappears — the only two Playfair headings in the site */
.panel-6__heading {
  font-family: var(--font-display);
  font-size: clamp(58px, 8vw, 100px);
  font-weight: 900;
  line-height: 1;
  color: var(--text);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.panel-6__subtext {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 52px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.panel-6__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.contact-link {
  font-size: clamp(13px, 1.4vw, 18px);
  font-weight: 400;
  color: rgba(17, 17, 17, 0.55);
  position: relative;
  display: inline-block;
  cursor: none;
  transition: color var(--transition);
}

.contact-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width 0.35s ease;
}

.contact-link:hover {
  color: var(--text);
}

.contact-link:hover::after {
  width: 100%;
}

.panel-6__footer {
  position: absolute;
  bottom: var(--panel-pad);
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
  opacity: 0.4;
  white-space: nowrap;
}

/* Shared cursor rule */
a, button, .skill-item, .nav-link, .contact-link {
  cursor: none;
}


/* ============================================================
   14. MOBILE (<768px) — VERTICAL FALLBACK
   ============================================================ */

@media (max-width: 767px) {

  body {
    cursor: auto;
    font-size: 16px;
  }

  /* Remove grain — performance */
  body::before { display: none; }

  /* Hide custom cursor */
  .cursor { display: none; }

  /* Restore pointer cursors */
  a, button, .skill-item, .nav-link, .contact-link {
    cursor: pointer;
  }

  /* Disable horizontal layout */
  .h-wrapper {
    height: auto;
    overflow: visible;
  }

  .h-container {
    flex-direction: column;
    height: auto;
    transform: none !important;
  }

  .panel {
    width: 100%;
    height: auto;
    min-height: 100svh;
    padding: 56px 28px;
  }


  /* — Panel 1 — */
  .panel-1 {
    justify-content: center;
  }

  .panel-1__bg-number {
    font-size: 42vw;
    right: -2%;
    bottom: 2%;
  }

  .panel-1__name {
    font-size: clamp(42px, 10vw, 68px);
    margin-bottom: 20px;
  }

  .panel-1__subtitle {
    font-size: 14px;
    max-width: none;
  }

  .panel-1__scroll-indicator {
    bottom: 32px;
    left: 28px;
  }

  .panel-1__nav {
    bottom: 32px;
    right: 28px;
    gap: 24px;
  }


  /* — Panel 2 — */
  .panel-2 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 72px 28px;
  }

  .panel-2__left { padding-right: 0; }

  .panel-2__heading {
    font-size: clamp(30px, 7.5vw, 48px);
    margin-bottom: 24px;
  }

  .panel-2__body p { max-width: none; }

  .panel-2__right { display: none; }


  /* — Panel 3 — */
  .panel-3 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 72px 28px;
    gap: 52px;
  }

  .panel-3__left { padding-right: 0; }

  .panel-3__heading {
    font-size: clamp(24px, 6.5vw, 40px);
    margin-bottom: 20px;
  }

  .panel-3__body p { max-width: none; }

  .panel-3__right {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-top: 44px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 32px;
  }

  .stat-block { flex: 1 1 110px; }

  .stat-number { font-size: clamp(34px, 8vw, 52px); }


  /* — Panel 4 — */
  .panel-4 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 72px 28px;
    gap: 44px;
  }

  .panel-4__left {
    height: 250px;
    padding-right: 0;
  }

  .panel-4__right {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-top: 36px;
  }

  .panel-4__heading {
    font-size: clamp(24px, 6.5vw, 40px);
    margin-bottom: 20px;
  }

  .panel-4__body p { max-width: none; }


  /* — Panel 5 — */
  .panel-5 {
    padding: 72px 28px;
    justify-content: center;
  }

  .section-label--standalone { margin-bottom: 36px; }

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

  .skill-item {
    font-size: clamp(18px, 5vw, 26px);
    padding: 18px 0;
    cursor: default;
  }

  .skill-item:nth-child(odd) { padding-right: 0; }

  .skill-item:nth-child(even) {
    padding-left: 0;
    border-left: none;
  }

  .skill-item:nth-child(2) { border-top: none; }


  /* — Panel 6 — */
  .panel-6 { padding: 72px 28px; }

  .panel-6__heading { font-size: clamp(50px, 11vw, 72px); }

  .panel-6__subtext {
    font-size: 14px;
    max-width: none;
    margin-bottom: 40px;
  }

  .contact-link {
    font-size: 15px;
    cursor: pointer;
    color: rgba(17, 17, 17, 0.6);
  }

  .panel-6__footer {
    position: static;
    transform: none;
    margin-top: 60px;
    display: block;
    text-align: center;
  }
}
