/* =========================================================================
   Nabio-Web — styles.css   (Phase 1)
   Static site · dark mode only · system fonts · no build step
   Sections:
     1. Tokens
     2. Reset & base
     3. Typography primitives
     4. Navigation
     5. Layout: stack / panel / band
     6. Hero
     7. Så funkar det (band)
     8. Om Nabio (narrow)
     9. Split sections (Nära dig, Meddelanden, Trygghet)
    10. Dela (sticky crossfade)
    11. Kommer snart
    12. Footer
    13. Buttons & links
    14. Screenshot frame
    15. Reveal animation
    16. Legal / prose pages
    17. Reduced motion
   ========================================================================= */

/* ---- 1. Tokens ---------------------------------------------------------- */
:root {
  /* verified brand colours */
  --ground:  #161826;
  --surface: #232532;
  --green:   #06BE63;
  --lilac:   #9184D9;

  /* derived, kept consistent with the app's dark palette */
  --surface-hi: #2b2e3e;
  --border:     #383b4e;
  --text:       #f5f6fa;
  --text-muted: #aeb2c2;
  --text-faint: #8c91a8;
  --green-tint: rgba(6, 190, 99, 0.13);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  /* neo-grotesque stack for the hero wordmark — closest local match to the
     Hirael reference wordmark (no Hirael source/font files exist in the project) */
  --wordmark-font: "Helvetica Neue", "Helvetica", "Arial", "Liberation Sans", "Nimbus Sans", sans-serif;

  --radius-panel: clamp(20px, 3vw, 32px);
  --radius-shot:  clamp(20px, 2.4vw, 28px);
  --gutter: clamp(12px, 3vw, 28px);
  --stack-gap: clamp(12px, 2.2vw, 20px);
  --maxw: 1180px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;   /* dark scrollbars / form controls, no light UA flash */
}

::selection { background: rgba(6, 190, 99, 0.22); }

/* ---- 2. Reset & base -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-weight: 400; }

img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
a { color: inherit; }

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

#main:focus { outline: none; }   /* skip-link target — momentary focus only */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 300;
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

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

/* ---- 3. Typography primitives --------------------------------------- */
.overline {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-faint);
  margin-bottom: clamp(20px, 2.2vw, 30px);
}

.headline {
  font-size: clamp(1.95rem, 4.6vw, 3.15rem);
  font-weight: 300;
  letter-spacing: -0.014em;
  line-height: 1.16;
  max-width: 22ch;
}
.headline em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

.body-lg {
  color: var(--text-muted);
  font-weight: 400;
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.72;
  margin-top: clamp(20px, 2.4vw, 30px);
  max-width: 42ch;
}

/* ---- 4. Navigation — island tab hanging from the top edge
   (see assets/island.jpeg + assets/IMG_3695) ---------------------- */
.nav {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 100vw;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.6vw, 38px);
  padding: 13px clamp(20px, 2.6vw, 38px) 14px;
  /* square where it meets the top edge, generously rounded below */
  border-radius: 0 0 20px 20px;
  border: 1px solid rgba(245, 243, 240, 0.07);
  border-top: none;
  background: rgba(14, 13, 19, 0.74);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.7);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transition: background 0.25s ease;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  display: block;
  white-space: nowrap;
  text-decoration: none;
  color: rgba(245, 243, 240, 0.78);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.012em;
  transition: color 0.2s ease;
}
.nav-links a:hover,
.nav-links a:focus-visible { color: #fff; }
.nav.is-scrolled .nav-links { background: rgba(11, 10, 15, 0.88); }

@media (max-width: 560px) {
  .nav-links {
    gap: 16px;
    padding: 11px 16px 12px;
    justify-content: flex-start;
  }
  .nav-links a { font-size: 0.74rem; }
}

/* ---- 5. Layout: stack / panel / band ------------------------------ */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
  padding: 0 var(--gutter) var(--gutter);
}

.panel {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  background: var(--surface);
  border-radius: var(--radius-panel);
  padding: clamp(56px, 9vw, 128px) clamp(24px, 6vw, 84px);
}

.band {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(40px, 7vw, 92px) clamp(24px, 6vw, 84px);
}

section[id], .hero { scroll-margin-top: 88px; }

/* ---- 6. Hero — the brand moment (see assets/IMG_3695 + island.jpeg) - */
.hero {
  position: relative;
  overflow: hidden;
  max-width: none;          /* break the panel width — near full-bleed void */
  padding: 0;
  /* light falling into a dark, near-black room: faint smoky banding,
     one muted wine pool, resolving to the normal ground at the bottom */
  background:
    linear-gradient(102deg,
      rgba(255,255,255,0.018) 0%, rgba(255,255,255,0) 20%,
      rgba(255,255,255,0.022) 38%, rgba(255,255,255,0) 58%,
      rgba(255,255,255,0.014) 74%, rgba(255,255,255,0) 100%),
    radial-gradient(54% 44% at 31% 31%, rgba(120, 30, 46, 0.16), rgba(120, 30, 46, 0) 70%),
    linear-gradient(180deg, #141019 0%, #13111c 55%, #161826 100%);
}
/* one soft pool of dim wine light, drifting very slowly (off for reduced motion) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(32% 30% at 34% 24%, rgba(134, 34, 52, 0.18), rgba(134, 34, 52, 0) 72%);
  animation: hero-drift 40s ease-in-out infinite alternate;
}
@keyframes hero-drift {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.8; }
  to   { transform: translate3d(2.5%, -2%, 0) scale(1.05); opacity: 1; }
}

/* first screen: big void up top, content anchored to the bottom */
.hero-viewport {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding:
    clamp(120px, 24vh, 260px)
    clamp(18px, 4.5vw, 66px)
    clamp(34px, 7vh, 76px);
}

/* "Nabio UF" wordmark lower-left, description + CTA lower-right, baselines aligned */
.hero-baseline {
  display: flex;
  flex-direction: column;
  gap: clamp(30px, 7vh, 60px);
}

.wordmark {
  font-family: var(--wordmark-font);
  font-size: clamp(3rem, 11.5vw, 8.5rem);
  font-weight: 300;
  letter-spacing: -0.015em;
  line-height: 1;
  color: #f2efe9;                 /* soft warm off-white */
  text-shadow: 0 0 70px rgba(242, 239, 233, 0.14);   /* very subtle bloom */
}

.hero-desc { max-width: 34ch; }
.hero-desc p {
  color: var(--text-muted);
  font-weight: 400;
  font-size: clamp(0.9rem, 1.05vw, 1rem);
  line-height: 1.55;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin-top: clamp(16px, 2vw, 22px);
  padding: 6px 6px 6px 16px;
  border-radius: 999px;
  background: rgba(242, 239, 233, 0.08);
  border: 1px solid rgba(242, 239, 233, 0.2);
  color: rgba(242, 239, 233, 0.92);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.hero-pill:hover {
  background: rgba(242, 239, 233, 0.14);
  border-color: rgba(242, 239, 233, 0.34);
}
.hero-pill-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8em;
  height: 1.8em;
  border-radius: 999px;
  border: 1px solid rgba(242, 239, 233, 0.28);
  color: rgba(242, 239, 233, 0.92);
  font-size: 0.82em;
  transition: transform 0.2s ease;
}
.hero-pill:hover .hero-pill-arrow { transform: translateX(2px); }

@media (min-width: 820px) {
  .hero-baseline {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    gap: clamp(40px, 6vw, 110px);
  }
  .hero-desc {
    flex: 0 0 auto;
    padding-bottom: clamp(2px, 0.6vw, 8px);
  }
}

/* ---- 7. Så funkar det (band) ------------------------------------ */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(26px, 4vw, 52px);
  margin-top: clamp(24px, 3vw, 40px);
  border-top: 1px solid var(--border);
  padding-top: clamp(28px, 3.4vw, 44px);
}
.step-num {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--green);
  margin-bottom: 0.7rem;
}
.steps h3 {
  font-size: clamp(1.1rem, 1.9vw, 1.35rem);
  font-weight: 400;
  letter-spacing: -0.005em;
  margin-bottom: 0.45rem;
}
.steps p { color: var(--text-muted); font-size: 1rem; line-height: 1.65; }

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

/* ---- 8. Om Nabio (narrow) -------------------------------------- */
.panel.narrow { text-align: center; }
.panel.narrow .overline { margin-inline: auto; }
.panel.narrow .headline {
  margin-inline: auto;
  max-width: 18ch;
  font-size: clamp(2rem, 5vw, 3.4rem);
}
.panel.narrow .body-lg {
  margin-inline: auto;
  max-width: 46ch;
}
.om-tagline {
  margin: clamp(18px, 2.4vw, 28px) auto 0;
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--text);
}
.om-tagline + .body-lg { margin-top: clamp(20px, 2.4vw, 30px); }

/* ---- 9. Split sections --------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(34px, 5vw, 64px);
  align-items: center;
}
.split-copy .headline { font-size: clamp(1.85rem, 4.1vw, 2.85rem); }

@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 0.82fr; }
  .split--reverse .split-copy { order: 2; }
  .split--reverse .split-shot { order: 1; }
}

/* ---- 10. Dela (sticky crossfade) ---------------------------- */
.dela-head { max-width: 28ch; }
.dela-head .headline { font-size: clamp(1.85rem, 4.1vw, 2.85rem); }

.dela-grid {
  margin-top: clamp(28px, 4vw, 48px);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 56px);
}
.dela-step-text h3 {
  font-size: clamp(1.12rem, 2vw, 1.4rem);
  font-weight: 400;
  letter-spacing: -0.005em;
  margin-bottom: 0.5rem;
}
.dela-step-text p { color: var(--text-muted); max-width: 40ch; line-height: 1.7; }
.dela-step-shot { margin-top: clamp(16px, 2.4vw, 26px); }
.dela-step-shot .shot { max-width: 320px; }

.dela-sticky { display: none; }

@media (min-width: 900px) {
  .dela-grid {
    grid-template-columns: 0.9fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: start;
  }
  .dela-sticky {
    display: block;
    position: sticky;
    top: 17vh;
  }
  .dela-sticky .shot { position: relative; max-width: 330px; }
  .dela-img { transition: opacity 0.5s ease; }
  .dela-img[data-step="1"] {
    position: absolute;
    inset: 0;
    opacity: 0;
  }
  .dela[data-active="1"] .dela-img[data-step="0"] { opacity: 0; }
  .dela[data-active="1"] .dela-img[data-step="1"] { opacity: 1; }

  .dela-step-shot { display: none; }
  .dela-step {
    min-height: 76vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* ---- 11. Kommer snart -------------------------------------- */
.kommer .overline { color: var(--text-muted); }
.kommer .btn { margin-top: clamp(24px, 3vw, 34px); }
/* centred showcase: just the app icon, nothing else */
.kommer-shot {
  margin: clamp(52px, 9vw, 104px) auto clamp(8px, 2vw, 24px);
  display: flex;
  justify-content: center;
}
.app-showcase {
  width: clamp(190px, 44vw, 340px);
  height: auto;
  filter: drop-shadow(0 30px 64px rgba(0, 0, 0, 0.55));
}

/* ---- 12. Footer ------------------------------------------- */
.footer {
  position: relative;
  width: calc(100% - 2 * var(--gutter));   /* line up with the panels above */
  max-width: var(--maxw);
  margin: var(--stack-gap) auto 0;
  padding: clamp(48px, 7vw, 88px) clamp(24px, 6vw, 84px) clamp(30px, 4vw, 46px);
  overflow: hidden;
}
.footer-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 48px);
}
.footer-h {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-faint);
  margin-bottom: 1.1rem;
  font-weight: 500;
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.55rem; }
.footer-col a, .footer-col li {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.96rem;
  overflow-wrap: break-word;   /* long e-mail must not overflow a narrow column */
}
.footer-col a:hover { color: var(--text); }
.footer-col a.lilac { color: var(--lilac); }
.footer-col a.lilac:hover { color: #b7ace9; }

.footer-wordmark {
  position: absolute;
  left: 0; right: 0;
  bottom: -0.16em;
  text-align: center;
  font-weight: 200;
  letter-spacing: -0.012em;
  font-size: clamp(5rem, 21vw, 16rem);
  line-height: 1;
  color: var(--text);
  opacity: 0.05;
  user-select: none;
  pointer-events: none;
  z-index: 0;
}

.footer-legal {
  position: relative;
  z-index: 1;
  margin-top: clamp(44px, 6vw, 76px);
  padding-top: clamp(20px, 2.4vw, 28px);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.83rem;
  color: var(--text-faint);
}
.footer-legal nav { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.footer-legal a { color: var(--text-faint); text-decoration: none; }
.footer-legal a:hover { color: var(--text-muted); }

@media (min-width: 760px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- 13. Buttons & links -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.9em 1.4em;
  border-radius: 999px;
  background: var(--green);
  color: var(--ground);
  font: inherit;
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: 0.005em;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.btn .arrow { transition: transform 0.2s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn:disabled,
.btn[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.btn:disabled:hover .arrow,
.btn[aria-disabled="true"]:hover .arrow { transform: none; }

.textlink {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
}
.textlink:hover { border-color: var(--green); }

/* ---- 14. Screenshot frame ----------------------------- */
.shot {
  margin-inline: auto;
  border-radius: var(--radius-shot);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--ground);
  box-shadow: 0 26px 64px -24px rgba(0, 0, 0, 0.55);
  max-width: 340px;
}
.shot img { width: 100%; height: auto; }
[data-parallax] { overflow: hidden; }
[data-parallax] img { will-change: transform; }

/* ---- 15. Reveal animation ---------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.js [data-reveal].in-view { opacity: 1; transform: none; }

.js .steps li:nth-child(2) { transition-delay: 0.08s; }
.js .steps li:nth-child(3) { transition-delay: 0.16s; }

/* ---- 16. Legal / prose pages ------------------------- */
.prose {
  max-width: 720px;
  margin: clamp(120px, 16vh, 190px) auto clamp(60px, 10vh, 120px);
  padding: 0 var(--gutter);
}
.prose h1 {
  font-size: clamp(2rem, 4.6vw, 2.9rem);
  font-weight: 300;
  letter-spacing: -0.014em;
  line-height: 1.16;
  margin-bottom: 1rem;
}
.prose .notice {
  background: var(--green-tint);
  border: 1px solid rgba(6, 190, 99, 0.35);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 0.96rem;
  margin: 1.5rem 0 2.5rem;
}
.prose h2 {
  font-size: clamp(1.18rem, 2.2vw, 1.45rem);
  font-weight: 400;
  margin: 2.4rem 0 0.6rem;
  letter-spacing: -0.005em;
}
.prose h3 {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  font-weight: 500;
  color: var(--text);
  margin: 1.5rem 0 0.35rem;
  letter-spacing: -0.003em;
}
.prose p, .prose li { color: var(--text-muted); margin-bottom: 0.9rem; line-height: 1.72; }
.prose ul { list-style: disc; padding-left: 1.25rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose a { color: var(--lilac); }
.prose code {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.05em 0.4em;
}
.prose .overline { color: var(--text-faint); }
/* internal marker for unresolved legal items — removed before publication */
.prose .todo {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  background: rgba(145, 132, 217, 0.10);
  border: 1px solid rgba(145, 132, 217, 0.28);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0.5rem 0 1.4rem;
}

/* ---- 17. Reduced motion ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; transition: opacity 0.2s linear; }
  .dela-img { transition: none !important; }
  [data-parallax] img { transform: none !important; }
  .hero::before { animation: none; }
}
