/* ==========================================================================
   friehe.me — draft
   Palette and geometry derive from the TF tangram mark.
   ========================================================================== */

:root {
  /* Base */
  --paper:      #ffffff;
  --paper-tint: #f4f6fb;
  --ink:        #191c2e;
  --ink-soft:   #5b6178;
  --ink-faint:  #8f94a6;
  --line:       #e3e6ef;

  /* TF mark */
  --cyan:    #009eda;
  --navy:    #313687;
  --magenta: #e61c7e;
  --purple:  #9c2c8b;
  --red:     #e8313e;
  --orange:  #f08031;
  --yellow:  #fce933;
  --lime:    #90bf49;
  --green:   #129b53;

  /* Per-page atmosphere, overridden below */
  --wash-a: 0, 158, 218;
  --wash-b: 230, 28, 126;
  --wash-c: 240, 128, 49;

  --shell: 1240px;
  --gut: clamp(1.25rem, 4vw, 3.5rem);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------------------------------------------------------------- font -- */

@font-face {
  font-family: "Rethink Sans";
  src: url("../fonts/RethinkSans-Variable.woff2") format("woff2-variations"),
       url("../fonts/RethinkSans-VariableFont_wght.ttf") format("truetype-variations");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------- reset -- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Rethink Sans", ui-sans-serif, system-ui, -apple-system,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.025em; }

h1 {
  font-size: clamp(2.35rem, 6.4vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.036em;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.14;
  letter-spacing: -0.028em;
}

h3 { font-size: 1.1875rem; line-height: 1.3; }

p { margin: 0 0 1.35em; }

::selection { background: rgba(49, 54, 135, .16); }

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: .75rem 1rem;
  z-index: 200;
}
.skip:focus { left: 0; }

/* -------------------------------------------------------------- header -- */

.head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.05rem, 2.2vw, 1.6rem) var(--gut);
  transition: background-color .45s var(--ease), border-color .45s var(--ease),
              backdrop-filter .45s var(--ease), padding .45s var(--ease);
  border-bottom: 1px solid transparent;
}

.head--solid.is-stuck {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--line);
  padding-block: .85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: -0.01em;
}

.brand img {
  height: 38px;
  width: auto;
  transition: height .45s var(--ease);
}
.head--solid.is-stuck .brand img { height: 32px; }

.brand span { display: none; }

/* Nav */

.nav { display: flex; align-items: center; gap: clamp(1.1rem, 2.4vw, 2.1rem); }

.nav__link {
  position: relative;
  text-decoration: none;
  font-size: .9375rem;
  font-weight: 500;
  letter-spacing: -0.008em;
  padding-block: .35rem;
  color: var(--ink);
  opacity: .72;
  transition: opacity .3s var(--ease), color .3s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}
.nav__link--copy {
  border: 0;
  background: none;
  padding-inline: 0;
  font: inherit;
  font-size: .9375rem;
  font-weight: 500;
  letter-spacing: -0.008em;
  cursor: pointer;
}

.nav__link:hover { opacity: 1; }
.nav__link:hover::after { transform: scaleX(1); }

.nav__link[aria-current="page"] { opacity: 1; }
.nav__link[aria-current="page"]::after {
  transform: scaleX(1);
  background: linear-gradient(90deg, var(--cyan), var(--navy) 30%, var(--magenta) 62%, var(--orange));
  height: 2px;
}

/* Header over photography */

.head--overlay .brand,
.head--overlay .nav__link { color: #fff; }

.head--overlay .brand img { filter: drop-shadow(0 2px 12px rgba(0, 0, 0, .5)); }
.head--overlay .nav__link { opacity: .82; }
.head--overlay .nav__link:hover { opacity: 1; }

/* Mobile menu */

.burger {
  display: none;
  width: 42px;
  height: 42px;
  margin-right: -8px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}
.burger i {
  display: block;
  height: 1.5px;
  background: currentColor;
  margin: 5px auto;
  width: 22px;
  transition: transform .4s var(--ease), opacity .25s var(--ease);
}
body.menu-open .burger i:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.menu-open .burger i:nth-child(2) { opacity: 0; }
body.menu-open .burger i:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 880px) {
  .burger { display: block; color: var(--ink); }
  .head--overlay .burger { color: #fff; }
  body.menu-open .burger { color: var(--ink); }

  .nav {
    position: fixed;
    inset: 0;
    background: var(--paper);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: .35rem;
    padding: 0 var(--gut);
    opacity: 0;
    visibility: hidden;
    transition: opacity .45s var(--ease), visibility .45s;
  }
  body.menu-open .nav { opacity: 1; visibility: visible; }

  .nav__link,
  .head--overlay .nav__link {
    color: var(--ink);
    font-size: clamp(1.9rem, 8vw, 2.6rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    padding-block: .3rem;
    transform: translateY(14px);
    opacity: 0;
    transition: transform .55s var(--ease), opacity .55s var(--ease);
  }
  body.menu-open .nav__link { transform: none; opacity: 1; }
  body.menu-open .nav__link:nth-child(1) { transition-delay: .06s; }
  body.menu-open .nav__link:nth-child(2) { transition-delay: .11s; }
  body.menu-open .nav__link:nth-child(3) { transition-delay: .16s; }
  body.menu-open .nav__link:nth-child(4) { transition-delay: .21s; }
  body.menu-open .nav__link:nth-child(5) { transition-delay: .26s; }
  .nav__link::after { display: none; }
  .nav__link[aria-current="page"] { color: var(--navy); }
}

/* ======================================================== home: carousel */

body.home {
  height: 100dvh;
  overflow: hidden;
  background: #0b0d18;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 1.5s var(--ease);
  will-change: opacity;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.005);
  transition: transform 9s linear;
}
.slide.is-active { opacity: 1; }
.slide.is-active img { transform: scale(1.075); }

.stage__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(10, 12, 24, .58) 0%, rgba(10, 12, 24, 0) 26%),
    linear-gradient(to top, rgba(8, 10, 20, .78) 0%, rgba(8, 10, 20, .18) 38%, rgba(8, 10, 20, 0) 62%);
}

/* A breath of the mark's colour, shifting with each frame */
.stage__hue {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: .55;
  background: radial-gradient(120% 90% at 18% 88%, rgba(var(--hue), .9), transparent 62%);
  transition: background 1.5s var(--ease);
  --hue: 0, 158, 218;
}

.hero {
  position: relative;
  z-index: 10;
  height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--gut) clamp(2.5rem, 7vh, 4.5rem);
  color: #fff;
  pointer-events: none;
}

.hero__inner { max-width: 48rem; }

.hero h1 { color: #fff; }

.hero__line {
  margin: 1.15rem 0 0;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.55;
  color: rgba(255, 255, 255, .8);
  max-width: 34rem;
}

.hero__line a {
  pointer-events: auto;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .38);
  padding-bottom: 1px;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.hero__line a:hover { border-bottom-color: #fff; color: #fff; }

/* Frame indicators */

.ticks {
  position: fixed;
  z-index: 20;
  right: var(--gut);
  bottom: clamp(2.5rem, 7vh, 4.5rem);
  display: flex;
  gap: .55rem;
  align-items: center;
}

.tick {
  appearance: none;
  border: 0;
  background: none;
  padding: 10px 0;
  cursor: pointer;
  width: 44px;
}
.tick i {
  display: block;
  height: 2px;
  background: rgba(255, 255, 255, .34);
  position: relative;
  overflow: hidden;
}
.tick i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tick, #fff);
  transform: scaleX(0);
  transform-origin: left;
}
.tick.is-active i::after {
  transform: scaleX(1);
  transition: transform 6.5s linear;
}

/* ================================================= interior page shapes */

.page { padding-top: clamp(7rem, 14vh, 10.5rem); }

.page-hero {
  position: relative;
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

.page-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -12vw;
  right: -12vw;
  top: -32vh;
  height: 88vh;
  pointer-events: none;
  background:
    radial-gradient(38% 52% at 16% 62%, rgba(var(--wash-a), .20), transparent 68%),
    radial-gradient(34% 46% at 55% 34%, rgba(var(--wash-b), .15), transparent 70%),
    radial-gradient(40% 55% at 88% 60%, rgba(var(--wash-c), .17), transparent 68%);
}

.page-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto -12vw 0 -12vw;
  height: 40vh;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--paper) 78%);
  pointer-events: none;
}

.eyebrow-none { display: none; }

.lede {
  margin: clamp(1.4rem, 3vw, 2.1rem) 0 0;
  max-width: 40ch;
  font-weight: 500;
  font-size: clamp(1.2rem, 2.1vw, 1.55rem);
  line-height: 1.42;
  letter-spacing: -0.018em;
  color: var(--ink-soft);
}

/* Body copy column */

.prose {
  max-width: 63ch;
  font-size: clamp(1.0625rem, 1.35vw, 1.1875rem);
  line-height: 1.76;
  color: #23273a;
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

.prose > h2 { margin: 2.9em 0 .7em; }
.prose > h2:first-child { margin-top: 0; }
.prose a {
  text-decoration: none;
  border-bottom: 1px solid rgba(25, 28, 46, .28);
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.prose a:hover { border-bottom-color: var(--navy); color: var(--navy); }

.prose__lead {
  font-size: 1.2em;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 1.6em;
}

.rule {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: clamp(2.4rem, 5vw, 3.6rem) 0;
  max-width: 63ch;
}

/* Figures */

.figure { margin: clamp(2.4rem, 5vw, 3.75rem) 0; }
.figure img { width: 100%; height: auto; }
.figure figcaption {
  margin-top: .8rem;
  font-size: .875rem;
  color: var(--ink-faint);
}

.figure--wide { max-width: none; }
.figure--portrait { max-width: 30rem; }

/* Video embeds. preload="none" in the markup means nothing but the poster is
   fetched until someone presses play -- the files are ~22 MB each. */
.figure--video { max-width: 52rem; }
.figure--video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 2px;
}

.ph {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background:
    linear-gradient(128deg,
      rgba(0, 158, 218, .16) 0%,
      rgba(49, 54, 135, .14) 24%,
      rgba(230, 28, 126, .12) 47%,
      rgba(240, 128, 49, .15) 70%,
      rgba(144, 191, 73, .16) 100%),
    var(--paper-tint);
}
.ph span {
  font-size: .875rem;
  font-weight: 500;
  color: rgba(25, 28, 46, .5);
  letter-spacing: -0.005em;
}
.ph--tall { aspect-ratio: 4 / 5; }

/* Project index */

.entries { max-width: 63ch; }

.entry {
  display: block;
  text-decoration: none;
  padding: clamp(1.5rem, 3vw, 2.1rem) 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.entry:last-child { border-bottom: 1px solid var(--line); }

.entry__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}
.entry__years {
  font-size: .9rem;
  color: var(--ink-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.entry p { margin: .55rem 0 0; color: var(--ink-soft); font-size: 1rem; }

.entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--magenta) 50%, var(--orange));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .55s var(--ease);
}
a.entry:hover::before { transform: scaleX(1); }
a.entry:hover h2 { color: var(--navy); }
a.entry h2 { transition: color .3s var(--ease); }

/* -------------------------------------------------------------- footer -- */

.foot {
  border-top: 1px solid var(--line);
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 5vw, 3rem);
  font-size: .9375rem;
  color: var(--ink-soft);
}

.foot__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem 3rem;
  align-items: flex-start;
  justify-content: space-between;
}

.foot__links { display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; }

.foot a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.foot a:hover { color: var(--ink); border-bottom-color: currentColor; }

.foot__note { color: var(--ink-faint); font-size: .875rem; }

/* -------------------------------------------------------------- motion -- */

/* Page enters on load, leaves on navigation */
body { animation: pageIn .5s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

body.is-leaving {
  animation: none;
  opacity: 0;
  transition: opacity .28s var(--ease);
}

/* One orchestrated reveal per screen. Only applied when scripting is on. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

.page-hero [data-reveal]:nth-child(1) { transition-delay: .05s; }
.page-hero [data-reveal]:nth-child(2) { transition-delay: .16s; }

/* The hero releases as you read past it */
.page-hero { transition: opacity .3s linear; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .slide { transition: opacity .001ms; }
  .slide.is-active img { transform: none; }
  .js [data-reveal] { opacity: 1; transform: none; }
  body { animation: none; }
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 620px) {
  .ticks { bottom: 1.9rem; }
  .tick { width: 34px; }
  .hero { padding-bottom: 4.75rem; }
  .foot__grid { flex-direction: column; }
}

/* ------------------------------------------------------------- contact -- */

.form {
  max-width: 34rem;
  margin: 0;
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

.field { margin-bottom: 1.85rem; }

.field label {
  display: block;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: .5rem;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: .55rem 0;
  transition: border-color .3s var(--ease);
}

.field input:hover,
.field textarea:hover { border-bottom-color: #c9cede; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--navy);
}

.field textarea { resize: vertical; min-height: 8.5rem; line-height: 1.65; }

/* Bot trap. Never shown, never focusable. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: #fff;
  background: var(--ink);
  padding: .85rem 1.75rem;
  border-radius: 2px;
  transition: background-color .3s var(--ease), transform .3s var(--ease);
}
.btn:hover { background: var(--navy); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: default; }

.form__status {
  margin: 1.25rem 0 0;
  font-size: .9375rem;
  color: var(--ink-soft);
  min-height: 1.4em;
}
.form__status[data-state="error"] { color: var(--red); }
.form__status[data-state="sent"] { color: var(--green); }
