/* fliip — main stylesheet
   One family (Mona Sans, variable weight + width), graphite and paper, one signal colour. */

@font-face {
  font-family: "Mona Sans";
  src: url("../fonts/mona-sans-var.woff2") format("woff2-variations"),
       url("../fonts/mona-sans-var.woff2") format("woff2");
  font-weight: 360 700;
  font-stretch: 100% 116%;
  font-style: normal;
  font-display: swap;
}

/* Metric-matched fallback to keep layout steady while the font loads */
@font-face {
  font-family: "Mona Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 106%;
  ascent-override: 103%;
  descent-override: 30%;
  line-gap-override: 0%;
}

:root {
  /* colour */
  --graphite: #111316;
  --graphite-2: #191c20;
  --ink: #eceae4;
  --ink-2: #a3a6aa;
  --ink-3: #8c9095;
  --rule: rgba(236, 234, 228, 0.12);

  --paper: #e7e7e2;
  --paper-ink: #15171a;
  --paper-ink-2: #5b5f66;
  --paper-rule: rgba(21, 23, 26, 0.16);

  --signal: #ffb547;
  --signal-deep: #a15f00;

  /* type */
  --font: "Mona Sans", "Mona Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wide: 113%;
  --fs-hero: clamp(3.6rem, 8.6vw, 9rem);
  --fs-cap: clamp(2.5rem, 5.6vw, 6rem);
  --fs-statement: clamp(2.5rem, 6.1vw, 7.25rem);
  --fs-lede: clamp(1.0625rem, 0.95rem + 0.42vw, 1.375rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;

  /* space */
  --margin: clamp(1.25rem, 4.6vw, 5rem);
  --gutter: clamp(1rem, 1.8vw, 2rem);
  --section: clamp(6rem, 13vw, 12.5rem);
  --max: 1680px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-flip: cubic-bezier(0.7, 0, 0.2, 1);

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--graphite);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--graphite);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  font-stretch: 100%;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

::selection { background: var(--signal); color: var(--graphite); }

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

.shell {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: max(var(--margin), env(safe-area-inset-left)) max(var(--margin), env(safe-area-inset-right));
}

.skip {
  position: absolute;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: var(--signal);
  color: var(--graphite);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease-out);
}
.skip:focus { transform: none; }

/* ---------------------------------------------------------------- wordmark */

.wordmark { width: auto; height: 100%; overflow: visible; fill: currentColor; }
.wordmark .wm-dot--signal { fill: var(--signal); }

.wm-i {
  transform-box: view-box;
  transition: transform 0.75s var(--ease-flip);
}
.wm-i--a { transform-origin: 789.9px -269.3px; }
.wm-i--b { transform-origin: 1059.9px -269.3px; }

/* The bit flips: both i's turn over, like a pair of meshed gears.
   With JavaScript, every hover, tap or keyboard focus turns them a further half-turn
   (see main.js). Without it, hover flips and returns. */
html:not(.js) .brand:hover .wm-i--a,
html:not(.js) .brand:focus-visible .wm-i--a { transform: rotate(180deg); }
html:not(.js) .brand:hover .wm-i--b,
html:not(.js) .brand:focus-visible .wm-i--b { transform: rotate(-180deg); }
.brand { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.brand .wordmark { overflow: visible; }

/* ---------------------------------------------------------------- masthead */

.masthead {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: clamp(4.5rem, 8vw, 6.5rem);
  padding-top: env(safe-area-inset-top);
}

.brand {
  display: block;
  height: clamp(1.45rem, 1.15rem + 0.7vw, 1.85rem);
  color: var(--ink);
}

.masthead__link,
.footer__mail {
  position: relative;
  display: inline-block;
  padding-block: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  font-stretch: 106%;
  letter-spacing: 0.005em;
}

.masthead__link::after,
.footer__mail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.3rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease-out);
}
.masthead__link:hover::after,
.footer__mail:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* -------------------------------------------------------------------- hero */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: 7rem;
  padding-bottom: clamp(2.25rem, 6.5vh, 5.5rem);
  overflow: hidden;
  isolation: isolate;
}

.hero__field {
  position: absolute;
  inset: 0;
  z-index: -1;
  will-change: transform;
}

.field {
  display: block;
  width: 100%;
  height: 100%;
}

.hero__content {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: end;
}

.hero__kicker {
  grid-column: 1 / -1;
  margin-bottom: clamp(1.25rem, 2.4vw, 2rem);
  color: var(--ink-2);
  font-size: var(--fs-small);
  font-weight: 500;
  font-stretch: 108%;
  letter-spacing: 0.03em;
}
.hero__kicker span { color: var(--ink-3); opacity: 0.6; padding-inline: 0.15em; }

.hero__title {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: var(--fs-hero);
  font-weight: 430;
  font-stretch: var(--wide);
  line-height: 0.9;
  letter-spacing: -0.048em;
  text-wrap: balance;
}
.hero__title .w { display: inline-block; }
.hero__title .w3 { display: block; }

.hero__lede {
  grid-column: 1 / span 10;
  grid-row: 3;
  max-width: 31ch;
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--ink-2);
  font-size: var(--fs-lede);
  line-height: 1.5;
  text-wrap: pretty;
}

/* Wide screens: the lede sits beside the last line of the headline. */
@media (min-width: 1180px) {
  .hero__lede {
    grid-column: 10 / span 3;
    grid-row: 2;
    justify-self: start;
    max-width: 24ch;
    margin-top: 0;
    padding-bottom: 0.4rem;
    font-size: clamp(1.0625rem, 0.6rem + 0.55vw, 1.3125rem);
  }
}

/* One orchestrated entrance: the type settles while the field organises. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__kicker,
  .js .hero__title .w,
  .js .hero__lede,
  .js .masthead {
    animation: settle 1.2s var(--ease-out) both;
  }
  .js .masthead { animation-name: fade; animation-delay: 0.1s; }
  .js .hero__kicker { animation-delay: 0.35s; }
  .js .hero__title .w1 { animation-delay: 0.45s; }
  .js .hero__title .w2 { animation-delay: 0.55s; }
  .js .hero__title .w3 { animation-delay: 0.68s; }
  .js .hero__lede { animation-delay: 1.05s; }
}

@keyframes settle {
  from { opacity: 0; transform: translateY(0.35em); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ------------------------------------------------------------ what we create */

.create {
  position: relative;
  padding-block: var(--section);
  background: var(--paper);
  color: var(--paper-ink);
  color-scheme: light;
}

.create :focus-visible { outline-color: var(--signal-deep); }

.create__title {
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
  color: var(--paper-ink-2);
  font-size: var(--fs-small);
  font-weight: 500;
  font-stretch: 108%;
  letter-spacing: 0.03em;
}

.create__list { border-bottom: 1px solid var(--paper-rule); }

.cap {
  display: grid;
  grid-template-columns: clamp(3.25rem, 4.9vw, 5rem) minmax(0, 1fr) minmax(15rem, 23rem);
  align-items: center;
  column-gap: clamp(1.25rem, 3vw, 3.5rem);
  padding-block: clamp(1.75rem, 3.6vw, 3.25rem);
  border-top: 1px solid var(--paper-rule);
}

.glyph {
  width: 100%;
  height: auto;
  color: var(--paper-ink);
  overflow: visible;
}
.glyph line {
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 1.1s var(--ease-out), opacity 0.6s ease;
}
.glyph .g-signal { stroke: var(--signal-deep); }
.glyph .g-dim { opacity: 0.32; }
.glyph circle { fill: none; stroke: currentColor; stroke-width: 1.4; }
.glyph circle.g-core { fill: var(--signal-deep); stroke: none; }

.cap__name {
  font-size: var(--fs-cap);
  font-weight: 430;
  font-stretch: var(--wide);
  line-height: 1;
  letter-spacing: -0.045em;
  padding-bottom: 0.06em;
}

.cap__text {
  max-width: 26ch;
  color: var(--paper-ink-2);
  font-size: clamp(1rem, 0.94rem + 0.2vw, 1.125rem);
  line-height: 1.5;
  text-wrap: pretty;
}

/* ----------------------------------------------------------------- closing */

.closing {
  position: relative;
  padding-bottom: clamp(5rem, 10vw, 9rem);
}

.closing__field {
  height: clamp(9rem, 20vw, 19rem);
  margin-bottom: clamp(2.5rem, 6vw, 5.5rem);
}

.closing__inner {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}

.closing__title {
  grid-column: 1 / span 10;
  max-width: 15.5ch;
  font-size: var(--fs-statement);
  font-weight: 430;
  font-stretch: var(--wide);
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.closing__invite {
  grid-column: 7 / span 6;
  margin-top: clamp(3rem, 7vw, 6.5rem);
}

.closing__invite p {
  max-width: 30ch;
  color: var(--ink-2);
  font-size: var(--fs-lede);
  line-height: 1.5;
}

.mail {
  position: relative;
  display: inline-block;
  margin-top: 1.1rem;
  padding-bottom: 0.3rem;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  font-weight: 460;
  font-stretch: var(--wide);
  letter-spacing: -0.03em;
  line-height: 1.15;
  transition: color 0.3s ease;
}
.mail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--rule);
}
.mail::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out);
}
.mail:hover { color: #fff; }
.mail:hover::before,
.mail:focus-visible::before { transform: scaleX(1); }

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

.footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1.75rem;
  padding-bottom: max(1.75rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: var(--fs-small);
}
.footer__brand { display: block; height: 1.15rem; width: max-content; color: var(--ink); }
.footer__mail { color: var(--ink-2); font-size: var(--fs-small); }
.footer__mail:hover { color: var(--ink); }
.footer__legal { justify-self: end; font-stretch: 106%; }

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

/* Tablets and small laptops: no side lede, so the headline can grow. */
@media (min-width: 760px) and (max-width: 1179px) {
  :root { --fs-hero: clamp(4.5rem, 10.6vw, 7.75rem); }
  .hero__lede { max-width: 34ch; }
}

@media (max-width: 1023px) {
  .cap {
    grid-template-columns: clamp(3rem, 6vw, 4rem) minmax(0, 1fr);
    row-gap: 0.9rem;
  }
  .cap__text { grid-column: 2; }
  .closing__invite { grid-column: 1 / -1; }
}

@media (max-width: 759px) {
  :root {
    --fs-hero: clamp(3.1rem, 16.6vw, 5.5rem);
    --fs-cap: clamp(2.2rem, 10.2vw, 3.5rem);
    --fs-statement: clamp(2.35rem, 10.4vw, 3.75rem);
  }

  .hero { padding-bottom: clamp(1.75rem, 5vh, 2.75rem); }
  .hero__title { line-height: 0.92; }
  .hero__title .w { display: block; }
  .hero__lede { grid-column: 1 / -1; max-width: 28ch; margin-top: 1.5rem; }
  .hero__kicker { margin-bottom: 1.1rem; }

  .cap {
    grid-template-columns: minmax(0, 1fr) 2.75rem;
    align-items: start;
    row-gap: 0.75rem;
    padding-block: 1.75rem 2rem;
  }
  .cap .glyph { grid-column: 2; grid-row: 1; margin-top: 0.35rem; }
  .cap__name { grid-column: 1; grid-row: 1; }
  .cap__text { grid-column: 1 / -1; grid-row: 2; }

  .closing__title { grid-column: 1 / -1; }
  .closing__invite { margin-top: 3rem; }

  .footer {
    grid-template-columns: 1fr auto;
    row-gap: 1.1rem;
  }
  .footer__mail { grid-column: 1; grid-row: 2; justify-self: start; }
  .footer__legal { grid-column: 2; grid-row: 2; }
}

/* Landscape phones: keep the headline within the screen */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --fs-hero: clamp(2.6rem, 7vw, 4.5rem); }
  .hero { padding-top: 5rem; }
}

@media (prefers-contrast: more) {
  :root { --ink-2: #c9cbce; --ink-3: #b4b7bb; --paper-ink-2: #3c3f45; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .field { display: none; }
  .wordmark, .glyph { forced-color-adjust: auto; }
}

/* --------------------------------------------------------------- not found */

.notfound__main {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding-bottom: clamp(3rem, 10vh, 7rem);
}
.notfound__title {
  max-width: 12ch;
  font-size: var(--fs-statement);
  font-weight: 430;
  font-stretch: var(--wide);
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.notfound__text { margin-top: 2rem; }
