/*
 * ShiftEgo pre-launch site: one full-screen start page plus the legal pages.
 * A slim copy of the tokens and legal styles in site/assets/site.css, nothing of the
 * real start page. Light is the default; ?theme=dark (the app's legal sheet) switches.
 */

@font-face { font-family: "Plex"; font-weight: 400; font-display: swap; src: url(fonts/plex-regular.woff2) format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 500; font-display: swap; src: url(fonts/plex-medium.woff2) format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 600; font-display: swap; src: url(fonts/plex-semibold.woff2) format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 700; font-display: swap; src: url(fonts/plex-bold.woff2) format("woff2"); }
@font-face { font-family: "Octicons"; font-display: block; src: url(fonts/octicons.woff2) format("woff2"); }

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: light;

  --text: #1c3139;
  --text-2: #4d6168;
  --text-3: #6b7c80;
  --ink: #1f3b44;

  --bg: #f3f6f4;
  --surface: #fbfdfc;
  --surface-elevated: #edf3f1;
  --border: #e8eeec;
  --border-elevated: #e2eae7;

  --g700: #2a7965;
  --g500: #4fb39a;
  --accent-green: var(--g700);
  --accent-green-bg: #e1f2ee;
  --accent-green-border: #d3ebe5;

  --button: #1f3b44;
  --button-text: #fff;
  --arrow-on-button: rgba(255, 255, 255, 0.12);

  /* petrol of the icon: start page */
  --band: radial-gradient(90% 120% at -5% -10%, rgba(79, 179, 154, 0.55), transparent 60%),
    radial-gradient(80% 110% at 110% 100%, rgba(233, 168, 120, 0.32), transparent 62%), #123a46;
  --band-flat: #123a46;
  --on-band: #fff;
  --on-band-2: rgba(255, 255, 255, 0.78);
  --band-accent: linear-gradient(90deg, #8fe3cb 0%, #c9e2b4 55%, #f6c59c 110%);

  --shadow-floating: 0 20px 60px rgba(28, 52, 60, 0.12);
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --page-max: 1160px;
  --gutter: 20px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --text: #eef4f2;
  --text-2: #b3c5c3;
  --text-3: #87a09f;
  --ink: #cfe0dc;

  --bg: #0f2a33;
  --surface: #143540;
  --surface-elevated: #1a404b;
  --border: #1f4550;
  --border-elevated: #245059;

  --accent-green: #7fd0b6;
  --accent-green-bg: #164438;
  --accent-green-border: #1d4f42;

  --button: var(--g700);

  --band: radial-gradient(90% 120% at -5% -10%, rgba(79, 179, 154, 0.3), transparent 60%),
    radial-gradient(80% 110% at 110% 100%, rgba(233, 168, 120, 0.16), transparent 62%), #0b2129;
  --band-flat: #0b2129;
  --shadow-floating: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ------------------------------------------------------------------ base */

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

html { -webkit-text-size-adjust: 100%; }
/* overscroll above and below the start page shows petrol, not the light page */
.home-page { background: var(--band-flat); }

body {
  min-height: 100vh;
  display: flex; flex-direction: column;
  font-family: "Plex", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
main { flex: 1; }

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--g500); outline-offset: 3px; border-radius: 6px; }

.oct { font-family: "Octicons"; font-style: normal; font-weight: 400; line-height: 1; display: inline-block; }
.wrap { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px;
  background: var(--button); color: var(--button-text); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ type */

.h2 { font-size: clamp(32px, 4.4vw, 48px); line-height: 1.08; font-weight: 700; letter-spacing: -0.03em; }
.lead { font-size: clamp(17px, 1.6vw, 19px); line-height: 1.6; color: var(--text-2); }

.kicker {
  display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 14px 0 12px;
  border-radius: 999px; background: var(--accent-green-bg); border: 1px solid var(--accent-green-border);
  font-size: 12px; line-height: 14px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--accent-green);
}
.kicker .oct { font-size: 13px; }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 24px; border-radius: 999px;
  background: var(--button); color: var(--button-text);
  font-size: 15px; line-height: 20px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(0.98); }
.btn.with-arrow { padding: 0 6px 0 22px; }
.btn.with-arrow i {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--arrow-on-button); font-size: 16px;
}
.btn.block { width: 100%; }

/* Store badges, not links yet: the app is not in the stores. */
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 22px 0 18px;
  border-radius: 14px; background: #0b1a1f; color: #fff; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.16); text-align: left;
}
.store svg { width: 24px; height: 24px; flex: none; fill: currentColor; }
.store span { display: flex; flex-direction: column; line-height: 1.1; }
.store small { font-size: 11px; font-weight: 500; opacity: 0.85; letter-spacing: 0.2px; }
.store b { font-size: 19px; font-weight: 600; letter-spacing: -0.3px; }
@media (max-width: 420px) {
  .stores { gap: 10px; }
  .store { min-height: 52px; padding: 0 14px 0 12px; gap: 10px; }
  .store svg { width: 21px; height: 21px; }
  .store b { font-size: 16.5px; }
  .store small { font-size: 10px; }
}

/* ------------------------------------------------------------------ header */

.site-header { position: relative; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 72px; }
.legal-page .site-header { border-bottom: 1px solid var(--border); }

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.logo img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.logo span { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
  padding: 8px 12px; border-radius: 999px; text-decoration: none;
  font-size: 15px; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface-elevated); }
.nav a[aria-current="page"] { color: var(--text); background: var(--accent-green-bg); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: 8px; }

.lang-switch {
  display: inline-flex; align-items: center; height: 36px; padding: 3px; gap: 2px; border-radius: 999px; flex: none;
  background: var(--surface-elevated); border: 1px solid var(--border-elevated);
}
.lang-switch a {
  display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 28px; padding: 0 7px;
  border-radius: 999px; text-decoration: none; font-size: 12px; font-weight: 700; letter-spacing: 0.4px; color: var(--text-3);
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(16, 45, 54, 0.18); }
:root[data-theme="dark"] .lang-switch { background: var(--accent-green-bg); border-color: var(--accent-green-border); }
:root[data-theme="dark"] .lang-switch a[aria-current="true"] { background: var(--g700); color: #fff; }

.menu-button {
  display: none; width: 44px; height: 44px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--surface-elevated); border: 1px solid var(--border-elevated); color: var(--ink);
}
.menu-button .oct { font-size: 18px; }

/* Phones: the legal links move into a card under the header. */
.mobile-nav { display: none; }
@media (max-width: 980px) {
  .nav { display: none; }
  .header-actions { margin-left: auto; }
  .menu-button { display: inline-flex; }
  .site-header.open .mobile-nav {
    display: flex; flex-direction: column; position: absolute; top: 68px; left: var(--gutter); right: var(--gutter);
    padding: 6px 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow-floating); animation: menu-in 0.2s ease both;
  }
  .mobile-nav a {
    display: flex; align-items: center; justify-content: space-between; padding: 14px 2px; text-decoration: none;
    font-size: 18px; line-height: 24px; font-weight: 600; color: var(--text);
  }
  .mobile-nav a + a { border-top: 1px solid var(--border); }
  .mobile-nav a .oct { color: var(--text-3); font-size: 14px; }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .site-header.open .mobile-nav { animation: none; } }
@media (max-width: 400px) { .site-header .logo span { display: none; } }

/* On the petrol start page: light ink in the header. */
.home-page .site-header { position: absolute; top: 0; left: 0; right: 0; }
.home-page .site-header .logo span { color: var(--on-band); }
.home-page .site-header .nav a { color: var(--on-band-2); }
.home-page .site-header .nav a:hover { color: var(--on-band); background: rgba(255, 255, 255, 0.1); }
.home-page .site-header .lang-switch,
.home-page .site-header .menu-button { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.22); }
.home-page .site-header .lang-switch a { color: rgba(255, 255, 255, 0.75); }
.home-page .site-header .lang-switch a[aria-current="true"] { background: rgba(255, 255, 255, 0.92); color: #123a46; }
.home-page .site-header .menu-button { color: var(--on-band); }

/* ------------------------------------------------------------------ start page */

.landing {
  position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  background: var(--band); color: var(--on-band); text-align: center;
}
.landing-content {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-top: 112px; padding-bottom: 40px;
}
.landing .app-icon { width: 88px; height: 88px; border-radius: 20px; margin-bottom: 32px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3); }
.landing h1 {
  max-width: 820px; font-size: clamp(40px, 6vw, 68px); line-height: 1.05; font-weight: 700; letter-spacing: -0.035em;
  text-wrap: balance;
}
.landing h1 .accent {
  background: var(--band-accent);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.landing .lead { max-width: 640px; margin-top: 22px; color: var(--on-band-2); }
.landing .stores { margin-top: 36px; }
.landing-foot { padding: 0 var(--gutter) calc(24px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--on-band-2); }

/* ------------------------------------------------------------------ cards */

.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; }
.card.list { border-radius: var(--radius-lg); }

/* ------------------------------------------------------------------ legal pages */

.legal-hero { padding: clamp(40px, 6vw, 72px) 0 28px; }
.legal-hero .kicker { margin-bottom: 16px; }
.legal-hero .h2 { font-size: clamp(32px, 4vw, 44px); }
.legal-hero .updated { margin-top: 12px; font-size: 15px; color: var(--text-3); }
.legal { padding-bottom: clamp(64px, 8vw, 104px); }
.legal .card { max-width: 820px; padding: clamp(24px, 4vw, 44px); }
.prose { font-size: 16px; line-height: 27px; color: var(--text-2); }
.prose h2 { margin: 36px 0 10px; font-size: 21px; line-height: 28px; font-weight: 700; letter-spacing: -0.4px; color: var(--text); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 22px 0 6px; font-size: 17px; line-height: 24px; font-weight: 600; color: var(--text); }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 12px; }
.prose ul { padding-left: 0; list-style: none; }
.prose li { position: relative; padding-left: 20px; }
.prose li + li { margin-top: 8px; }
.prose li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--g500); }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--accent-green); font-weight: 500; text-underline-offset: 3px; }
.prose a.btn { color: var(--button-text); }
.prose address { font-style: normal; }
.prose p + address, .prose address + p { margin-top: 12px; }
.prose .caps { font-size: 14px; letter-spacing: 0.2px; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }

.field { margin-top: 24px; }
.field label { display: block; margin: 0 4px 8px; font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-2); }
.input {
  width: 100%; height: 54px; padding: 0 18px; border-radius: var(--radius-md);
  background: var(--surface-elevated); border: 1px solid var(--border-elevated); color: var(--text);
  font: inherit; font-size: 16px;
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--g500); box-shadow: 0 0 0 3px rgba(79, 179, 154, 0.2); }
.input[aria-invalid="true"] { border-color: rgb(239, 68, 68); }
.field-error { margin: 8px 4px 0; font-size: 14px; color: rgb(239, 68, 68); }
.form-actions { margin-top: 20px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.success { text-align: center; padding: 8px 0; }
.success img { width: 104px; height: 104px; margin: 0 auto 12px; animation: hop 0.7s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.success h2 { margin: 0 0 8px; }
.success .btn { margin-top: 20px; }
@keyframes hop { from { opacity: 0; transform: translateY(40px) scale(0.6); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .success img { animation: none; } }

.info-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 24px; }
/* odd number of tiles: the first one gets the full row */
.info-tiles > :first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.tile { display: flex; align-items: center; gap: 14px; padding: 16px; text-decoration: none; }
.tile .box {
  width: 44px; height: 44px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--accent-green-bg); border: 1px solid var(--accent-green-border); color: var(--accent-green); font-size: 17px;
}
.tile b { display: block; font-size: 16px; line-height: 22px; font-weight: 600; color: var(--text); }
.tile span { display: block; font-size: 14px; line-height: 20px; color: var(--text-3); }
.tile > .oct { margin-left: auto; color: var(--text-3); font-size: 14px; }
@media (max-width: 640px) { .info-tiles { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ account pages (mail links) */

.account { padding: clamp(48px, 8vw, 96px) 0; }
.account [hidden] { display: none !important; }
.account-card { max-width: 560px; margin: 0 auto; padding: clamp(28px, 4vw, 44px); text-align: center; }
.account-card img { width: 104px; height: 104px; margin: 0 auto 12px; }
.account-card .h2 { margin-bottom: 10px; font-size: clamp(28px, 3.4vw, 36px); color: var(--text); }
.account-card .btn { margin-top: 20px; }
.account-card form { text-align: left; }
.account-hint { margin-top: 16px; font-size: 14px; line-height: 21px; color: var(--text-3); }

/* 404 */
.notfound { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 80px 0; }
.notfound img { width: 120px; height: 120px; margin: 0 auto 20px; }
.notfound .lead { margin-top: 12px; }
.notfound .btn { margin-top: 28px; }

/* ------------------------------------------------------------------ footer (legal pages) */

.site-footer { border-top: 1px solid var(--border); padding: 24px 0 calc(24px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--text-3); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.site-footer a { color: var(--text-2); }

/* Embedded in the app's legal sheet (?embed=1). */
.embed .site-header, .embed .site-footer, .embed .skip { display: none; }
.embed .legal-hero { padding-top: 24px; }
.embed .legal { padding-bottom: 32px; }
