/* ==========================================================================
   Gabriel Ogard — homepage
   Palette pulled from the portrait: mural green-black + parrot saffron.
   ========================================================================== */

:root {
  --ink: #0a0e0c;
  --ink-2: #0f1512;
  --ink-3: #151d19;
  --line: rgba(214, 228, 216, 0.09);
  --line-2: rgba(214, 228, 216, 0.16);
  --fg: #eaede6;
  --fg-2: #c3cbc3;
  --muted: #7f8a82;
  --leaf: #6f9a78;
  --accent: #ffb23f;
  --accent-2: #ff8a3d;
  --accent-ink: #1a1206;

  --f-sans: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  --f-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --f-mono: "Martian Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-io: cubic-bezier(.7, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
.mono { font-family: var(--f-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 400; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

/* film grain */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 100; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } }

/* pulse dot */
.pulse {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--leaf); position: relative; flex: none;
  box-shadow: 0 0 0 0 rgba(111, 154, 120, .6);
  animation: pulse 2.4s var(--ease) infinite;
}
.pulse--sm { width: 6px; height: 6px; vertical-align: 1px; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(111, 154, 120, .55); }
  70% { box-shadow: 0 0 0 9px rgba(111, 154, 120, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 154, 120, 0); }
}
body.is-surging .pulse { background: var(--accent); animation-duration: .9s; }

/* ───────────────────────── NAV ───────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 18px var(--gutter);
  transition: background .4s, border-color .4s, padding .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(10, 14, 12, .72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-color: var(--line);
  padding-top: 12px; padding-bottom: 12px;
}
.mark {
  font-family: var(--f-serif); font-style: italic; font-size: 34px; line-height: 1;
  display: inline-block; transition: transform .5s var(--ease);
}
.mark__dot { color: var(--accent); }
.nav__mark:hover .mark { transform: rotate(-8deg) scale(1.06); }

.nav__links { display: flex; gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: rgba(15, 21, 18, .5); }
.nav__links a {
  font-size: 13px; font-weight: 500; padding: 7px 14px; border-radius: 999px; color: var(--fg-2);
  transition: color .25s, background .25s;
}
.nav__links a span { font-family: var(--f-mono); font-size: 9px; color: var(--muted); margin-right: 6px; vertical-align: 2px; transition: color .25s; }
.nav__links a:hover, .nav__links a.is-active { color: var(--fg); background: var(--ink-3); }
.nav__links a.is-active span { color: var(--accent); }

.nav__status { justify-self: end; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.nav__clock { color: var(--fg); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .nav { grid-template-columns: auto 1fr; }
  .nav__links { display: none; }
  .nav__status > .mono:nth-child(2) { display: none; }
}

/* ───────────────────────── HERO ───────────────────────── */
.hero {
  position: relative; min-height: 100svh; min-height: 100vh;
  display: flex; align-items: flex-end;
  overflow: hidden; isolation: isolate;
}
@supports (min-height: 100svh) { .hero { min-height: 100svh; } }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero__shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(90% 55% at 0% 100%, rgba(10, 14, 12, .9) 0%, rgba(10, 14, 12, .4) 50%, transparent 80%),
    linear-gradient(to bottom, rgba(10, 14, 12, .7) 0%, transparent 22%, transparent 70%, var(--ink) 100%);
}

.hero__inner { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(40px, 7vh, 80px); }

.eyebrow { display: flex; align-items: center; gap: 14px; color: var(--fg-2); margin: 0 0 clamp(8px, 2vh, 20px); }
.eyebrow__line { width: 42px; height: 1px; background: var(--accent); }

.hero__name {
  font-size: clamp(4.2rem, 16.5vw, 17rem);
  font-weight: 800; line-height: .84; letter-spacing: -.055em;
  margin: 0 0 clamp(28px, 5vh, 56px) -.04em;
  text-wrap: nowrap;
}
.hero__name .row { display: block; overflow: hidden; padding-bottom: .04em; }
.hero__name .row--indent { padding-left: clamp(0px, 12vw, 220px); }
.hero__period { font-family: var(--f-serif); color: var(--accent); font-weight: 400; letter-spacing: 0; margin-left: .02em; }
.char { display: inline-block; transform: translateY(105%); animation: rise 1.1s var(--ease) forwards; animation-delay: calc(.25s + var(--i) * .045s); }
@keyframes rise { to { transform: translateY(0); } }

.hero__foot { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: end; }
.hero__lede { margin: 0; max-width: 34ch; font-size: clamp(18px, 1.6vw, 23px); line-height: 1.45; color: var(--fg-2); }
.hero__lede em { color: var(--fg); font-size: 1.12em; }

.reveal-load { opacity: 0; transform: translateY(14px); animation: fadeUp 1s var(--d, 0s) var(--ease) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }

.pill svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform .35s var(--ease); }

.hero__scroll {
  position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%) rotate(90deg); transform-origin: right center;
  display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 10px;
}
.hero__scroll-line { width: 60px; height: 1px; background: var(--line-2); position: relative; overflow: hidden; }
.hero__scroll-line::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: translateX(-100%); animation: scan 2.2s var(--ease-io) infinite; }
@keyframes scan { to { transform: translateX(100%); } }

@media (max-width: 900px) {
  .hero__foot { gap: 28px; }
  .hero__scroll { display: none; }
  .hero__name { font-size: 21vw; }
  .hero__name .row--indent { padding-left: 8vw; }
  .hero__lede { text-shadow: 0 1px 12px var(--ink); }
}

/* ───────────────────────── SECTIONS ───────────────────────── */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(96px, 16vh, 180px) var(--gutter) 0; position: relative; }
.section__label { display: flex; align-items: center; gap: 12px; color: var(--muted); margin-bottom: 28px; }
.section__label span { color: var(--accent); }
.section__label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.display {
  font-size: clamp(2.4rem, 6.4vw, 6.2rem); font-weight: 700; line-height: .98; letter-spacing: -.04em;
  margin: 0 0 clamp(48px, 9vh, 100px); max-width: 16ch; text-wrap: balance;
}
.display em { color: var(--accent); font-size: 1.06em; }
.display--sm { font-size: clamp(2.1rem, 4.8vw, 4.6rem); max-width: 20ch; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-load { opacity: 1; transform: none; animation: none; transition: none; }
  .char { transform: none; animation: none; }
}

/* ABOUT */
.about__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px); align-items: start; }
.portrait { grid-column: 1 / span 5; margin: 0; position: sticky; top: 110px; }
.portrait__frame {
  position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 3 / 4;
  background: var(--ink-3); transform-style: preserve-3d;
  transition: transform .6s var(--ease);
  box-shadow: 0 50px 100px -50px rgba(0, 0, 0, .9), 0 0 0 1px var(--line);
}
.portrait__frame img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.85) contrast(1.04);
  transform: scale(1.06); transition: transform 1.2s var(--ease), filter .8s;
}
.portrait__frame:hover img { transform: scale(1.01); filter: saturate(1) contrast(1.02); }
.portrait__frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(10, 14, 12, .65), transparent 35%);
}
.portrait__tag { position: absolute; left: 14px; bottom: 14px; z-index: 1; font-size: 10px; color: var(--fg); padding: 6px 10px; border-radius: 999px; background: rgba(10, 14, 12, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid var(--line-2); }
.portrait figcaption { margin-top: 14px; color: var(--fg-2); font-size: 10px; }

.about__copy { grid-column: 7 / span 6; padding-top: 8px; }
.about__copy p { color: var(--fg-2); font-size: clamp(17px, 1.3vw, 19px); margin: 0 0 1.4em; max-width: 52ch; }
.about__copy .lead { font-size: clamp(22px, 2.2vw, 32px); line-height: 1.3; color: var(--fg); letter-spacing: -.015em; font-weight: 500; max-width: 26ch; }

.facts { margin: 48px 0 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.facts div { padding: 18px 0; border-bottom: 1px solid var(--line); }
.facts div:nth-child(odd) { padding-right: 16px; border-right: 1px solid var(--line); }
.facts div:nth-child(even) { padding-left: 16px; }
.facts dt { color: var(--muted); font-size: 10px; }
.facts dd { margin: 4px 0 0; color: var(--fg); font-family: var(--f-sans); text-transform: none; letter-spacing: -.01em; font-size: 16px; font-weight: 500; }

@media (max-width: 900px) {
  .portrait { grid-column: 1 / -1; position: relative; top: 0; max-width: 460px; }
  .about__copy { grid-column: 1 / -1; }
}

/* PRINCIPLES */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.card { padding: 36px clamp(20px, 2.4vw, 36px) 44px; position: relative; overflow: hidden; isolation: isolate; }
.card + .card { border-left: 1px solid var(--line); }
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(80% 60% at 50% 0%, rgba(255, 178, 63, .10), transparent 70%);
  opacity: 0; transition: opacity .6s var(--ease);
}
.card:hover::before { opacity: 1; }
.card__num { font-family: var(--f-serif); font-style: italic; font-size: 64px; line-height: 1; color: var(--accent); margin-bottom: 28px; }
.card__glyph { width: 120px; height: 40px; fill: none; stroke: var(--fg-2); stroke-width: 1.4; margin-bottom: 32px; overflow: visible; }
.card__glyph .fill { fill: var(--accent); stroke: none; }
.card__glyph polyline, .card__glyph path, .card__glyph line, .card__glyph rect, .card__glyph circle { stroke-dasharray: 260; stroke-dashoffset: 260; transition: stroke-dashoffset 1.8s var(--ease) .3s; }
.card__glyph path[stroke-dasharray] { stroke-dashoffset: 0; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -16; } }
.card.is-in .card__glyph * { stroke-dashoffset: 0; }
.card:hover .card__glyph { stroke: var(--accent); }
.card h3 { font-size: clamp(22px, 2vw, 28px); letter-spacing: -.025em; line-height: 1.1; margin: 0 0 14px; font-weight: 700; }
.card p { margin: 0; color: var(--fg-2); font-size: 16px; max-width: 36ch; }

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
  .card + .card { border-left: 0; border-top: 1px solid var(--line); }
}

/* WORK */
.jobs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.job {
  display: grid; grid-template-columns: 200px minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px 40px;
  padding: 40px 0; border-bottom: 1px solid var(--line); position: relative; isolation: isolate;
}
.job::before {
  content: ""; position: absolute; inset: 0 calc(var(--gutter) * -1); z-index: -1;
  background: linear-gradient(90deg, rgba(255, 178, 63, .07), transparent 70%);
  transform: scaleX(0); transform-origin: left; transition: transform .8s var(--ease);
}
.job:hover::before { transform: scaleX(1); }
.job__when { color: var(--muted); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 10.5px; }
.job__live { color: var(--leaf); display: inline-flex; align-items: center; gap: 8px; }
.job__co { font-size: clamp(2.4rem, 5.4vw, 5rem); line-height: 1; letter-spacing: -.045em; margin: 0; font-weight: 800; transition: color .4s, transform .6s var(--ease); }
.job:hover .job__co { color: var(--accent); transform: translateX(8px); }
.job__role { margin: 10px 0 0; color: var(--fg); font-weight: 500; }
.job__role span { color: var(--muted); font-weight: 400; }
.job__desc { margin: 0; padding-top: 14px; color: var(--fg-2); max-width: 42ch; }
.tags { grid-column: 3; list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 9.5px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--fg-2); }

@media (max-width: 900px) {
  .job { grid-template-columns: 1fr; padding: 32px 0; }
  .job__when { flex-direction: row; padding-top: 0; }
  .tags { grid-column: 1; }
  .job__desc { padding-top: 0; }
}

/* CONTACT */
.contact { padding-bottom: clamp(80px, 14vh, 160px); }
.contact__title { font-size: clamp(3rem, 9.5vw, 9.5rem); font-weight: 800; letter-spacing: -.055em; line-height: .92; margin: 0 0 56px; }
.contact__title em { color: var(--accent); font-size: 1.04em; letter-spacing: -.01em; }
.contact__links { display: flex; flex-wrap: wrap; gap: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 18px; padding: 20px 28px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 500;
  transition: background .3s, color .3s, transform .4s var(--ease), box-shadow .4s;
  box-shadow: 0 20px 50px -20px rgba(255, 178, 63, .5);
}
.pill .mono { font-size: 12px; font-weight: 500; }
.pill:hover { background: var(--fg); box-shadow: 0 20px 50px -20px rgba(234, 237, 230, .35); }
.pill:hover svg { transform: translate(2px, -2px); }
.pill--ghost { background: transparent; color: var(--fg); border: 1px solid var(--line-2); box-shadow: none; }
.pill--ghost:hover { background: var(--fg); color: var(--ink); }
.contact__note { margin-top: 48px; color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 12px; }
.contact__note [data-clock] { color: var(--fg); }

/* FOOTER */
.footer { border-top: 1px solid var(--line); overflow: hidden; }
.footer__big {
  font-size: clamp(6rem, 31vw, 34rem); font-weight: 900; letter-spacing: -.07em; line-height: .78;
  text-align: center; margin: 0 auto; padding-top: .08em;
  background: linear-gradient(180deg, var(--ink-3) 0%, var(--ink) 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  user-select: none; transform: translateY(.06em);
}
.footer__row { position: relative; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px var(--gutter); color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }
.footer__row a:hover { color: var(--accent); }

/* PROJECTS */
.projects__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.project__link {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center;
  padding: clamp(24px, 3.4vw, 48px); border-radius: 22px; border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--ink-2), var(--ink) 70%);
  position: relative; overflow: hidden; isolation: isolate;
  transition: border-color .5s, transform .6s var(--ease);
}
.project__link::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 80% at 85% 50%, rgba(255, 178, 63, .12), transparent 70%);
  opacity: .5; transition: opacity .6s var(--ease);
}
.project__link:hover { border-color: var(--line-2); }
.project__link:hover::before { opacity: 1; }
.project__meta { color: var(--muted); margin: 0 0 18px; display: flex; gap: 12px; }
.project__meta span { color: var(--accent); }
.project__name { font-size: clamp(2.4rem, 5vw, 4.6rem); font-weight: 800; letter-spacing: -.045em; line-height: 1; margin: 0 0 22px; }
.project__name span { color: var(--muted); font-weight: 500; transition: color .4s; }
.project__link:hover .project__name span { color: var(--accent); }
.project__desc { color: var(--fg-2); margin: 0 0 24px; max-width: 46ch; }
.project .tags { grid-column: auto; margin: 0 0 32px; }
.project__cta { display: inline-flex; align-items: center; gap: 12px; color: var(--fg); padding-bottom: 6px; border-bottom: 1px solid var(--accent); }
.project__cta svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform .35s var(--ease); }
.project__link:hover .project__cta svg { transform: translate(3px, -3px); }

/* illustrated CV sheet */
.project__visual { position: relative; aspect-ratio: 5 / 4; display: grid; place-items: center; }
.sheet {
  position: relative; width: min(62%, 330px); aspect-ratio: 210 / 297; border-radius: 6px;
  background: #f3f1ec; padding: 9% 8%; display: flex; flex-direction: column; gap: 9%;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .2);
  transform: rotate(-4deg); transition: transform .8s var(--ease);
}
.sheet--back { position: absolute; background: #2a332e; box-shadow: none; transform: rotate(5deg) translate(8%, 2%); opacity: .7; padding: 0; }
.project__link:hover .sheet:not(.sheet--back) { transform: rotate(-1deg) translateY(-6px); }
.project__link:hover .sheet--back { transform: rotate(8deg) translate(12%, 3%); }
.sheet__head { border-left: 4px solid #e0392b; padding-left: 8%; display: grid; gap: 7px; }
.sheet__name { height: 14px; width: 70%; background: #1c1f1d; border-radius: 2px; }
.sheet__role { height: 6px; width: 45%; background: #e0392b; opacity: .8; border-radius: 2px; }
.sheet__cols { display: grid; grid-template-columns: 1fr 2fr; gap: 10%; flex: 1; }
.sheet__side, .sheet__main { display: flex; flex-direction: column; gap: 6px; }
.sheet i, .sheet b { display: block; height: 4px; border-radius: 2px; background: #c9c6be; }
.sheet i.s { width: 60%; }
.sheet b { height: 6px; width: 50%; background: #1c1f1d; margin-top: 8px; }
.sheet b:first-child { margin-top: 0; }
.chip {
  position: absolute; left: 4%; bottom: 14%; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: 999px; font-size: 9.5px; color: var(--fg);
  background: rgba(15, 21, 18, .8); border: 1px solid var(--line-2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .8s var(--ease);
}
.chip--2 { left: auto; right: 6%; bottom: auto; top: 12%; color: var(--fg-2); }
.chip__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--leaf); }
.project__link:hover .chip { transform: translateY(-6px); }
.project__link:hover .chip--2 { transform: translateY(6px); }

@media (max-width: 900px) {
  .project__link { grid-template-columns: 1fr; }
  .project__visual { order: -1; }
}
