/* ============================================================
   DYLAN JEPPESEN — Portfolio
   Editorial / motion-led security portfolio
   Type: Space Grotesk · Cormorant Garamond (italic) · Space Mono
   ============================================================ */

:root {
  /* warm paper / ink */
  --paper:      oklch(0.971 0.006 85);
  --paper-2:    oklch(0.945 0.008 84);
  --ink:        oklch(0.23 0.012 60);
  --ink-soft:   oklch(0.36 0.010 62);
  --gray:       oklch(0.58 0.008 70);
  --gray-2:     oklch(0.70 0.007 75);
  --hair:       oklch(0.86 0.006 82);
  --hair-2:     oklch(0.80 0.006 80);

  --pad: 5rem;             /* desktop page padding */
  --gutter: 1.5rem;
  --cols: 12;

  --t-fast: 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  --t-med:  0.7s  cubic-bezier(0.22, 1, 0.36, 1);
  --t-slow: 1.05s cubic-bezier(0.16, 1, 0.3, 1);

  --sans: "Space Grotesk", system-ui, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --mono: "Space Mono", ui-monospace, monospace;
}

@media (max-width: 900px) {
  :root { --pad: 1.5rem; --cols: 6; }
}

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

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.5;
  font-weight: 400;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ---------- custom scrollbar ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--hair-2); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-2); }

/* ============================================================
   TYPE PRIMITIVES
   ============================================================ */
.serif { font-family: var(--serif); font-style: italic; font-weight: 500; }
.mono  { font-family: var(--mono); }

.label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray);
}
.label-ink { color: var(--ink); }

/* bracketed section label e.g. [Project info] */
.tag {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray);
}

.year { font-family: var(--serif); font-style: italic; font-weight: 500; }

/* giant editorial heading */
.display {
  font-family: var(--sans);
  font-weight: 500;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.015em;
  font-size: clamp(2.6rem, 8.5vw, 9.5rem);
}
.display .em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  text-transform: none;
  letter-spacing: -0.01em;
}

.h-lg {
  font-weight: 500;
  text-transform: uppercase;
  line-height: 1.0;
  letter-spacing: -0.01em;
  font-size: clamp(2rem, 4.6vw, 4.6rem);
}
.h-lg .em { font-family: var(--serif); font-style: italic; text-transform: none; font-weight: 500; }

.body-lg {
  font-size: clamp(1.1rem, 1.55vw, 1.55rem);
  line-height: 1.5;
  font-weight: 400;
  color: var(--ink-soft);
}
.body-lg b, .body-lg strong { color: var(--ink); font-weight: 500; }

/* ============================================================
   LAYOUT
   ============================================================ */
.page { padding-left: var(--pad); padding-right: var(--pad); }

.grid12 {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gutter);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.7rem var(--pad);
  font-size: 0.98rem;
  font-weight: 500;
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }

.brand { letter-spacing: -0.01em; white-space: nowrap; }
.brand .serif { font-size: 1.05em; }

.nav {
  display: flex;
  gap: 0.4rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.nav a { color: var(--gray-2); transition: color var(--t-fast); }
.nav a.active, .nav a:hover { color: var(--ink); }
.nav .sep { color: var(--gray-2); }

@media (max-width: 900px) {
  .nav { display: none; }
  .site-header { padding: 1.1rem var(--pad); font-size: 0.9rem; }
}

/* underline-on-hover link */
.ul {
  position: relative;
  display: inline-block;
}
.ul::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(1);
  transform-origin: left;
  transition: transform var(--t-fast);
}
.ul:hover::after { transform: scaleX(0); transform-origin: right; }

/* underline that draws IN on hover */
.ul-in { position: relative; display: inline-block; }
.ul-in::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-fast);
}
.ul-in:hover::after { transform: scaleX(1); }

/* ============================================================
   PLACEHOLDER MEDIA PLATES
   ============================================================ */
.plate {
  position: relative;
  overflow: hidden;
  background-color: var(--tint, var(--paper-2));
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 15px,
    var(--stripe-c, transparent) 15px 18px
  );
}
.plate-light { --stripe-c: oklch(0.30 0.02 60 / 0.30); }
.plate-dark  { --stripe-c: oklch(0.99 0.006 85 / 0.28); }
.plate::after {
  content: "";
  position: absolute; inset: 0;
  border: 1px solid var(--stripe-c);
  pointer-events: none;
}
.plate-label {
  position: absolute;
  left: 0; bottom: 0;
  padding: 0.75rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  z-index: 2;
  line-height: 1.35;
}
.plate-light .plate-label { color: oklch(from var(--tint) calc(l - 0.42) c h); }
.plate-dark  .plate-label { color: oklch(0.97 0.006 85 / 0.82); }
.plate-corner {
  position: absolute; top: 0; right: 0;
  padding: 0.7rem 0.8rem;
  font-family: var(--mono); font-size: 0.66rem;
  z-index: 2;
}
.plate-light .plate-corner { color: oklch(from var(--tint) calc(l - 0.34) c h); }
.plate-dark  .plate-corner { color: oklch(0.97 0.006 85 / 0.6); }

/* unmute pill on video plates */
.pill {
  position: absolute; left: 1rem; bottom: 1rem; z-index: 3;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid rgba(255,255,255,0.55);
  color: #fff;
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.04em; text-transform: uppercase;
  border-radius: 100px;
  backdrop-filter: blur(6px);
  background: rgba(0,0,0,0.18);
  transition: background var(--t-fast), color var(--t-fast);
}
.pill:hover { background: rgba(255,255,255,0.92); color: #111; border-color: transparent; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============================================================
   SPLIT TEXT (reveal) — masked rows, words slide up
   ============================================================ */
.reveal-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}
.reveal-word {
  display: inline-block;
  transform: translateY(115%);
  will-change: transform;
}
.is-in .reveal-word { animation: wordUp 1.05s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes wordUp {
  from { transform: translateY(115%); }
  to   { transform: translateY(0); }
}
/* fallback: if the entrance animation never plays, pin to final visible state */
.rv-shown .reveal-word { animation: none !important; transform: translateY(0) !important; }

/* generic fade/slide reveal */
.fade-up {
  opacity: 0;
}
.fade-up.is-in { animation: fadeUp 0.7s cubic-bezier(0.22,1,0.36,1) forwards; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}
.fade-up.rv-shown { animation: none !important; opacity: 1 !important; transform: none !important; }

/* image clip reveal (class is on a child plate; is-in/rv-shown on the Reveal parent) */
.clip-reveal { clip-path: inset(0 0 100% 0); }
.is-in .clip-reveal { animation: clipReveal 1.05s cubic-bezier(0.16,1,0.3,1) forwards; }
@keyframes clipReveal {
  from { clip-path: inset(0 0 100% 0); }
  to   { clip-path: inset(0 0 0 0); }
}
.rv-shown .clip-reveal { animation: none !important; clip-path: inset(0 0 0 0) !important; }

/* ============================================================
   PAGE TRANSITION OVERLAY
   ============================================================ */
.page-wipe {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: bottom;
  pointer-events: none;
}
.page-wipe.cover  { animation: wipeCover 0.55s cubic-bezier(0.7,0,0.3,1) forwards; }
.page-wipe.reveal { animation: wipeReveal 0.6s cubic-bezier(0.7,0,0.3,1) forwards; }
@keyframes wipeCover {
  0%   { transform: scaleY(0); transform-origin: bottom; }
  100% { transform: scaleY(1); transform-origin: bottom; }
}
@keyframes wipeReveal {
  0%   { transform: scaleY(1); transform-origin: top; }
  100% { transform: scaleY(0); transform-origin: top; }
}

/* ============================================================
   ARROW LINK (sliding arrow on hover)
   ============================================================ */
.arrow-link {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-weight: 500;
}
.arrow-link .arw { position: relative; width: 1.05em; height: 1.05em; overflow: hidden; display: inline-block; }
.arrow-link .arw svg { position: absolute; inset: 0; transition: transform var(--t-fast); }
.arrow-link .arw svg:nth-child(2) { transform: translate(-130%, 130%); }
.arrow-link:hover .arw svg:nth-child(1) { transform: translate(130%, -130%); }
.arrow-link:hover .arw svg:nth-child(2) { transform: translate(0, 0); }

/* ============================================================
   BUTTON
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 0.8rem;
  padding: 1rem 1.6rem;
  border: 1px solid var(--ink);
  font-weight: 500; font-size: 1rem;
  border-radius: 100px;
  transition: background var(--t-fast), color var(--t-fast), padding var(--t-fast);
  background: transparent;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn svg { transition: transform var(--t-fast); }
.btn:hover svg { transform: translateX(4px); }

/* ============================================================
   HEADER blend over dark media
   ============================================================ */
.blend { mix-blend-mode: difference; color: #fff; }
.blend a { color: #fff; }
.blend .nav a { color: rgba(255,255,255,0.55); }
.blend .nav a.active, .blend .nav a:hover { color: #fff; }

/* ============================================================
   SCROLLBAR-FREE horizontal scroller
   ============================================================ */
.h-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.h-scroll::-webkit-scrollbar { display: none; }
