/* sarabarnevern.no. The colours are the widget's (widget/src/dom.js): its
   slate stage, its teal button, its mint. The font is self-hosted, so the
   page asks no other host for anything but Sara herself. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #0a1120;
  --slate: #0f172a;
  --slate-2: #1e293b;
  --teal: #0f766e;
  --teal-deep: #0c5d57;
  --mint: #5eead4;
  --ink: #0f172a;
  --text: #334155;
  --muted: #56637a;
  --paper: #f4f7f8;
  --card: #ffffff;
  --line: #e2e8f0;
  --on-night: #e2e8f0;
  --on-night-mid: #a9b6c8;
  --pad: clamp(1.75rem, 1.4rem + 1vw, 2rem); /* inside cards and panels */
  --fab: clamp(48px, 8vmin, 64px);
  --fab-gap: 5vmin;
  color-scheme: light;
}
@supports (width: 1dvmin) {
  :root { --fab: clamp(48px, 8dvmin, 64px); --fab-gap: 5dvmin; }
}

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

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

body {
  margin: 0;
  background: var(--card);
  color: var(--text);
  font: 1.0625rem/1.6 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  word-spacing: 0.06em; /* the font's own word space is narrow */
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; color: var(--ink); line-height: 1.1; text-wrap: balance; word-spacing: 0.12em; }
h2 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.75rem); font-weight: 800; letter-spacing: -0.03em; }
h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: var(--teal-deep); text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
.hero :focus-visible, .top :focus-visible, footer :focus-visible { outline-color: var(--mint); }

.wrap { width: min(100% - 2.5rem, 70rem); margin-inline: auto; }

.grad {
  background: linear-gradient(120deg, #5eead4, #2dd4bf 55%, #99f6e4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 5;
  background: #fff; color: var(--ink);
  padding: 0.6rem 1rem; border-radius: 10px;
}
.skip:focus { top: 1rem; }

/* Header, over the hero */
.top { position: absolute; inset: 0 0 auto 0; z-index: 3; }
.top-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding: 1.5rem 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem; margin: 0;
  font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em;
  color: #f8fafc; text-decoration: none;
}
.brand:hover { color: #fff; }
.brand-dot {
  width: 0.7rem; height: 0.7rem; border-radius: 50%;
  background: var(--mint); box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.18);
}
nav ul { display: flex; gap: 0.25rem; }
nav a {
  display: inline-block; padding: 0.45rem 0.85rem; border-radius: 999px;
  color: var(--on-night-mid); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  transition: color 0.15s, background-color 0.15s;
}
nav a:hover { color: #fff; background: rgba(148, 163, 184, 0.14); }

/* Hero: the widget's stage, page-wide */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  min-height: 100vh; min-height: min(100svh, 58rem);
  padding-top: 7rem;
  text-align: center; color: var(--on-night);
  background:
    radial-gradient(58rem 30rem at 50% 104%, rgba(20, 184, 166, 0.34), transparent 64%),
    radial-gradient(34rem 22rem at 6% -6%, rgba(172, 62, 128, 0.16), transparent 62%),
    radial-gradient(40rem 26rem at 96% -10%, rgba(94, 234, 212, 0.10), transparent 60%),
    var(--night);
}
.tag {
  display: inline-flex; align-items: center; gap: 0.55rem; margin: 0;
  padding: 0.35rem 0.95rem; border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24); background: rgba(148, 163, 184, 0.08);
  color: #cbd5e1; font-size: 0.875rem; font-weight: 500;
}
.tag-dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--mint); }
h1 {
  margin: 1.5rem 0;
  font-size: clamp(2.5rem, 1.3rem + 5.4vw, 5rem);
  font-weight: 800; letter-spacing: -0.045em; line-height: 1.02; color: #f8fafc;
}
.hero-lead {
  max-width: 38rem; margin: 0 auto 2rem; text-wrap: balance;
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem); color: #cbd5e1;
}
.hero-action { margin: 0 0 1rem; }
.hero-small { margin: 0; font-size: 0.875rem; color: var(--on-night-mid); text-wrap: balance; }
/* The button opens the widget; it has nothing to do before the widget is
   there. Hidden without leaving a hole to jump when it arrives. */
.needs-sara { visibility: hidden; }
.has-sara .needs-sara { visibility: visible; }

.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.95rem 1.7rem; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 700; color: #042f2c; text-decoration: none;
  background: linear-gradient(135deg, #99f6e4, #5eead4 45%, #2dd4bf);
  box-shadow: 0 10px 34px rgba(45, 212, 191, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(45, 212, 191, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.btn:active { transform: translateY(0); filter: brightness(0.96); }
.btn svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.hero-figure {
  position: relative; width: 100%; margin-top: auto;
  height: clamp(15rem, 42vh, 25rem);
}
/* Above the rings, which reach up behind the text. */
.hero-copy { position: relative; z-index: 2; padding-bottom: 2.5rem; }
.hero-figure img {
  position: absolute; left: 50%; top: 0; z-index: 1;
  width: clamp(14.5rem, 12rem + 9vw, 20rem); height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.5));
}
/* A voice assistant: rings of sound around her. */
.rings { pointer-events: none; }
.rings span {
  position: absolute; left: 50%; top: 46%;
  width: var(--d); height: var(--d); margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
  border-radius: 50%; border: 1px solid rgba(94, 234, 212, var(--a));
  animation: breathe 7s ease-in-out infinite alternate;
}
.rings span:nth-child(1) { --d: 24rem; --a: 0.30; background: radial-gradient(circle, rgba(45, 212, 191, 0.22), transparent 68%); }
.rings span:nth-child(2) { --d: 38rem; --a: 0.16; animation-delay: -2.3s; }
.rings span:nth-child(3) { --d: 54rem; --a: 0.08; animation-delay: -4.6s; }
@keyframes breathe { from { transform: scale(0.97); } to { transform: scale(1.04); } }

/* While the real Sara is open in the corner, the picture steps back. */
.float, .hero-figure img { transition: opacity 0.3s ease; }
.sara-open .float { opacity: 0; }
.sara-open .hero-figure img { opacity: 0.35; }
.bubble {
  position: absolute; z-index: 2; left: 50%; bottom: 1.25rem; margin: 0;
  width: max-content; max-width: min(17rem, calc(100% - 2.5rem));
  transform: translateX(-50%);
  padding: 0.7rem 1rem; border-radius: 16px;
  background: rgba(30, 41, 59, 0.78); border: 1px solid rgba(148, 163, 184, 0.26);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #f1f5f9; font-size: 0.95rem; line-height: 1.4; text-align: left;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.hero-langs { display: none; }

/* Sections */
.section { padding: clamp(4rem, 3rem + 5vw, 7rem) 0; }
.section.tight { padding-top: 0; }
.paper { background: var(--paper); }
.section-head { max-width: 44rem; margin-bottom: 2.5rem; }
.section-head h2 { margin-bottom: 1rem; }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--muted); }
.section-head .lead { margin: 0; }

/* Bento */
.bento { display: grid; gap: 1rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: var(--pad);
}
.card p { margin: 0; color: var(--muted); }
.card h3 { margin: 1.25rem 0 0.5rem; }
.icon {
  display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 14px;
  background: #e3f6f2; color: var(--teal-deep);
}
.icon svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card.dark {
  border-color: transparent; color: var(--on-night);
  background:
    radial-gradient(34rem 20rem at 100% 0%, rgba(20, 184, 166, 0.28), transparent 62%),
    radial-gradient(circle at 0% 0%, var(--slate-2), var(--slate) 62%);
}
.card.dark p { color: #cbd5e1; max-width: 30rem; }
.card.dark .big {
  margin: 0 0 0.6rem; color: #f8fafc; max-width: none;
  font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1;
}
.big .grad { font-size: 4.5rem; letter-spacing: -0.05em; margin-right: 0.15em; }
.langs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.langs li {
  padding: 0.3rem 0.85rem; border-radius: 999px; font-size: 0.95rem; line-height: 1.5;
  background: rgba(148, 163, 184, 0.12); border: 1px solid rgba(148, 163, 184, 0.22); color: #e2e8f0;
}

/* Can and cannot */
.split { display: grid; gap: 1rem; }
.panel { border-radius: 24px; padding: var(--pad); border: 1px solid var(--line); }
.panel.yes { background: #ecf8f5; border-color: #cfeae4; }
.panel.no { background: var(--paper); }
.panel h3 { font-size: 1.3rem; margin-bottom: 1rem; }
.panel li { position: relative; padding: 0.5rem 0 0.5rem 2.4rem; color: var(--ink); }
.panel li:last-child { padding-bottom: 0; }
.panel li::before {
  content: ""; position: absolute; left: 0; top: 0.55rem;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
}
.panel li::after { content: ""; position: absolute; }
.yes li::before { background: var(--teal); }
.yes li::after {
  left: 0.55rem; top: 0.87rem; width: 0.4rem; height: 0.7rem;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.no li::before { background: #dde4ea; }
.no li::after {
  left: 0.4rem; top: 0.95rem; width: 0.7rem; height: 0.7rem; transform: rotate(45deg);
  background:
    linear-gradient(#56637a, #56637a) center / 100% 2.5px no-repeat,
    linear-gradient(#56637a, #56637a) center / 2.5px 100% no-repeat;
}

/* Privacy: a night panel */
.night {
  border-radius: 32px; padding: clamp(1.75rem, 0.2rem + 6vw, 4rem);
  color: var(--on-night);
  background:
    radial-gradient(44rem 24rem at 100% 100%, rgba(20, 184, 166, 0.26), transparent 62%),
    radial-gradient(30rem 20rem at 0% 0%, rgba(172, 62, 128, 0.14), transparent 62%),
    var(--night);
}
.night h2 { color: #f8fafc; max-width: 38rem; }
.facts { display: grid; gap: 1.5rem; margin: 2.5rem 0; }
.facts > div { border-top: 1px solid rgba(94, 234, 212, 0.45); padding-top: 1.25rem; }
.facts h3 { color: #f8fafc; margin-bottom: 0.5rem; }
.facts p { margin: 0; color: #cbd5e1; }
.night-note { margin: 0; max-width: 46rem; color: var(--on-night-mid); font-size: 0.975rem; }

/* Footer */
footer { background: var(--night); color: var(--on-night-mid); padding: 4rem 0 2rem; font-size: 0.975rem; }
.foot { display: grid; gap: 2rem; }
footer h2 { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #f8fafc; }
/* The name and the two headings share a row height, so the three columns
   start on one line and their text does too. */
footer h2, footer .brand { display: flex; align-items: center; min-height: 1.75rem; margin: 0 0 0.75rem; line-height: 1; }
footer p { margin: 0 0 0.5rem; }
footer a { color: var(--mint); }
footer a:hover { color: #fff; }
.foot-end { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(148, 163, 184, 0.18); font-size: 0.875rem; }
.foot-end p { margin: 0; padding-right: calc(var(--fab) + var(--fab-gap)); }

/* The pointer to Sara's button: a small label and one soft ring. */
.sara-hint, .sara-ring { position: fixed; z-index: 10000; }
.sara-hint {
  right: calc(var(--fab-gap) + var(--fab) + 16px);
  bottom: calc(var(--fab-gap) + var(--fab) / 2);
  padding: 0.5rem 0.95rem; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--ink); font-size: 0.925rem; font-weight: 700; line-height: 1.3;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.06);
  opacity: 0; visibility: hidden; transform: translate(10px, 50%);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s 0.35s;
}
.sara-hint::after {
  content: ""; position: absolute; right: -5px; top: 50%;
  width: 11px; height: 11px; background: #fff; border-radius: 2px;
  transform: translateY(-50%) rotate(45deg);
}
.show-hint .sara-hint { opacity: 1; visibility: visible; transform: translate(0, 50%); transition-delay: 0s; }
.sara-ring {
  right: var(--fab-gap); bottom: var(--fab-gap); width: var(--fab); height: var(--fab);
  border-radius: 50%; pointer-events: none;
}
.show-hint .sara-ring { animation: ring 2.2s ease-out 3; }
@keyframes ring {
  from { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.55); }
  to { box-shadow: 0 0 0 22px rgba(45, 212, 191, 0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rings span, .show-hint .sara-ring { animation: none; }
  .btn, .sara-hint, .float, .hero-figure img { transition: none; }
}

@media (max-width: 39.99rem) {
  nav li:not(:last-child) { display: none; }
}
@media (min-width: 40rem) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .card.wide, .card:last-child { grid-column: 1 / -1; }
  .split { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: repeat(3, 1fr); }
  .foot { grid-template-columns: 1.3fr 1fr 1.3fr; }
  /* Room beside her: the caption by her head, a few languages opposite. */
  .bubble {
    left: calc(50% + clamp(7rem, 10vw, 9.5rem)); bottom: auto; top: 9%;
    transform: none; border-radius: 16px 16px 16px 4px;
  }
  .hero-langs {
    display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem;
    position: absolute; z-index: 2; right: calc(50% + clamp(7.5rem, 11vw, 10.5rem)); top: 14%;
  }
  .hero-langs li {
    padding: 0.35rem 0.9rem; border-radius: 999px; font-size: 0.925rem;
    background: rgba(30, 41, 59, 0.6); border: 1px solid rgba(148, 163, 184, 0.24); color: #e2e8f0;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .hero-langs li:nth-child(2) { margin-right: 2.2rem; }
  .hero-langs li:nth-child(3) { margin-right: 0.6rem; }
}
/* A wide, low window (a laptop): keep her face above the fold. */
@media (min-width: 62rem) and (max-height: 46rem) {
  .hero { padding-top: 5.5rem; }
  h1 { font-size: 4rem; margin: 1rem 0 0.9rem; }
}
@media (min-width: 62rem) {
  .bento { grid-template-columns: repeat(6, 1fr); }
  .card, .card:last-child { grid-column: span 2; }
  .card.wide { grid-column: span 6; display: grid; grid-template-columns: 1fr 1.2fr; gap: 2.5rem; align-items: center; }
  .card.wide .langs { margin-top: 0; }
}
