/* ==========================================================================
   Jaspher Tampos — Portfolio
   base.css: fonts, tokens, reset, intro loader, nav, buttons, reveal kit
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('../assets/fonts/archivo-variable.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/instrument-serif-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/dm-mono-regular.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
  --black: #000;
  --ink: #0a0a0a;
  --raise: #0e0e0e;
  --panel: #151515;
  --edge: #222;
  --line: #3a3a38;
  --white: #f3f3f0;
  --soft: #cfcfcb;
  --grey: #8c8c88;
  --dim: #5a5a57;
  --live: #3ddc84;
  --error: #ff7a70;
  --paper: #f3f3f0;
  --card-border: #d9d9d4;
  --grad: linear-gradient(180deg, #5f5f5c 0%, #f3f3f0 100%);

  --wrap: 1360px;
  --gut: clamp(1.25rem, 3.6vw, 3.5rem);
  --radius-xl: clamp(28px, 4vw, 60px);
  --radius-lg: clamp(20px, 3vw, 40px);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.1, 0.25, 1);
  --pop: cubic-bezier(0.34, 1.45, 0.64, 1);
  --curtain: cubic-bezier(0.76, 0, 0.24, 1);

  --sans: 'Archivo', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'DM Mono', ui-monospace, monospace;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--black);
}
html.intro-lock {
  overflow: hidden;
}
body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
[id] {
  scroll-margin-top: 4.5rem;
}
::selection {
  background: var(--white);
  color: var(--black);
}
:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
  border-radius: 4px;
}
.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gut);
}
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 300;
  padding: 0.6rem 1rem;
  background: var(--white);
  color: var(--black);
}
.skip:focus {
  left: 1rem;
  top: 1rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Type helpers ---------- */
/* Gradient text, same idea as the prompt's .hero-heading, in this site's palette */
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
/* Huge condensed uppercase section titles */
.display {
  padding-block: 0.08em;
  font-weight: 900;
  font-stretch: 80%;
  font-size: clamp(3rem, 12vw, 160px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.center {
  text-align: center;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey);
}

/* ---------- Intro loader ---------- */
.intro {
  display: none;
}
.js .intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.25rem, 3vw, 2.5rem) var(--gut);
  background: var(--black);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s var(--curtain);
}
.intro.done {
  clip-path: inset(0 0 100% 0);
  pointer-events: none;
}
.intro > * {
  transition:
    transform 1s var(--curtain),
    opacity 0.6s;
}
.intro.done > * {
  transform: translateY(-8vh);
  opacity: 0;
}
.intro-top,
.intro-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
}
.intro-top span:first-child {
  color: var(--white);
}
.intro-words {
  height: 1.1em;
  overflow: hidden;
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 6.5rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}
.intro-words ul {
  margin: 0;
  padding: 0;
  list-style: none;
  transform: translateY(calc(var(--w, 0) * -1.1em));
  transition: transform 0.55s var(--ease);
}
.intro-words li {
  height: 1.1em;
  white-space: nowrap;
}
.intro-words li:last-child {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  /* The serif J and p hang below the line box, and the box is clipped, so the
     name rides high enough for its tails to stay inside it. */
  transform: translateY(-0.09em);
}
.intro-count {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(3.5rem, 11vw, 10rem);
  line-height: 0.8;
  letter-spacing: -0.05em;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.intro-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #1a1a1a;
}
.intro-bar i {
  display: block;
  height: 100%;
  background: var(--white);
  transform: scaleX(var(--prog, 0));
  transform-origin: left;
}

/* ---------- Nav ---------- */
/* Pinned to the top for the whole page; it never slides out of the way. */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  transition: background-color 0.4s;
}
.nav.solid {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-in {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 1rem;
  transition: padding 0.4s var(--ease);
}
.nav.solid .nav-in {
  padding-block: 0.9rem;
}
.nav a {
  color: var(--soft);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity 0.2s;
}
.nav a:hover {
  opacity: 0.7;
}

/* ---------- Pills & buttons ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 1rem;
  border: 1px solid #1e3a2a;
  border-radius: 999px;
  background: rgba(10, 24, 16, 0.7);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #d7e6dc;
}
.pill i,
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  animation: ping 2.4s infinite;
}
@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.55);
  }
  70%,
  100% {
    box-shadow: 0 0 0 9px rgba(61, 220, 132, 0);
  }
}

/* Contact button: the prompt's glossy pill, re-coloured to the site's greys */
.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 2rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(123deg, #050505 5%, #1f1f1e 38%, #3f3f3d 72%, #8c8c88 100%);
  background-size: 180% 100%;
  background-position: 0 0;
  box-shadow:
    0 4px 4px rgba(0, 0, 0, 0.25),
    4px 4px 12px rgba(243, 243, 240, 0.16) inset;
  outline: 2px solid var(--white);
  outline-offset: -3px;
  color: #fff;
  font: 500 0.75rem/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-position 0.6s var(--ease),
    transform 0.3s var(--ease),
    opacity 0.3s;
}
.btn-contact:hover {
  background-position: 100% 0;
  transform: translateY(-2px);
}
.btn-contact svg {
  width: 1.1em;
  height: 1.1em;
  transition: transform 0.4s var(--ease);
}
.btn-contact:hover svg {
  transform: translate(2px, -2px);
}
.btn-contact:focus-visible {
  outline-offset: 3px;
}
.btn-contact[aria-busy='true'] {
  opacity: 0.65;
  pointer-events: none;
}

/* Outline pill (the prompt's "Live Project" button) */
.pill-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.4rem;
  border: 2px solid var(--card-border);
  border-radius: 999px;
  color: var(--white);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

a.pill-ghost {
  text-decoration: none;
  transition: background-color 0.3s;
}
a.pill-ghost:hover {
  background: rgba(217, 217, 212, 0.1);
}
.pill-ghost svg {
  width: 1.1em;
  height: 1.1em;
}

/* Text link with underline */
.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.25rem;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease);
}
.link:hover {
  background-size: 100% 1px;
}

/* ---------- Scroll reveal kit ---------- */
.js [data-reveal] {
  opacity: 0;
  transition:
    opacity var(--dur, 0.8s) var(--ease-soft),
    transform var(--dur, 0.8s) var(--ease-soft);
  transition-delay: var(--delay, 0s);
}
.js [data-reveal='fade'] {
  transform: translateY(var(--y, 30px));
}
.js [data-reveal='left'] {
  transform: translateX(-80px);
}
.js [data-reveal='right'] {
  transform: translateX(80px);
}
.js [data-reveal].in {
  opacity: 1;
  transform: none;
}

/* Headings split into masked words by JS */
.w {
  display: inline-block;
  padding: 0 0.04em 0.14em;
  margin: 0 -0.04em -0.14em;
  clip-path: inset(-60% -30% 0 -30%);
  vertical-align: baseline;
}
.w > span {
  display: inline-block;
}
.js [data-split] .w > span {
  transform: translateY(112%) rotate(4deg);
  transition: transform 0.95s var(--pop);
  transition-delay: calc(var(--delay, 0s) + var(--i) * 0.05s);
}
.js [data-split].in .w > span {
  transform: none;
}
