/* ==========================================================================
   Aequien — Design System & Styles
   ========================================================================== */

/* 1. Self-hosted Typography */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-400-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: "Archivo";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/archivo-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;
}

/* 2. Custom Properties & Root Settings */
:root {
  --color-bg: #f2f2f2;
  --color-heading: #707a8f;
  --color-tagline: #5f6980;
  --color-footer-bg: #1a1a1a;
  --color-footer-text: #f2f2f2;
  --font-family-base: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --site-gutter: clamp(1rem, 5vw, 4rem);
  --hero-word-ratio: 3.5;
  color-scheme: light;
}

/* 3. Base Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background-color: var(--color-bg);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background-color: var(--color-bg);
  color: var(--color-tagline);
  font-family: var(--font-family-base);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[tabindex="-1"]:focus {
  outline: none;
}

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

/* 4. Header */
.site-header {
  padding: clamp(1.75rem, 4vh, 2.75rem) var(--site-gutter) 1.5rem;
}

.header-logo {
  display: block;
  height: auto;
  max-height: 1.5rem;
  width: auto;
  max-width: 100%;
}

@media (min-width: 768px) {
  .header-logo {
    max-height: 1.75rem;
  }
}

.header-tagline {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-tagline);
}

/* 5. Main Content (Optically Centered: lifted ~4% - 5% above geometric center) */
.site-main {
  display: grid;
  place-items: center;
  padding: 1.25rem var(--site-gutter) clamp(4.5rem, 16vh, 11rem);
  text-align: center;
}

/* Entrance Animation (h1 on index only) */
.hero-title {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: min(clamp(5.25rem, 22vw, 6.75rem), calc((100vw - 2 * var(--site-gutter)) / var(--hero-word-ratio)));
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--color-heading);
}

.hero-word {
  display: block;
}

/* Mobile Entrance Animation: Coming & Soon staggered cascade */
@media (max-width: 640px) {
  .hero-word {
    animation: enter 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .hero-word-1 {
    animation-delay: 0.08s;
  }

  .hero-word-2 {
    animation-delay: 0.20s;
  }
}

/* Desktop: Simultaneous reveal as a whole, side-by-side display */
@media (min-width: 641px) {
  .hero-title {
    font-size: min(clamp(5.5rem, 15vw, 13.5rem), calc((100vw - 2 * var(--site-gutter)) / var(--hero-word-ratio)));
    animation: enter 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
  }

  .hero-word {
    display: inline-block;
    animation: none !important;
  }

  .hero-word-1,
  .hero-word-2 {
    animation: none !important;
    animation-delay: 0s !important;
  }
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-title,
  .hero-word {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* 6. Error Page (404) */
.message-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.error-title {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--color-heading);
}

.back-link {
  color: var(--color-tagline);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: 2px;
}

.back-link:focus-visible {
  outline: 2px solid var(--color-heading);
  outline-offset: 4px;
}

/* 7. Footer */
.site-footer {
  background-color: var(--color-footer-bg);
  padding: 1.25rem var(--site-gutter);
}

.footer-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-mark {
  display: block;
  height: auto;
  max-height: 1.25rem;
  width: auto;
  max-width: 100%;
  flex-shrink: 0;
}

.footer-copy {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-footer-text);
}
