/*
 * site.css: the complete stylesheet of the Magna Luxury Cars coming-soon page
 * (home, Impressum and 404).
 *
 * Sections: fonts, tokens, base, layout and type, header, one-pager (light,
 * title, gold line, contact), button, footer, legal and error pages, motion.
 * Colours and type come from the approved flyer, see
 * docs/superpowers/specs/2026-10-03-coming-soon-design.md.
 */

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

@font-face {
  font-family: "Michroma";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/michroma-latin.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 600;
  font-display: swap;
  src: url("/assets/fonts/jost-latin.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;
}

/*
 * Stand-ins while the web fonts load: Arial scaled to the measured width of
 * each web font (Michroma 1.44 times, Jost Light 0.93 times), so that line
 * breaks stay put and nothing jumps when the real fonts arrive.
 */
@font-face {
  font-family: "Michroma Fallback";
  src: local("Arial");
  size-adjust: 144%;
}

@font-face {
  font-family: "Jost Fallback";
  src: local("Arial");
  size-adjust: 93%;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: dark;

  --color-bg: #0b0a09;
  --color-ink: #f1ebdf;
  --color-text: #d8d1c4;
  --color-muted: #a39d92;
  --color-gold: #d5ae57;
  --color-gold-light: #e6ca82;
  --color-line: #705c30;
  --gradient-gold: linear-gradient(
    90deg,
    #b3904a 0%,
    #e6ca82 30%,
    #cea75b 50%,
    #c49b4f 72%,
    #f0da99 100%
  );
  --gradient-headline: linear-gradient(
    90deg,
    #c9a962 0%,
    #b8893a 45%,
    #dbbf7c 100%
  );
  /* Gold foil: alternating dark and light stops read as polished metal. */
  --gradient-foil: linear-gradient(
    100deg,
    #9d7838 0%,
    #d9bb72 14%,
    #f1dc9c 24%,
    #c39a4a 38%,
    #a9823d 50%,
    #e6ca82 64%,
    #f6e6b4 72%,
    #c49b4f 86%,
    #b08a45 100%
  );

  --font-display: "Michroma", "Michroma Fallback", sans-serif;
  --font-text: "Jost", "Jost Fallback", sans-serif;

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --content-width: 72rem;

  /* Angle of the signature gold line; flatter on wide screens. */
  --slant-angle: 4deg;

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (min-width: 64rem) {
  :root {
    --slant-angle: 2.5deg;
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-text);
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

/* Browsers set <address> in italics; Jost has no italic, so it would be faked. */
address {
  font-style: normal;
}

:focus-visible {
  outline: 3px solid var(--color-gold-light);
  outline-offset: 3px;
}

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

/* ---------- Layout and type ---------- */

.container {
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin-inline: auto;
}

/* Hidden on screen, read by screen readers. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --tracking is reused to balance the space letter-spacing leaves after the last letter. */
.eyebrow {
  --tracking: 0.32em;
  color: var(--color-gold);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: var(--tracking);
  line-height: 1.5;
  text-transform: uppercase;
}

/* Tighter on phones so "Autoverkauf · Autovermietung" fits one line from 360 px. */
@media (max-width: 30rem) {
  .eyebrow {
    --tracking: 0.24em;
  }
}

.display {
  color: var(--color-ink);
  font-family: var(--font-display);
  font-synthesis: none;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.12;
  text-transform: uppercase;
}

/* Never wraps: every headline's font size is computed so that its longest line fits. */
.display__line {
  display: block;
  white-space: nowrap;
}

.display__line--gold {
  color: var(--color-gold);
}

/* Metallic headline like the flyer, only where gradient text is supported. */
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .display__line--gold {
    background: var(--gradient-headline);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

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

.site-header {
  display: flex;
  justify-content: center;
  padding: clamp(1rem, 3svh, 2.5rem) var(--gutter) clamp(0.25rem, 1svh, 1rem);
}

/* Logo link on the subpages: at least 48px tall on phones, where the logo is 44px. */
.site-header__home {
  display: flex;
  align-items: center;
  min-height: 3rem;
}

.site-header__logo {
  width: clamp(11rem, 17vw, 16rem);
  height: auto;
}

/* ---------- One-pager (home) ---------- */

/*
 * The home page is one screen: logo, centred title, gold line, contact and
 * footer. 100svh is the height with the browser bars shown, so nothing hides
 * behind them. When the content cannot fit (strong zoom, very small phones),
 * the page scrolls rather than cutting anything off.
 *
 * The light is staged like a showroom: a soft spotlight from above, a warm
 * glow behind the title and darker edges.
 */
.soon {
  container-type: inline-size;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  background:
    radial-gradient(
      ellipse 55% 38% at 50% 0%,
      rgb(230 202 130 / 9%),
      transparent 72%
    ),
    radial-gradient(
      ellipse 60% 38% at 50% 45%,
      rgb(213 174 87 / 8%),
      transparent 70%
    ),
    radial-gradient(
      ellipse 125% 95% at 50% 50%,
      transparent 55%,
      rgb(0 0 0 / 55%) 100%
    );
}

/*
 * Fine film grain over the black (generated by build-assets.ts): a tactile
 * surface instead of flat digital black, and it hides gradient banding.
 * Behind the content and never in the way of a click.
 */
.soon::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("/assets/img/grain.png") repeat;
  opacity: 0.045;
  pointer-events: none;
  content: "";
}

/* A faint golden aura around the logo. */
.soon .site-header__logo {
  filter: drop-shadow(0 0 1.25rem rgb(213 174 87 / 14%));
}

.soon__main {
  display: flex;
  flex: 1;
  flex-direction: column;
}

/* The title block takes the free height and sits in its middle. */
.soon__center {
  container-type: inline-size;
  display: grid;
  flex: 1;
  align-content: center;
  justify-items: center;
  gap: clamp(0.75rem, 2.2svh, 1.5rem);
  padding-block: clamp(0.5rem, 2svh, 3rem);
  text-align: center;
}

/* Fine gold hairlines on both sides of the eyebrow, fading outwards. */
.soon__eyebrow {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

/* Letter-spacing also follows the last letter; the same space in front keeps the text centred. */
.soon__eyebrow span {
  padding-inline-start: var(--tracking);
}

.soon__eyebrow::before,
.soon__eyebrow::after {
  flex: none;
  width: clamp(1.75rem, 7vw, 4.5rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold));
  content: "";
}

.soon__eyebrow::after {
  background: linear-gradient(90deg, var(--color-gold), transparent);
}

@media (max-width: 30rem) {
  .soon__eyebrow::before,
  .soon__eyebrow::after {
    display: none;
  }
}

/*
 * Two lines on portrait screens ("COMING" is 6.2em wide with its tracking),
 * one line on landscape screens ("COMING SOON." is 11.2em). The height caps
 * keep the page on one screen.
 */
.soon__title {
  font-size: min(100cqi / 6.5, 10svh, 7.5rem);
  letter-spacing: 0.04em;
  line-height: 1.04;
}

/* Letter-spacing also follows the last letter; the same space in front keeps the lines centred. */
.soon__title .display__line {
  padding-inline-start: 0.04em;
}

/* «Coming» in gold foil; a glint of light crosses it once (see Motion). */
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .soon__title .display__line--gold {
    background:
      linear-gradient(
          105deg,
          transparent 38%,
          rgb(255 247 224 / 85%) 50%,
          transparent 62%
        ) -20%
        0 / 200% 100% no-repeat,
      var(--gradient-foil);
    -webkit-background-clip: text;
    background-clip: text;
  }
}

@media (orientation: landscape) {
  .soon__title {
    font-size: min(100cqi / 11.6, 14svh, 7.5rem);
  }

  .soon__title .display__line {
    display: inline;
  }
}

.soon__lead {
  max-width: 30rem;
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
  letter-spacing: 0.01em;
  line-height: 1.5;
}

/*
 * The brand's rising gold line, edge to edge. The box is as tall as the rise
 * (page width × tan(angle), 100cqi being the page width); the line runs from
 * its bottom left to its top right, with a soft glow and a light that runs
 * along it once (see Motion). Only the sides are clipped, so the glow stays.
 */
.slant-line {
  position: relative;
  height: calc(100cqi * tan(var(--slant-angle)) + 2px);
  overflow-x: clip;
}

.slant-line::before {
  position: absolute;
  bottom: 0;
  left: 0;
  width: calc(100% / cos(var(--slant-angle)));
  height: 2px;
  background:
    linear-gradient(90deg, transparent, rgb(255 246 220 / 95%), transparent)
      140% 0 / 22% 100% no-repeat,
    var(--gradient-gold);
  box-shadow: 0 0 0.75rem rgb(213 174 87 / 35%);
  transform: rotate(calc(-1 * var(--slant-angle)));
  transform-origin: 0 100%;
  content: "";
}

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

.contact {
  padding-block: clamp(0.5rem, 2svh, 2rem);
}

/*
 * Phones: one compact row per item, label beside value. From 40rem two by
 * two, label above value; from 64rem one row of four, divided by hairlines.
 */
.contact__grid {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  column-gap: 1.25rem;
}

.contact__item {
  display: contents;
}

.contact__label {
  color: var(--color-gold);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  line-height: 1.5;
  text-transform: uppercase;
}

/*
 * Padding gives every value a tap target of at least 32px (WCAG 2.2 AA asks
 * for 24px). The underline is a gold hairline that grows from the centre.
 */
.contact__value {
  display: inline-block;
  padding-block: 0.3125rem;
  background: linear-gradient(var(--color-gold), var(--color-gold)) 50%
    calc(100% - 0.125rem) / 0 1px no-repeat;
  color: var(--color-ink);
  font-size: min(1rem, 4.4cqi);
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1.45;
  text-decoration: none;
  transition: background-size 0.35s var(--ease-out);
}

.contact__value:hover,
.contact__value:focus-visible {
  background-size: 100% 1px;
}

@media (min-width: 40rem) {
  .contact__grid {
    grid-template-columns: repeat(2, auto);
    gap: 0.75rem clamp(3rem, 8vw, 6rem);
  }

  .contact__item {
    display: block;
    text-align: center;
  }

  .contact__value {
    font-size: 1rem;
  }
}

@media (min-width: 64rem) {
  .contact__grid {
    grid-template-columns: repeat(4, auto);
    column-gap: 0;
  }

  .contact__item {
    padding-inline: clamp(1.75rem, 3.5vw, 3.5rem);
  }

  .contact__item + .contact__item {
    border-inline-start: 1px solid rgb(213 174 87 / 22%);
  }
}

/*
 * Phones held sideways have too little height for the stacked layout: title
 * and contact sit side by side, the gold line is left out.
 */
@media (orientation: landscape) and (max-height: 30rem) {
  .soon__main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }

  .slant-line {
    display: none;
  }

  .site-header__logo {
    width: 9rem;
  }

  .soon__center {
    padding-block: 0;
  }

  .soon__center .eyebrow {
    --tracking: 0.18em;
  }

  .soon__eyebrow::before,
  .soon__eyebrow::after {
    display: none;
  }

  .soon__title {
    font-size: min(100cqi / 6.5, 15svh, 7.5rem);
  }

  .soon__title .display__line {
    display: block;
  }

  .soon__lead {
    font-size: 0.9375rem;
  }

  .contact__grid {
    grid-template-columns: auto auto;
    gap: 0 1.25rem;
  }

  .contact__item {
    display: contents;
    text-align: start;
  }
}

/* ---------- Button (404 page) ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--color-gold);
  background: transparent;
  color: var(--color-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.2;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.2s var(--ease-out);
}

.button:hover {
  background: rgb(213 174 87 / 14%);
}

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

.site-footer {
  padding-block: 0 clamp(0.25rem, 1.5svh, 1.5rem);
  color: var(--color-muted);
  font-size: 0.8125rem;
}

/* One centred row that wraps as a whole on narrow screens, under a hairline that fades out at both ends. */
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 1rem;
  padding-top: 0.25rem;
  background: linear-gradient(
      90deg,
      transparent,
      rgb(112 92 48 / 70%),
      transparent
    )
    top / 100% 1px no-repeat;
  text-align: center;
}

/* The links join the row of the copyright line. */
.site-footer__links {
  display: contents;
}

/* The heart of the Codelance credit, in brand gold rather than an emoji. */
.site-footer__heart {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-inline: 0.1em;
  color: var(--color-gold);
  vertical-align: -0.1em;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  color: var(--color-text);
  text-decoration-color: var(--color-line);
  text-underline-offset: 0.25em;
}

.site-footer a:hover {
  text-decoration-color: var(--color-gold);
}

/* ---------- Legal and error pages ---------- */

.legal {
  max-width: 46rem;
  padding-block: clamp(2rem, 6vw, 4rem) clamp(4rem, 10vw, 6rem);
}

.legal__title {
  font-size: clamp(1.75rem, 6vw, 2.75rem);
}

.legal h2 {
  margin-top: 3.5rem;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
}

.legal h3 {
  margin-top: 2.25rem;
  color: var(--color-gold);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  line-height: 1.5;
  text-transform: uppercase;
}

.legal p,
.legal address {
  margin-top: 0.75rem;
}

.legal address {
  margin-top: 1.5rem;
  color: var(--color-ink);
}

.legal a {
  color: var(--color-ink);
  text-decoration-color: var(--color-gold);
  text-underline-offset: 0.2em;
}

.legal__intro {
  color: var(--color-ink);
}

.legal__updated {
  color: var(--color-muted);
  font-size: 0.875rem;
}

.not-found {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  padding-block: clamp(4rem, 14svh, 9rem);
  text-align: center;
}

.not-found__title {
  font-size: clamp(1.5rem, 6vw, 2.75rem);
}

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

/*
 * One slow, cinematic entrance on the home page: the logo descends into
 * place, the eyebrow and lead rise, the title comes into focus, the gold line
 * draws in from the left, then a glint crosses «Coming» and a light runs
 * along the line. Off for reduced motion.
 */
@media (prefers-reduced-motion: no-preference) {
  .soon .site-header__logo {
    animation: logo-in 1.2s var(--ease-out) both;
  }

  .soon__center > * {
    animation: text-rise 1s var(--ease-out) both;
  }

  .soon__eyebrow {
    animation-delay: 0.3s;
  }

  .soon__title {
    animation: title-focus 1.5s 0.45s var(--ease-out) both;
  }

  .soon__title .display__line--gold {
    animation: foil-shine 1.8s 2s ease-in-out both;
  }

  .soon__lead {
    animation-delay: 0.85s;
  }

  .slant-line::before {
    animation:
      line-draw 1.4s 1s cubic-bezier(0.65, 0, 0.35, 1) both,
      line-shine 1.6s 2.4s ease-in-out both;
  }

  .soon .contact,
  .soon .site-footer {
    animation: fade-in 1s 1.4s var(--ease-out) both;
  }
}

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

@keyframes logo-in {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
}

@keyframes text-rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
}

@keyframes title-focus {
  from {
    opacity: 0;
    filter: blur(12px);
    transform: scale(1.03);
  }
}

@keyframes foil-shine {
  from {
    background-position:
      120% 0,
      0 0;
  }

  to {
    background-position:
      -20% 0,
      0 0;
  }
}

@keyframes line-draw {
  from {
    transform: rotate(calc(-1 * var(--slant-angle))) scaleX(0);
  }
}

@keyframes line-shine {
  from {
    background-position:
      -40% 0,
      0 0;
  }

  to {
    background-position:
      140% 0,
      0 0;
  }
}
