/*
  Folio Design — design system
  Base: 12px (1rem = 12px)

  Type scale (px → rem):
    Heading:     130px = 10.833rem
    Subheading:   50px = 4.167rem
    Body 1:       36px = 3rem
    Body 2:       20px = 1.667rem
    Text:         16px = 1.333rem

  Colors:
    Background:   #F9F9F9
    Text:         #03071E
    Accent:       #FC7A1E
*/

:root {
  --color-bg:        #F9F9F9;
  --color-text:      #03071E;
  --color-text-muted:#03071e99;
  --color-accent:    #FC7A1E;
  --color-border:    #03071e1a;

  --font: "DM Sans", system-ui, -apple-system, sans-serif;

  /* Fluid scale — artboard-based root + capped rem/vw tokens (designisfunny.co pattern) */
  --size-base:     12;
  --size-artboard: 640;

  --fs-heading:    min(8.333rem, 21vw);
  --fs-subheading: min(3rem, 7.33vw);
  --fs-body1:      min(2.667rem, 6vw);
  --fs-body2:      1.667rem;
  --fs-text:       1.333rem;
  --fs-label:      1rem;

  --fw-bold:       700;
  --fw-semibold:   600;
  --fw-medium:     500;

  --header-h:      5.833rem; /* 70px at 12px root */
  --max-w:         120rem;   /* 1440px */

  --pad-x: clamp(2rem, 5vw, 8.333rem);
}

@media (min-width: 992px) {
  :root {
    --size-artboard: 1440;

    --fs-heading:    min(10.833rem, 22vh);
    --fs-subheading: 4.167rem;
    --fs-body1:      3rem;
    --fs-body2:      1.667rem;
    --fs-text:       1.333rem;
    --fs-label:      1rem;
  }
}

/* Reset */

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

html {
  font-size: 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::-webkit-scrollbar {
  display: none;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

@media (min-width: 992px) {
  html {
    font-size: calc(var(--size-base) * (100vw / var(--size-artboard)));
  }
}

body {
  font-family: var(--font);
  font-size: var(--fs-text);
  font-weight: var(--fw-medium);
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

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

ul {
  list-style: none;
}

/* ──────────────────────────────
   Header
────────────────────────────── */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding: 0 var(--pad-x);
  background: transparent;
  color: var(--color-text);
  transition: color 0.3s ease;
}

.site-header--on-dark {
  color: #fff;
}

.site-header--on-dark .site-nav__item:hover {
  opacity: 0.65;
}

.site-nav {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.site-nav__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s;
}

.site-nav__item:hover {
  opacity: 0.45;
}

.site-nav__num {
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav__pill {
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ──────────────────────────────
   Hero
────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  width: 100%;
  padding-top: var(--header-h);
  padding-bottom: 4rem;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.hero__title {
  font-size: var(--fs-heading);
  font-weight: var(--fw-bold);
  line-height: 0.88;
  letter-spacing: -0.04em;
  margin-bottom: 3rem;
}


/* ──────────────────────────────
   About
────────────────────────────── */

.about {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: var(--header-h) var(--pad-x) 4rem;
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(1.5rem, 2.8vw, 3.333rem);
  row-gap: clamp(4rem, 10vh, 12rem);
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  align-items: end;
}

.about__intro {
  grid-column: 1 / span 5;
  grid-row: 1;
  font-size: var(--fs-body1);
  font-weight: var(--fw-semibold);
  line-height: 1.05;
  letter-spacing: -0.04em;
  max-width: 14ch;
}

.about__photo {
  grid-column: 1 / span 3;
  grid-row: 2;
  max-width: 26.5rem;
}

.about__photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
  border-radius: 0.667rem;
}

.about__content {
  grid-column: 9 / span 3;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: var(--fs-text);
  color: var(--color-text);
  line-height: 1.5;
  max-width: 22ch;
}

.about__more {
  font-size: var(--fs-text);
  font-style: italic;
  font-weight: var(--fw-medium);
  color: var(--color-text-muted);
  opacity: 0.34;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  text-align: left;
  transition: opacity 0.2s;
}

.about__more:hover {
  opacity: 0.7;
}

/* ──────────────────────────────
   About panel (bottom sheet)
────────────────────────────── */

html.is-about-panel-open,
html.is-about-panel-open body {
  overflow: hidden;
}

.about-panel {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  visibility: hidden;
}

.about-panel.is-open {
  pointer-events: auto;
  visibility: visible;
}

.about-panel.is-open .about-panel__backdrop {
  opacity: 1;
}

.about-panel.is-open .about-panel__sheet {
  transform: translateY(0);
}

.about-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(3 7 30 / 0.35);
  opacity: 0;
}

.about-panel__sheet {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 56rem);
  background: var(--color-bg);
  border-radius: 1.333rem 1.333rem 0 0;
  box-shadow: 0 -0.667rem 3.333rem rgb(3 7 30 / 0.08);
  transform: translateY(100%);
  overflow: hidden;
}

.about-panel__inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--max-w);
  min-height: min(50vh, 28rem);
  margin: 0 auto;
  padding:
    clamp(1.5rem, 3vw, 2.667rem)
    var(--pad-x)
    max(clamp(1.5rem, 3vw, 2.667rem), env(safe-area-inset-bottom));
}

.about-panel__close {
  align-self: flex-end;
  margin-bottom: clamp(1.5rem, 4vh, 3.333rem);
  font-size: var(--fs-text);
  font-style: italic;
  font-weight: var(--fw-medium);
  color: var(--color-text-muted);
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  opacity: 0.34;
  transition: opacity 0.2s;
}

.about-panel__close:hover {
  opacity: 0.7;
}

.about-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
  .about-panel__sheet {
    max-height: min(78vh, 60rem);
  }

  .about-panel__inner {
    min-height: min(42vh, 32rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-panel__backdrop,
  .about-panel__sheet {
    transition: none;
  }
}

/* ──────────────────────────────
   Work / Projects
────────────────────────────── */

.work {
  padding: 0 var(--pad-x);
}

.work__layout {
  display: grid;
  grid-template-columns: 57fr 40fr;
  gap: clamp(2rem, 4vw, 4.167rem);
  align-items: stretch;
  max-width: var(--max-w);
  margin: 0 auto;
}

.work__meta {
  position: relative;
}

.work__meta-sticky {
  position: sticky;
  top: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: calc(100vh - var(--header-h));
  pointer-events: none;
}

.work__titles {
  position: relative;
  width: 100%;
  height: clamp(8rem, 16vh, 11rem);
  text-align: right;
  pointer-events: auto;
}

.work__title-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.work__title-panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.work__track {
  display: flex;
  flex-direction: column;
  padding-bottom: 20vh;
}

.project {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52vh;
  min-height: 52vh;
  box-sizing: border-box;
}

.project__link {
  display: block;
  width: 66.667%;
  margin: 0 auto;
  transition: opacity 0.2s;
}

.project__link:hover {
  opacity: 0.85;
}

.project__media {
  overflow: hidden;
  width: 100%;
  border-radius: 0.333rem;
}

.project__media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  will-change: transform;
}

.project__number {
  display: block;
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.project__title {
  font-size: var(--fs-subheading);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.project__category {
  display: block;
  font-size: var(--fs-text);
  color: var(--color-text-muted);
  line-height: 1.45;
  max-width: 32ch;
}

/* ──────────────────────────────
   Footer / Contact
────────────────────────────── */

.site-footer {
  padding-top: 8rem;
}

/* Marquee CTA */

.marquee {
  display: block;
  overflow: hidden;
  background: var(--color-text);
  cursor: pointer;
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: scroll-marquee 18s linear infinite;
}

.marquee__track span {
  flex-shrink: 0;
  padding: 0 clamp(3rem, 5vw, 6rem);
  font-size: var(--fs-heading);
  font-weight: var(--fw-bold);
  letter-spacing: 0.05em;
  color: var(--color-bg);
  white-space: nowrap;
  line-height: 1;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

@keyframes scroll-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Footer bottom row */

.footer__bottom {
  display: flex;
  flex-direction: column;
  gap: 1.333rem;
  padding: 2rem var(--pad-x) 1.5rem;
}

.footer__follow {
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer__rule {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: 1px;
  background: var(--color-border);
  flex-shrink: 0;
}

.footer__links {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer__links nav {
  display: flex;
  flex-direction: column;
  gap: 0.333rem;
}

.footer__links a {
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.2s;
}

.footer__links a:hover {
  opacity: 0.45;
}

.footer__email {
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.2s;
}

.footer__email:hover {
  opacity: 0.45;
}

/* ──────────────────────────────
   Responsive
────────────────────────────── */

@media (max-width: 760px) {
  .about__grid {
    grid-template-columns: 1fr;
    row-gap: 2.5rem;
  }

  .about__intro,
  .about__photo,
  .about__content {
    grid-column: 1;
    grid-row: auto;
    max-width: none;
  }

  .about__intro {
    max-width: 20ch;
  }

  .about__photo {
    max-width: 200px;
  }

  .work__layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .work__meta {
    order: -1;
  }

  .work__meta-sticky {
    top: var(--header-h);
    z-index: 5;
    align-items: flex-start;
    justify-content: flex-start;
    height: auto;
    min-height: auto;
    padding: 1.5rem 0 2rem;
    background: linear-gradient(
      to bottom,
      var(--color-bg) 75%,
      rgb(249 249 249 / 0)
    );
  }

  .work__titles {
    min-height: clamp(8rem, 18vh, 11rem);
    text-align: left;
  }

  .work__title-panel {
    align-items: flex-start;
  }

  .project {
    height: auto;
    min-height: 48vh;
  }
}

@media (max-width: 520px) {
  :root {
    --header-h: 8.333rem;
  }

  .site-header {
    flex-wrap: wrap;
    height: auto;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    gap: 1rem;
  }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .work__title-panel {
    transition: opacity 0.35s ease, visibility 0.35s ease;
  }

  .project__media img {
    will-change: auto;
  }

  .marquee__track {
    animation: none;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }
}
