/* ==========================================================================
   NUE by Maja Pocajt, coming soon page
   ========================================================================== */

/* Fonts (self-hosted, SIL Open Font License, see assets/fonts) */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/cormorant-garamond-latin-ext-400-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/cormorant-garamond-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../assets/fonts/jost-latin-300-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../assets/fonts/jost-latin-ext-300-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Brand tokens (from the NUE brand board) */

:root {
  --ivory: #f9f6ef;
  --cream: #eadccb;
  --taupe: #c9b7a7;
  --nude: #d6a896;
  --blue-green: #7f9d9a;
  --teal: #2f5e60;

  --ink: #3a3733;
  --ink-soft: #57514b;
  --paper: #ece6df;

  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --sans: "Jost", "Futura", "Century Gothic", "Helvetica Neue", Arial, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Pointer position, -1 to 1, written by main.js */
  --px: 0;
  --py: 0;
}

/* Base */

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

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.4;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

p,
h1 {
  margin: 0;
}

/* ==========================================================================
   Background scene
   ========================================================================== */

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.scene__bg {
  position: absolute;
  inset: -40px;
  transform: translate3d(calc(var(--px) * -14px), calc(var(--py) * -10px), 0);
  will-change: transform;
}

.scene__drift,
.scene__drift picture {
  position: absolute;
  inset: 0;
}

.scene__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

/* A soft pool of light that slowly wanders over the paper */
.scene__light {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 80vmax;
  height: 80vmax;
  margin: -40vmax 0 0 -40vmax;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255, 253, 248, 0.62) 0%, rgba(255, 253, 248, 0.22) 38%, rgba(255, 253, 248, 0) 66%);
  translate: calc(var(--px) * 3vw) calc(var(--py) * 3vh);
  will-change: transform;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding:
    max(clamp(22px, 3.6vw, 48px), env(safe-area-inset-top))
    max(clamp(20px, 4vw, 56px), env(safe-area-inset-right))
    max(clamp(22px, 3.6vw, 44px), env(safe-area-inset-bottom))
    max(clamp(20px, 4vw, 56px), env(safe-area-inset-left));
}

/* Top line */

.topline {
  display: flex;
  justify-content: center;
  text-align: center;
}

.eyebrow {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.32em;
  /* balances the trailing letter-spacing so the line stays centred */
  padding-left: 0.32em;
  text-transform: uppercase;
  color: var(--ink);
}

.eyebrow::after {
  content: "";
  display: block;
  width: 30px;
  height: 1px;
  margin: 14px auto 0;
  background: currentColor;
  opacity: 0.55;
}

/* Hero */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(20px, 5vh, 80px) 0;
  translate: calc(var(--px) * 5px) calc(var(--py) * 4px);
}

.hero__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: normal;
}

.logo {
  display: block;
  width: min(540px, 76vw);
  height: auto;
  overflow: visible;
}

.logo__letter {
  fill: var(--teal);
  stroke: var(--teal);
  stroke-width: 0;
}

.logo__sheen {
  transform: translateX(0);
}

.hero__rule {
  display: block;
  width: 68px;
  height: 1px;
  margin: clamp(26px, 3.4vw, 38px) 0 clamp(18px, 2.4vw, 26px);
  background: var(--teal);
  opacity: 0.6;
}

.hero__by {
  display: block;
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(14px, 1.45vw, 19px);
  line-height: 1.3;
  letter-spacing: 0.42em;
  /* balances the trailing letter-spacing so the line stays centred */
  padding-left: 0.42em;
  color: var(--ink);
  white-space: nowrap;
}

.hero__name {
  text-transform: uppercase;
}

.hero__slogan {
  margin-top: clamp(18px, 2.4vw, 28px);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 31px);
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}

.word {
  display: inline-block;
}

/* Instagram link */

.social {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(20px, 2.8vw, 34px);
  padding: 12px 8px;
  color: var(--ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.social__label {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.32em;
  /* removes the trailing letter-spacing so both sides of the rule match */
  margin-right: -0.32em;
  text-transform: uppercase;
}

.social__rule {
  display: block;
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}

.social__handle {
  position: relative;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.2;
  color: var(--teal);
}

.social__handle::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.social:hover .social__rule,
.social:focus-visible .social__rule {
  width: 40px;
  opacity: 0.7;
}

.social:hover .social__handle::after,
.social:focus-visible .social__handle::after {
  transform: scaleX(1);
}

.social:focus-visible {
  outline: 1px solid var(--teal);
  outline-offset: 4px;
}

/* Coming soon */

.soon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2vw, 24px);
  color: var(--ink);
}

.soon__line {
  display: block;
  width: clamp(36px, 11vw, 170px);
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}

.soon__text {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(12.5px, 1.05vw, 15px);
  letter-spacing: 0.38em;
  padding-left: 0.38em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .soon__text {
    background-image: linear-gradient(100deg, var(--ink) 0%, var(--ink) 42%, var(--blue-green) 50%, var(--ink) 58%, var(--ink) 100%);
    background-size: 300% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

/* Small screens */

@media (max-width: 640px) {
  .eyebrow {
    font-size: 11px;
    letter-spacing: 0.28em;
    padding-left: 0.28em;
  }

  .eyebrow::after {
    margin: 12px auto 0;
  }

  .hero__by {
    letter-spacing: 0.34em;
    padding-left: 0.34em;
  }

  .soon__text {
    letter-spacing: 0.3em;
    padding-left: 0.3em;
  }
}

/* Short landscape screens (phones turned sideways) */

@media (max-height: 480px) and (orientation: landscape) {
  .hero {
    padding: 14px 0;
  }

  .logo {
    width: min(320px, 40vw);
  }

  .hero__rule {
    margin: 14px 0 10px;
  }

  .hero__slogan {
    margin-top: 10px;
  }

  .social {
    margin-top: 4px;
    padding: 8px;
  }
}

/* ==========================================================================
   Motion
   Everything above is the finished, static page. The intro and the
   ambient movement below only run for visitors who have not asked their
   system to reduce motion.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {

  /* Background: paper fades in and settles, then breathes very slowly */

  .scene__img {
    animation: bg-in 3s var(--ease-out) 0.05s both;
  }

  .is-waiting .scene__img {
    animation-play-state: paused;
  }

  .scene__drift {
    animation: bg-drift 28s ease-in-out 3s infinite alternate;
  }

  .scene__light {
    animation:
      fade-in 3.2s ease-out 0.4s both,
      light-wander 26s ease-in-out 0.4s infinite alternate;
  }

  /* Logo: each letter is drawn as a hairline, gathers into place, then fills with ink */

  .logo__letter {
    stroke-width: 2.4;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    fill-opacity: 0;
    animation:
      draw 2s var(--ease-in-out) var(--draw-delay) both,
      ink 1.4s ease-out var(--ink-delay) both,
      gather 2.6s var(--ease-out) var(--draw-delay) both;
  }

  .logo__letter--n {
    --draw-delay: 0.35s;
    --ink-delay: 1.95s;
    --gather-x: -26px;
  }

  .logo__letter--u {
    --draw-delay: 0.52s;
    --ink-delay: 2.1s;
    --gather-x: 0px;
  }

  .logo__letter--e {
    --draw-delay: 0.69s;
    --ink-delay: 2.25s;
    --gather-x: 26px;
  }

  /* A slow satin sheen passes over the letters every few seconds */

  .logo__sheen {
    animation: sheen 9s cubic-bezier(0.45, 0, 0.2, 1) 3.9s infinite;
  }

  /* Rule, name and slogan */

  .hero__rule {
    transform-origin: 50% 50%;
    animation: rule-in 1.5s var(--ease-out) 2.4s both;
  }

  .hero__by {
    animation: track-in 2s var(--ease-out) 2.6s both;
  }

  .word {
    animation: word-in 1.5s var(--ease-out) both;
  }

  .word:nth-child(1) { animation-delay: 3.05s; }
  .word:nth-child(2) { animation-delay: 3.2s; }
  .word:nth-child(3) { animation-delay: 3.4s; }
  .word:nth-child(4) { animation-delay: 3.55s; }

  .social {
    animation: rise-in 1.6s var(--ease-out) 3.85s both;
  }

  .social__rule {
    transition: width 0.6s var(--ease-out), opacity 0.6s var(--ease-out);
  }

  .social__handle::after {
    transition: transform 0.7s var(--ease-out);
  }

  /* Frame: top line and coming soon */

  .eyebrow {
    animation: rise-in 1.6s var(--ease-out) 3.5s both;
  }

  .soon__line--left {
    transform-origin: 100% 50%;
    animation: rule-in 1.8s var(--ease-out) 3.7s both;
  }

  .soon__line--right {
    transform-origin: 0% 50%;
    animation: rule-in 1.8s var(--ease-out) 3.7s both;
  }

  .soon__text {
    animation:
      rise-in 1.6s var(--ease-out) 3.8s both,
      shimmer 7s var(--ease-in-out) 5.6s infinite;
  }
}

/* Keyframes */

@keyframes bg-in {
  from {
    opacity: 0;
    transform: scale(1.14);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bg-drift {
  from {
    transform: scale(1) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.05) translate3d(-0.8%, -0.6%, 0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes light-wander {
  0% { transform: translate3d(-14vw, -8vh, 0) scale(1); }
  50% { transform: translate3d(6vw, 4vh, 0) scale(1.08); }
  100% { transform: translate3d(14vw, -4vh, 0) scale(0.96); }
}

@keyframes draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes ink {
  from {
    fill-opacity: 0;
    stroke-opacity: 1;
  }
  to {
    fill-opacity: 1;
    stroke-opacity: 0;
  }
}

@keyframes gather {
  from { transform: translate(var(--gather-x), 14px); }
  to { transform: translate(0, 0); }
}

@keyframes sheen {
  0% { transform: translateX(0); }
  26% { transform: translateX(1450px); }
  100% { transform: translateX(1450px); }
}

@keyframes rule-in {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes track-in {
  from {
    opacity: 0;
    letter-spacing: 0.9em;
    padding-left: 0.9em;
    filter: blur(6px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes word-in {
  from {
    opacity: 0;
    transform: translateY(0.45em);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  45% { background-position: 0% 0; }
  100% { background-position: 0% 0; }
}
