/* ==========================================================================
   Solaeria — Coming Soon
   Mobile-first. The desktop layout starts at 960px (see bottom of file).
   All sizes come from the Figma file: mobile frame = 390px, desktop = 1440px.
   ========================================================================== */


/* ---------- 1. Design tokens ---------- */

:root {
  /* Brand palette (Figma colour styles) */
  --cool-black: #3f4347;
  --light-grey: #d9d9d9;
  --white: #ffffff;
  --grey: #6d7073;          /* dashed dividers + hero line art */

  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --line-height: 1.22;      /* Instrument Sans "auto" line height in Figma */

  /* 10px dash / 10px gap, phased like Figma (half a dash at the left edge) */
  --divider: repeating-linear-gradient(90deg, var(--grey) 0 5px, transparent 5px 15px, var(--grey) 15px 20px);

  /* Mobile layout fits one screen. The header, copy, form and footer keep their
     design heights (--m-fixed). The rest of the screen (--m-free) goes to the
     hero art and the four vertical gaps:
     - short screens: gaps sit at their compact sizes and the art shrinks;
     - taller screens: the art reaches its design size (252px), then the gaps
       grow back towards the design spacing (34, 20, 33.4 and 79px). */
  --screen-h: 100vh;
  --m-fixed: 454.6px;
  --m-free: calc(var(--screen-h) - var(--m-fixed));
  --m-art-min: 96px;
  --m-gap-a-min: 14px;  /* header → art */
  --m-gap-b-min: 10px;  /* art → logo */
  --m-gap-c-min: 16px;  /* tagline → email field */
  --m-gap-d-min: 22px;  /* Notify Me → footer */
  --m-gaps-min: calc(var(--m-gap-a-min) + var(--m-gap-b-min) + var(--m-gap-c-min) + var(--m-gap-d-min));
  --m-art: clamp(var(--m-art-min), calc(var(--m-free) - var(--m-gaps-min)), 252px);
  --m-extra: calc(var(--m-free) - var(--m-gaps-min) - 252px);  /* space left once the art is full size */
  --m-gap-a: clamp(var(--m-gap-a-min), calc(var(--m-gap-a-min) + var(--m-extra) * 0.1916), 34px);
  --m-gap-b: clamp(var(--m-gap-b-min), calc(var(--m-gap-b-min) + var(--m-extra) * 0.0958), 20px);
  --m-gap-c: clamp(var(--m-gap-c-min), calc(var(--m-gap-c-min) + var(--m-extra) * 0.1667), 33.4px);
  --m-gap-d: clamp(var(--m-gap-d-min), calc(var(--m-gap-d-min) + var(--m-extra) * 0.5460), 79px);
}

/* Use the visible screen height (excludes the browser's toolbars) where supported */
@supports (height: 100dvh) {
  :root {
    --screen-h: 100dvh;
  }
}

/* Dark theme (default) */
:root,
[data-theme='dark'] {
  color-scheme: dark;
  --bg: var(--cool-black);
  --ink: var(--white);              /* logo, hero copy, form copy */
  --ink-soft: var(--light-grey);    /* icons, footer, pop-up copy */
  --wave: var(--white);             /* header/footer line pattern (shown at 8%) */
  --wm-fill: url(#wm-fill);         /* "Coming Soon" silver gradients (defined in the sprite) */
  --wm-stroke: url(#wm-stroke);
}

/* Light theme */
[data-theme='light'] {
  color-scheme: light;
  --bg: var(--light-grey);
  --ink: var(--cool-black);
  --ink-soft: var(--cool-black);
  --wave: var(--cool-black);
  --wm-fill: var(--cool-black);
  --wm-stroke: var(--cool-black);
}


/* ---------- 2. Base ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Stop the page scrolling behind the open pop-up */
html:has(dialog[open]) {
  overflow: hidden;
}

h1,
h2,
p {
  margin: 0;
  font: inherit;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
}

button,
input {
  margin: 0;
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* Keyboard focus ring (not part of the visual design, needed for accessibility) */
:focus-visible {
  outline: 2px solid var(--ink-soft);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The inline sprite must not be display:none, or its gradients stop working */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}


/* ---------- 3. Header & footer chrome ---------- */

.site-header,
.site-footer {
  position: relative;
  flex: none;
  isolation: isolate;
}

/* Wavy line pattern: the SVG is used as a mask so its colour follows the theme */
.site-header::before,
.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--wave);
  opacity: 0.08;
  -webkit-mask: url('../assets/wave-mobile.svg') 0 -55px / 955.05px 413.89px repeat-x;
  mask: url('../assets/wave-mobile.svg') 0 -55px / 955.05px 413.89px repeat-x;
}

/* Dashed divider lines */
.site-header::after,
.site-footer::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--divider);
}

/* Header. The Figma frame leaves ~47px at the top for the phone's status bar;
   a browser page sits below that already, so it's left out here. */
.site-header {
  height: 98px;
}

.site-header::after {
  bottom: 0;
}

.site-header__inner {
  max-width: 390px;
  margin: 0 auto;
  padding: 24px 0 0 50px;
}

.wordmark__svg {
  width: 192px;
  height: 19.95px;
}

.site-header__actions {
  display: flex;
  gap: 15.6px;
  margin-top: 15.44px;
}

.icon-list {
  display: flex;
  gap: 15.6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Icon buttons have a solid square behind them that hides the line pattern */
.icon-btn {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink-soft);
}

.icon {
  fill: currentColor;
}

/* Icon sizes (mobile) */
.icon--facebook  { width: 10.3px; height: 19.5px; }
.icon--tiktok    { width: 16.7px; height: 19.3px; }
.icon--instagram { width: 19.1px; height: 19.3px; }
.icon--phone     { width: 18.6px; height: 18.6px; }
.icon--sun       { width: 19.5px; height: 19.5px; }
.icon--moon      { width: 16.5px; height: 16.5px; }

/* Theme toggle shows the sun in dark mode and the moon in light mode */
.theme-toggle .icon--moon,
[data-theme='light'] .theme-toggle .icon--sun {
  display: none;
}

[data-theme='light'] .theme-toggle .icon--moon {
  display: block;
}

/* Footer */
.site-footer {
  height: 67px;
}

.site-footer::after {
  top: 0;
}

.site-footer__inner {
  max-width: 390px;
  margin: 0 auto;
  /* 50px inset as in the design, reduced on very narrow phones so the text still fits */
  padding: 17px 0 0 clamp(8px, calc(100% - 323px), 50px);
}

.site-footer__copy {
  display: inline-block;
  padding: 6px 7px;
  border-radius: 8px;
  background: var(--bg);   /* hides the line pattern behind the text */
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.24px;
}


/* ---------- 4. Hero ---------- */

.site-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--m-gap-a) 10px var(--m-gap-d);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 370px;
}

/* Height follows the screen (see --m-art); width follows the art's proportions */
.hero__art img {
  width: auto;
  max-width: 100%;
  height: var(--m-art);
  object-fit: contain;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 290px;
  max-width: 100%;
  margin-top: var(--m-gap-b);
  text-align: center;
}

.logo {
  fill: currentColor;
}

.hero__logo .logo {
  width: 230px;
  height: 48.58px;
  color: var(--ink);
}

.hero__text {
  margin-top: 8px;
  font-size: 14px;
  letter-spacing: 0.24px;
}

.hero__tagline {
  margin-top: 5px;
  font-size: 22px;
  font-weight: 500;
  line-height: 27px;
  letter-spacing: 0.38px;
}


/* ---------- 5. Waitlist form ---------- */

.signup {
  display: grid;
  grid-template-areas:
    'bar'
    'message'
    'submit';
  justify-items: center;
  width: 298px;
  max-width: 100%;
  margin-top: var(--m-gap-c);
  margin-left: 4px;  /* Figma's mobile form column sits 2px right of centre */
}

/* Frosted "glass" field — gradients converted from the Figma glassmorphism styles */
.signup__bar {
  grid-area: bar;
  position: relative;
  width: 100%;
  height: 54.85px;
  border-radius: 18.28px;
  background: linear-gradient(261.6deg, rgba(255, 255, 255, 0.2) 11.3%, rgba(255, 255, 255, 0.4) 81%);
}

/* Gradient hairline border */
.signup__bar::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 0.91px;
  border-radius: inherit;
  background: linear-gradient(256.8deg, #fff 4.5%, rgba(255, 255, 255, 0.58) 21.4%, rgba(153, 153, 153, 0.2) 40.3%, rgba(255, 255, 255, 0.8) 58.6%, rgba(153, 153, 153, 0.1) 75.6%, #fff 88.7%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

.signup__bar:focus-within {
  outline: 2px solid var(--ink-soft);
  outline-offset: 3px;
}

/* iOS Safari zooms the page when an input's text is under 16px. The mobile design
   uses 14.63px, so the field is set at 16px and scaled to 91.41% to look identical. */
.signup__input {
  width: calc(100% / 0.9141);
  height: calc(100% / 0.9141);
  padding: 0 22px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0.3px;
  text-align: center;
  transform: scale(0.9141);
  transform-origin: 0 0;
  outline: none; /* focus is shown on .signup__bar instead */
}

.signup__input::placeholder {
  color: var(--ink);
  opacity: 1;
}

.signup__message {
  grid-area: message;
  width: 268px;
  max-width: 100%;
  margin-top: 5px;
  font-size: 13px;
  line-height: 16px;
  letter-spacing: 0.08px;
  text-align: center;
}

/* Buttons ("Notify Me", "Accept") */
.btn {
  display: grid;
  place-items: center;
  width: 147px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 16.79px;
  background: var(--cool-black);
  box-shadow: inset 0 0 0 0.5px var(--white);
  color: var(--white);
  font-size: 18px;
  font-weight: 600;
}

.btn:disabled {
  cursor: progress;
}

.signup__submit {
  grid-area: submit;
  position: relative; /* paint above the glass field on desktop */
  margin-top: 10px;
}


/* ---------- 6. Consent pop-up ---------- */

.consent {
  width: 352px;
  max-width: calc(100% - 38px);
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--bg);
  color: var(--ink-soft);
  overflow: auto;
}

.consent::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.consent__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 34px 17px 33px;
  text-align: center;
}

.consent__logo {
  width: 165px;
  height: 34.85px;
}

/* Text block between the two dashed lines */
.consent__text {
  position: relative;
  width: 318px;
  max-width: 100%;
  margin-top: 20px;
  padding: 20px 0;
  font-size: 18px;
}

.consent__text::before,
.consent__text::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: repeating-linear-gradient(90deg, currentColor 0 10px, transparent 10px 20px);
}

.consent__text::before { top: -1px; }
.consent__text::after  { bottom: -1px; }

.consent__para {
  width: 300px;
  max-width: 100%;
  margin: 0 auto;
}

.consent__para--narrow {
  position: relative;
  left: 4.5px;       /* matches the Figma pop-up, where this paragraph sits slightly right */
  width: 271px;
}

.consent__para + .consent__para {
  margin-top: 20px;
}

.consent__accept {
  margin-top: 20px;
}


/* Short phone screens (e.g. iPhone SE): trim the header and footer padding so
   everything still fits without scrolling */
@media (max-width: 959px) and (max-height: 620px) {
  :root {
    --m-fixed: 427.6px;
    --m-art-min: 72px;
    --m-gap-a-min: 10px;
    --m-gap-b-min: 8px;
    --m-gap-c-min: 12px;
    --m-gap-d-min: 14px;
  }

  .site-header {
    height: 86px;
  }

  .site-header__inner {
    padding-top: 12px;
  }

  .site-footer {
    height: 52px;
  }

  .site-footer__inner {
    padding-top: 10px;
  }
}


/* ==========================================================================
   Desktop (960px and up)
   ========================================================================== */

@media (min-width: 960px) {

  /* Header */
  .site-header {
    height: 118px;
  }

  .site-header::before {
    -webkit-mask: url('../assets/wave-header.svg') 0 -69px / 883px 603.88px repeat-x;
    mask: url('../assets/wave-header.svg') 0 -69px / 883px 603.88px repeat-x;
  }

  .site-header__inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 116px;
    max-width: none;
    padding: 39.5px 2.8px 0 0;  /* Figma's row sits ~1.4px left of centre */
  }

  .wordmark__svg {
    width: 334.89px;
    height: 34.8px;
  }

  .site-header__actions {
    margin-top: 0;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .icon--facebook  { width: 14.5px; height: 27.3px; }
  .icon--tiktok    { width: 23.4px; height: 27px; }
  .icon--instagram { width: 26.8px; height: 27px; }
  .icon--phone     { width: 26px;   height: 26px; }
  .icon--sun,
  .icon--moon      { width: 23.2px; height: 23.2px; }

  /* Footer */
  .site-footer {
    height: 62px;
  }

  .site-footer::before {
    -webkit-mask: url('../assets/wave-footer.svg') 0 -61px / 883px 413.89px repeat-x;
    mask: url('../assets/wave-footer.svg') 0 -61px / 883px 413.89px repeat-x;
  }

  .site-footer__inner {
    max-width: none;
    padding: 16px 0 0;
    text-align: center;
  }

  /* Hero: line art on the left, copy on the right */
  .site-main {
    justify-content: center;
    padding: 40px 16px 41px;
  }

  .hero {
    flex-direction: row;
    gap: 30px;
    width: 910px;           /* 905px of content + 5px, matching Figma's slightly off-centre frame */
    max-width: none;
    height: 380px;
    padding: 0 5px 0 0;
  }

  .hero__art img {
    width: 501px;
    height: auto;
  }

  .hero__copy {
    align-self: flex-start;
    align-items: flex-start;
    width: 374px;
    margin-top: 84.5px;
    text-align: left;
  }

  .hero__logo .logo {
    width: 355.6px;
    height: 75.12px;
  }

  .hero__text {
    width: 356px;
    margin-top: 14.2px;
    font-size: 18px;
    letter-spacing: 0;
  }

  .hero__tagline {
    margin-top: 10px;
    font-size: 30.95px;
    line-height: 42.3px;
    letter-spacing: 0.39px;
  }

  /* Form: the button sits inside the glass field */
  .signup {
    grid-template-areas:
      'bar'
      'message';
    width: 633px;
    margin-top: 30px;
    margin-left: 0;
  }

  .signup__bar {
    height: 60px;
    border-radius: 20px;
    background: linear-gradient(254deg, rgba(255, 255, 255, 0.2) 11.3%, rgba(255, 255, 255, 0.4) 81%);
  }

  .signup__bar::before {
    padding: 1px;
    background: linear-gradient(245.5deg, #fff 4.5%, rgba(255, 255, 255, 0.58) 21.4%, rgba(153, 153, 153, 0.2) 40.3%, rgba(255, 255, 255, 0.8) 58.6%, rgba(153, 153, 153, 0.1) 75.6%, #fff 88.7%);
  }

  .signup__input {
    width: 100%;
    height: 100%;
    padding: 0 165px 0 37px;
    text-align: left;
    transform: none;
  }

  .signup__message {
    width: auto;
    margin-top: 10px;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: 0.3px;
  }

  .signup__submit {
    grid-area: bar;
    justify-self: end;
    align-self: center;
    margin: 0 6px 0 0;
    box-shadow: none;
    font-size: 20px;
    letter-spacing: -0.41px;
  }

  /* Pop-up */
  .consent {
    width: 395px;
  }

  .consent__body {
    padding: 53px 38.5px 52px;
  }
}
