:root {
  color-scheme: dark;
  --page: #182b36;
  --panel: #1d3440;
  --card: #223b47;
  --ink: #eff8f5;
  --muted: #bdd2d5;
  --line: #45636e;
  --accent: #c3ede4;
  --accent-ink: #102b2c;
  --hover: #d7f6ed;
  --highlight: #dcc69c;
  --ambient: #83b9ba2b;
  --ambient-soft: #5c7f981c;
  --background-sheen: #9fdecc38;
  --background-flake: #d7eced66;
  --chapter: #1b323e;
  --glint: #c6f4e9bb;
  --primary-glint: #3a837e99;
  --lift: #091b2444;
  font: 1rem/1.55 system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
}
:root[data-theme="light"] {
  --page: #385363;
  --panel: #466675;
  --card: #466472;
  --ink: #f1faf9;
  --muted: #dce9ec;
  --line: #678692;
  --accent: #d0f0e9;
  --accent-ink: #173b43;
  --hover: #e1fbf4;
  --highlight: #f1d7a8;
  --ambient: #a5cdca3b;
  --ambient-soft: #7bacbf34;
  --background-sheen: #c6f3e444;
  --background-flake: #e9f7f583;
  --chapter: #3d5a69;
  --glint: #d5f9efce;
  --primary-glint: #3a837e99;
  --lift: #0e253244;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p { margin: 0; }
body { isolation: isolate; }
.scroll-line {
  position: fixed;
  z-index: 4;
  inset: 0 0 auto;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--accent), var(--glint));
  box-shadow: 0 0 .7rem var(--glint);
  transform-origin: left center;
  transform: scaleX(var(--page-progress, 0));
}
.page-background {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(ellipse at 22% 0, var(--ambient), transparent 64%),
              radial-gradient(ellipse at 85% 72%, var(--ambient-soft), transparent 61%);
}
.page-background::before, .page-background::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.page-background::before {
  inset: -14%;
  background: radial-gradient(ellipse at 30% 43%, var(--background-sheen), transparent 49%),
              radial-gradient(ellipse at 78% 74%, var(--ambient-soft), transparent 46%);
  opacity: .7;
}
.page-background::after {
  inset: -264px -208px 0;
  background:
    radial-gradient(circle at 33px 46px, var(--background-flake) 0 1px, transparent 1.8px),
    radial-gradient(circle at 164px 183px, var(--background-flake) 0 1px, transparent 1.8px);
  background-size: 208px 264px;
  opacity: .54;
}
a { color: inherit; text-underline-offset: .24em; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.wrap { width: min(100% - 2.5rem, 74rem); margin-inline: auto; }
.masthead, nav, .brand, .actions, .footer { display: flex; flex-wrap: wrap; align-items: center; }
.masthead { min-height: 5rem; gap: .75rem 1.5rem; justify-content: space-between; padding-block: .75rem; }
.brand { gap: .55rem; font: 1.7rem Georgia, serif; text-decoration: none; }
nav { gap: .65rem 1.45rem; }
nav a { position: relative; font-size: .925rem; text-decoration: none; }
.theme-button { color: var(--muted); background: transparent; padding: .45rem .75rem; border: 1px solid var(--line); border-radius: .4rem; cursor: pointer; }
.story { position: relative; isolation: isolate; }
.hero { position: relative; display: grid; align-items: stretch; grid-template-columns: 1fr 1.08fr; overflow: hidden; min-height: 31rem; border: 1px solid var(--line); border-radius: 1.35rem; background: var(--panel); }
.hero-copy { position: relative; z-index: 1; align-self: center; padding: clamp(1.6rem, 5vw, 4.5rem); padding-right: 1.25rem; }
.hero-copy p:not(.platform) { max-width: 35ch; margin-top: 1.2rem; color: var(--muted); font-size: clamp(1rem, 1.9vw, 1.13rem); }
.hero-media { overflow: hidden; }
.hero-photo { display: block; width: 100%; height: 100%; min-height: 24rem; max-height: 37rem; object-fit: cover; object-position: 54% 46%; }
h1, h2 { font-family: Georgia, serif; font-weight: 400; letter-spacing: -.05em; }
h1 { font-size: clamp(2.55rem, 5.2vw, 5rem); line-height: .99; }
h2 { font-size: clamp(2.1rem, 4vw, 3.35rem); line-height: 1.12; }
h3 { font-weight: 650; }
.actions { gap: .65rem; }
.hero .actions { margin-top: 1.75rem; }
.button { display: inline-flex; min-height: 2.9rem; justify-content: center; align-items: center; border: 1px solid transparent; border-radius: .55rem; padding: .62rem 1rem; text-align: center; text-decoration: none; font-weight: 650; cursor: pointer; }
.primary { color: var(--accent-ink); background: var(--accent); }
.primary:not(:disabled):hover { background: var(--hover); }
.secondary { color: var(--ink); border-color: var(--line); background: transparent; }
.secondary:hover { background: var(--card); }
.button:disabled { opacity: .65; cursor: default; }
.platform { margin-top: .9rem; font-size: .875rem; color: var(--muted); }
.section { padding-top: clamp(2.8rem, 7vw, 6rem); scroll-margin-top: 1.25rem; }
.pricing-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: var(--chapter);
}
.pricing-content { padding: clamp(1.25rem, 3.8vw, 3rem); }
.features-chapter {
  position: relative;
  z-index: 1;
  margin-top: clamp(1.4rem, 3vw, 2.6rem);
  padding: clamp(1.25rem, 3.8vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: var(--chapter);
  scroll-margin-top: 1rem;
}
.features-chapter::before {
  content: "";
  position: absolute;
  inset: 0 12% auto;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--glint), transparent);
}
.network-mode {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.7fr);
  align-items: center;
  gap: .75rem 1.25rem;
  margin-top: 1.25rem;
  padding: clamp(1rem, 2.2vw, 1.55rem);
  border-radius: .7rem;
  border-left: 2px solid var(--glint);
  background: var(--panel);
}
.network-mode h3 { font: 400 clamp(1.375rem, 2.6vw, 2rem)/1.14 Georgia, serif; }
.network-mode p { max-width: 62ch; color: var(--muted); }
.features, .plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .9rem; margin-top: 1.4rem; }
.features article, .plan, .account { border: 1px solid var(--line); border-radius: .85rem; background: var(--card); padding: 1.25rem; }
.features p, .plan p, .account p, .feedback { color: var(--muted); margin-top: .45rem; }
.plan { display: flex; flex-direction: column; gap: .45rem; }
.plan .price { margin: .15rem 0 0; font: 2.35rem/1.18 Georgia, serif; letter-spacing: -.04em; color: var(--ink); }
.plan .button { margin-top: auto; }
.plan p:last-of-type { margin-bottom: .7rem; }
.plan .discount { color: var(--highlight); font-size: .875rem; }
.text-link { display: inline-block; margin-top: 1rem; }
.account { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: clamp(1.25rem, 3.5vw, 2rem); }
.account .feedback { flex-basis: 100%; }
.feedback:empty { display: none; }
.footer { justify-content: space-between; gap: 1rem; margin-top: clamp(2.7rem, 5vw, 5rem); padding-block: 1.6rem; border-top: 1px solid var(--line); color: var(--muted); }

.cabinet { padding-top: clamp(1.7rem, 5vw, 4rem); }
.cabinet-head, .panel-heading, .cabinet-nav, .cabinet-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
}
.cabinet-head p { margin-top: .55rem; color: var(--muted); overflow-wrap: anywhere; }
#cabinet-feedback:not(:empty) {
  position: sticky;
  z-index: 3;
  top: .75rem;
  margin-top: 1rem;
  padding: .6rem .9rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--panel);
  color: var(--ink);
}
.cabinet-nav {
  justify-content: flex-start;
  margin: 1.75rem 0 1.15rem;
  padding-block: .8rem;
  border-block: 1px solid var(--line);
}
.cabinet-nav a { position: relative; }
.cabinet-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1rem; }
.cabinet-panel {
  min-width: 0;
  padding: clamp(1.15rem, 3.2vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  scroll-margin-top: 1.5rem;
}
.cabinet-panel h2 { font-size: clamp(1.65rem, 3vw, 2.45rem); }
.cabinet-panel p { margin-top: .5rem; }
.cabinet-login { max-width: 39rem; margin-top: 1.5rem; }
.cabinet-login p { margin-bottom: 1.1rem; color: var(--muted); }
.subscription-panel {
  background: linear-gradient(90deg, #102631 38%, #102631c9 61%, #10263126),
              url("/site-assets/fjord.jpg") center 48% / cover;
  color: #eff8f5;
}
.subscription-panel .secondary { color: #eff8f5; background: #19333b; }
.subscription-content { width: min(100%, 31rem); }
.subscription-content .actions { margin-top: 1.15rem; }
.subscription-status { color: #b7ddd5; }
.subscription-plan { font: 1.65rem/1.2 Georgia, serif; }
.device-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.payments-panel { grid-column: 1 / -1; }
.cabinet-list { margin: .8rem 0 0; padding: 0; list-style: none; }
.cabinet-list li { padding-block: .75rem; border-top: 1px solid var(--line); }
.cabinet-list p { margin: 0; color: var(--muted); }
.cabinet-row > div { min-width: 0; }
.cabinet-row strong { overflow-wrap: anywhere; }
.cabinet-row .button { min-height: 2.45rem; padding: .4rem .8rem; font-size: .9rem; }
.payment-detail { font-size: .94rem; }
.unlink-dialog {
  width: min(100% - 2rem, 26rem);
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  color: var(--ink);
  background: var(--panel);
}
.unlink-dialog::backdrop { background: #071520b3; }
.unlink-dialog h2 { font-size: 1.8rem; }
.unlink-dialog p { margin: .75rem 0 1.2rem; color: var(--muted); overflow-wrap: anywhere; }
.unlink-dialog .actions { justify-content: flex-end; }

:where(.button, .theme-button, .features article, .plan, .account) {
  position: relative;
  transition: background-color .24s ease, box-shadow .25s ease, transform .25s ease;
}
:where(.button, .theme-button, nav a, .features article, .plan, .account)::after {
  content: "";
  position: absolute;
  inset: 0 12% auto;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--glint) 48%, transparent);
  transform: scaleX(.24);
  opacity: 0;
  transition: opacity .25s ease, transform .4s ease;
}
.primary::after { background: linear-gradient(90deg, transparent, var(--primary-glint) 48%, transparent); }
nav a::after { inset: auto 0 -.36rem; }
:where(.button:not(:disabled), .theme-button, nav a):focus-visible::after,
:where(.button:not(:disabled), .theme-button):active::after,
:where(.plan, .account):focus-within::after {
  opacity: 1;
  transform: scaleX(1);
}
.button:not(:disabled):active { transform: translateY(1px); }
@media (hover: hover) {
  :where(.button:not(:disabled), .theme-button, nav a, .features article, .plan, .account):hover::after {
    opacity: 1;
    transform: scaleX(1);
  }
  :where(.button:not(:disabled), .theme-button, .features article, .plan):hover {
    box-shadow: 0 .45rem 1.2rem var(--lift);
    transform: translateY(-2px);
  }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; transition: background-color .28s ease, color .28s ease; }
  .page-background::before { animation: ambient 24s ease-in-out infinite alternate; }
  .page-background::after { animation: flurries 68s linear infinite; }
  .hero-copy > * { animation: hero-rise .58s cubic-bezier(.2, .7, .3, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: .08s; }
  .hero-copy > :nth-child(3) { animation-delay: .14s; }
  .hero-copy > :nth-child(4) { animation-delay: .2s; }
  .reveal { animation: rise .55s cubic-bezier(.2, .7, .3, 1) both; }
  [data-panel].reveal, .features article.reveal {
    animation: panel-rise .72s cubic-bezier(.2, .7, .22, 1) var(--reveal-delay, 0s) both;
  }
  [data-panel].reveal:focus-within { animation: none; }
  .devices-panel, .features article:nth-child(2) { --reveal-delay: .09s; }
  .features article:nth-child(3) { --reveal-delay: .16s; }
  .reveal-pending:not(:focus-within) { opacity: 0; translate: 0 .9rem; }
  .story-motion .hero-photo {
    transform: translateY(calc(var(--story-progress, 0) * clamp(.5rem, 2vw, 1.65rem)))
               scale(calc(1 + var(--story-progress, 0) * .13));
    will-change: transform;
  }
  .story-motion .features-chapter { transform: translateY(calc((1 - var(--story-progress, 0)) * 1rem)); }
  @keyframes rise {
    from { opacity: 0; translate: 0 .9rem; }
    to { opacity: 1; translate: 0 0; }
  }
  @keyframes hero-rise {
    from { opacity: .65; translate: 0 .55rem; }
    to { opacity: 1; translate: 0 0; }
  }
  @keyframes panel-rise {
    from { opacity: 0; translate: 0 1.65rem; scale: .98; }
    to { opacity: 1; translate: 0 0; scale: 1; }
  }
  @keyframes ambient {
    from { transform: translate(-4%, 0); opacity: .6; }
    to { transform: translate(4%, -3%); opacity: 1; }
  }
  @keyframes flurries { to { transform: translate(208px, 264px); } }
}
@supports (clip-path: inset(0)) {
  @media (prefers-reduced-motion: no-preference) {
    .pricing-pending:not(:focus-within) .pricing-content { clip-path: inset(0 100% 0 0); }
    .pricing-enter:not(:focus-within) .pricing-content {
      animation: pricing-reveal .8s cubic-bezier(.22, .65, .25, 1) both;
    }
    .pricing-enter::after {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      background: linear-gradient(90deg, transparent 0%, var(--background-sheen) 6%, transparent 12%);
      animation: pricing-sweep .8s cubic-bezier(.22, .65, .25, 1) both;
    }
    @keyframes pricing-reveal {
      from { clip-path: inset(0 100% 0 0); }
      to { clip-path: inset(0 0 0 0); }
    }
    @keyframes pricing-sweep {
      from { transform: translateX(-8%); opacity: 0; }
      18% { opacity: 1; }
      to { transform: translateX(100%); opacity: 0; }
    }
  }
}
@media (min-width: 58rem) and (min-height: 43rem) and (prefers-reduced-motion: no-preference) {
  .story-motion .hero { position: sticky; top: 1rem; }
  .story-motion .hero:focus-within { z-index: 2; }
  .story-motion .features-chapter { box-shadow: 0 -.35rem 2rem var(--lift); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .scroll-line { display: none; }
}
@media (max-width: 50rem) {
  .masthead { justify-content: flex-start; }
  .theme-button { margin-left: auto; }
  nav { order: 1; width: 100%; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: clamp(1.3rem, 5vw, 2.75rem); }
  .hero-photo { min-height: 0; height: clamp(11rem, 38vw, 18rem); }
  .network-mode { grid-template-columns: 1fr; }
  .cabinet-grid { grid-template-columns: 1fr; }
  .subscription-panel {
    background: linear-gradient(90deg, #102631 28%, #102631ab),
                url("/site-assets/fjord.jpg") center / cover;
  }
}
@media (max-width: 25rem) {
  .wrap { width: calc(100% - 1.5rem); }
  .actions .button { width: 100%; }
}
