/* autogovcon.com: the "coming soon" page. A hero, a contact section and a footer. */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #05070b;
  --ink: #efe9dc;
  --ink-soft: rgb(239 233 220 / 0.72);
  --ink-faint: rgb(239 233 220 / 0.55);
  --rule: rgb(239 233 220 / 0.13);
  --amber: #f2a24a;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --pad: clamp(20px, 4vw, 56px);

  /* The photo is sized and placed so that the shoreline sits at --shore and the
     tower stands on the page's centre line, whatever the shape of the window. */
  --photo-w: min(145vh, max(118vw, 86vh));
  --shore: 45vh;

  /* The headline's size follows the window's width; tall windows have room for more. */
  --h1-vw: 6.5vw;
}

@supports (height: 1svh) {
  :root {
    --photo-w: min(145svh, max(118vw, 86svh));
    --shore: 45svh;
  }
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection {
  background: var(--amber);
  color: var(--bg);
}

a {
  color: inherit;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */

.top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(clamp(18px, 3.2vh, 30px), env(safe-area-inset-top)) max(var(--pad), env(safe-area-inset-right)) 0 max(var(--pad), env(safe-area-inset-left));
  animation: rise 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
}

.brand-mark {
  flex: none;
}

.brand-mark-a {
  fill: var(--ink);
}

.brand-mark-bar {
  fill: var(--amber);
}

.top-link {
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.9em 0;
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}

.top-link:hover {
  color: var(--ink);
  border-bottom-color: var(--amber);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* The dusk sky, carried past the photo's edges so wide windows don't show where it ends. */
.scene-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 48% 8% at 50% calc(var(--shore) - 4%), rgb(150 110 96 / 0.2), rgb(150 110 96 / 0) 100%),
    radial-gradient(ellipse 92% 44% at 50% calc(var(--shore) - 3%), rgb(38 52 90 / 0.5), rgb(38 52 90 / 0) 100%);
  animation: emerge 2.8s cubic-bezier(0.16, 0.84, 0.24, 1) both;
}

.scene-frame {
  position: absolute;
  top: calc(var(--shore) - var(--photo-w) * 0.461);
  left: calc(50% - var(--photo-w) * 0.5375);
  width: var(--photo-w);
  aspect-ratio: 4 / 3;
  transform-origin: 53.75% 61.5%;
  animation: emerge 2.8s cubic-bezier(0.16, 0.84, 0.24, 1) both;
}

.scene-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Fade every edge: the sky into the night above, the trees to either side, the water below. */
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 1%, #000 42%, #000 70%, transparent 99%),
    linear-gradient(to right, transparent 1%, #000 22%, #000 78%, transparent 99%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent 1%, #000 42%, #000 70%, transparent 99%),
    linear-gradient(to right, transparent 1%, #000 22%, #000 78%, transparent 99%);
  mask-composite: intersect;
  transform: translate3d(calc(var(--mx, 0) * -10px), calc(var(--my, 0) * -6px), 0) scale(1.03);
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Warm light along the shoreline, slowly breathing. */
.scene-horizon {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 36% 6% at 50% calc(var(--shore) - 2%), rgb(242 162 74 / 0.22), rgb(242 162 74 / 0) 100%);
  mix-blend-mode: screen;
  animation: breathe 9s ease-in-out infinite alternate;
}

/* The water dissolves into the page, so the headline sits on calm, dark ground. */
.scene-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgb(5 7 11 / 0) calc(var(--shore) + 2%),
    rgb(5 7 11 / 0.5) calc(var(--shore) + 8%),
    rgb(5 7 11 / 0.86) calc(var(--shore) + 14%),
    var(--bg) calc(var(--shore) + 27%)
  );
}

/* Film grain, thinning out towards the foot of the hero. It also hides banding in the dark gradients. */
.scene-grain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.42;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}

.scene-grain::before {
  content: "";
  position: absolute;
  inset: -200px;
  background: url("img/grain.png") 0 0 / 200px 200px;
  animation: grain 0.9s steps(1) infinite;
}

.hero-copy {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: calc(var(--shore) + clamp(36px, 6.6vh, 76px)) var(--pad) clamp(40px, 7vh, 88px);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  margin: 0;
  padding: 0.8em 1.3em 0.8em 1.1em;
  border: 1px solid rgb(239 233 220 / 0.16);
  border-radius: 999px;
  background: rgb(5 7 11 / 0.42);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.55s both;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 2.6s ease-out infinite;
}

h1 {
  max-width: 11.8em;
  margin: clamp(18px, 3vh, 30px) 0 0;
  font-size: clamp(2.25rem, min(var(--h1-vw), 9.9vh), 7.25rem);
  font-weight: 380;
  line-height: 1.02;
  letter-spacing: -0.024em;
  text-wrap: balance;
  animation: develop 1.5s cubic-bezier(0.2, 0.7, 0.2, 1) 0.75s both;
}

/* The redacted word. Nothing is hidden underneath: the bar is all there is. */
.redact {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.redact-bar {
  position: relative;
  display: inline-block;
  width: 3.7em;
  height: 0.74em;
  margin: 0 0.05em 0 0.04em;
  padding: 0;
  border: 0;
  border-radius: 0.03em;
  font: inherit;
  background: var(--ink);
  vertical-align: -0.05em;
  overflow: hidden;
  cursor: not-allowed;
  transform-origin: left center;
  animation: strike 0.75s cubic-bezier(0.7, 0, 0.2, 1) 1.7s both;
  -webkit-tap-highlight-color: transparent;
}

/* A glint crosses the bar now and then, as if something were about to show through. */
.redact-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgb(242 162 74 / 0) 38%, rgb(242 162 74 / 0.95) 50%, rgb(242 162 74 / 0) 62%);
  transform: translateX(-110%);
  animation: glint 9s cubic-bezier(0.5, 0, 0.3, 1) 4.5s infinite;
}

/* Asking for the word gets an answer, stamped on the bar itself. */
.redact-note {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  font: 500 max(0.625rem, 0.17em) / 1 var(--mono);
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-transform: uppercase;
  color: var(--bg);
  opacity: 0;
  transition: opacity 0.2s;
}

.redact.is-denied {
  animation: deny 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.redact.is-denied .redact-note {
  opacity: 1;
}

.lede {
  margin: clamp(16px, 2.6vh, 26px) 0 0;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  line-height: 1.35;
  color: var(--ink-soft);
  animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 2.2s both;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  height: 48px;
  margin-top: clamp(22px, 3.6vh, 36px);
  padding: 0 1.6em;
  border-radius: 999px;
  background: var(--ink);
  color: #0a0c11;
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.25s;
  animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 2.4s both;
}

.button:hover {
  background: var(--amber);
}

.button-arrow {
  transition: transform 0.25s;
}

.button:hover .button-arrow {
  transform: translateY(2px);
}

/* ---------- Contact ---------- */

.contact {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(120px, 21vh, 230px) var(--pad) clamp(96px, 17vh, 190px);
}

/* The tower's centre line, carried down the page. */
.contact::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: clamp(64px, 11vh, 120px);
  background: linear-gradient(to bottom, rgb(242 162 74 / 0), rgb(242 162 74 / 0.75));
}

/* The dusk again, low on the horizon at the foot of the page. */
.contact::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  z-index: -1;
  background: radial-gradient(ellipse 58% 100% at 50% 100%, rgb(38 52 90 / 0.34), rgb(38 52 90 / 0) 100%);
  pointer-events: none;
}

.eyebrow {
  margin: 0;
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

h2 {
  margin: clamp(18px, 2.6vh, 26px) 0 0;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  font-weight: 380;
  line-height: 1.04;
  letter-spacing: -0.022em;
}

.contact-note {
  max-width: 30em;
  margin: clamp(14px, 2vh, 20px) 0 0;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.4;
  color: var(--ink-soft);
}

.contact-email {
  margin: clamp(34px, 5.5vh, 56px) 0 0;
}

.email {
  font-size: clamp(1.55rem, 4.7vw, 3.3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-decoration: underline;
  text-decoration-color: rgb(242 162 74 / 0.75);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.25s, text-decoration-color 0.25s;
}

.email:hover {
  color: var(--amber);
  text-decoration-color: var(--amber);
}

.copy {
  margin-top: clamp(22px, 3.2vh, 30px);
  height: 40px;
  padding: 0 1.4em;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s;
}

.copy:hover {
  color: var(--ink);
  border-color: rgb(239 233 220 / 0.4);
}

.copy.is-copied {
  color: var(--amber);
  border-color: rgb(242 162 74 / 0.6);
}

/* ---------- Footer ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 26px max(var(--pad), env(safe-area-inset-right)) max(26px, env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left));
  border-top: 1px solid var(--rule);
  font: 400 0.6875rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

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

.lost {
  position: relative;
  z-index: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px var(--pad) 96px;
}

.lost::after {
  content: "";
  position: absolute;
  inset: 40% 0 0;
  z-index: -1;
  background: radial-gradient(ellipse 58% 100% at 50% 100%, rgb(38 52 90 / 0.34), rgb(38 52 90 / 0) 100%);
  pointer-events: none;
}

.lost h1 {
  font-size: clamp(2.25rem, min(8vw, 9.9vh), 5.5rem);
  animation-delay: 0.3s;
}

.lost .eyebrow {
  animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both;
}

.lost .lede {
  animation-delay: 0.9s;
}

.lost .button {
  animation-delay: 1.1s;
}

/* ---------- Motion ---------- */

@keyframes emerge {
  from {
    opacity: 0;
    transform: scale(1.06);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes develop {
  from {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(10px);
  }
}

@keyframes strike {
  from {
    transform: scaleX(0);
  }
}

@keyframes glint {
  0% {
    transform: translateX(-110%);
  }
  16%,
  100% {
    transform: translateX(110%);
  }
}

@keyframes deny {
  20% {
    transform: translateX(-0.07em);
  }
  40% {
    transform: translateX(0.07em);
  }
  60% {
    transform: translateX(-0.04em);
  }
  80% {
    transform: translateX(0.04em);
  }
}

@keyframes breathe {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgb(242 162 74 / 0.55);
  }
  70%,
  100% {
    box-shadow: 0 0 0 9px rgb(242 162 74 / 0);
  }
}

/* The grain's jumps stay inside one tile, so its 200px of overhang always covers the scene. */
@keyframes grain {
  0% {
    transform: translate(0, 0);
  }
  12.5% {
    transform: translate(-83px, 61px);
  }
  25% {
    transform: translate(47px, -129px);
  }
  37.5% {
    transform: translate(-151px, -37px);
  }
  50% {
    transform: translate(109px, 97px);
  }
  62.5% {
    transform: translate(-29px, -173px);
  }
  75% {
    transform: translate(163px, 23px);
  }
  87.5% {
    transform: translate(-101px, 139px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .scene-photo {
    transform: scale(1.03);
  }
}

/* Windows high-contrast mode drops backgrounds, which would erase the bar. */
@media (forced-colors: active) {
  .redact-bar {
    forced-color-adjust: none;
    background: CanvasText;
  }
}

/* ---------- Tall windows: phones and tablets held upright ---------- */

@media (orientation: portrait) {
  :root {
    --h1-vw: 9.6vw;
  }

  /* Short enough to share a line with "contracting". */
  .redact-bar {
    width: 3.1em;
  }
}
