@font-face {
  font-family: 'CMU Serif';
  font-weight: 400;
  font-style: normal;
  src: url('cmunrm.woff') format('woff');
  font-display: swap;
}

@font-face {
  font-family: 'CMU Serif';
  font-weight: 700;
  font-style: normal;
  src: url('cmunbx.woff') format('woff');
  font-display: swap;
}

:root {
  --color-bg: #faf8f5;
  --color-bg-panel: #f2ede6;
  --color-text: #2c2825;
  --color-text-secondary: #5a524a;
  --color-muted: #9a8e82;
  --color-border: #e5ddd2;
  --color-accent: #b85c38;
  --color-accent-less: #8a6b5f;
  --color-accent-hover: #9c4a2c;
  --content-width: 46rem;
}

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

body {
  font-family: 'CMU Serif', 'Latin Modern Roman', Georgia, serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

h1 {
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

p {
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

a {
  color: var(--color-accent);
}

/* ---------- Navigation ---------- */

.site-nav {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

/* Sticky nav on desktop, where a persistent menu aids wayfinding across a
   4-page site; scrolls away as normal on mobile, where screen space is
   scarcer and re-showing the hero/content sooner matters more. */
@media (min-width: 48rem) {
  .site-nav {
    position: sticky;
    top: 0;
    z-index: 10;
  }
}

.nav-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-wordmark {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--color-text);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-right: auto;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.55rem;
  background: transparent;
  border: none;
  padding: 0.4rem 0;
  font: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  cursor: pointer;
}

.nav-toggle::before,
.nav-toggle::after {
  content: '›';
  display: inline-block;
  color: var(--color-accent);
  transition: transform 200ms ease;
  font-size: 150%;
  line-height: normal;
}

.nav-toggle::after {
  content: '‹';
}

.nav-toggle[aria-expanded='true']::before {
  transform: rotate(90deg);
}

.nav-toggle[aria-expanded='true']::after {
  transform: rotate(-90deg);
}

/* Below the sticky-nav breakpoint, the logo/link/CTA row no longer fits on
   one line. Keep the logo and "Go to app" on the top row and collapse the
   links behind a click-to-expand "Menu" toggle, rather than a
   horizontal-scroll row a user might not notice is scrollable. */
@media (max-width: 47.9375rem) {
  .nav-inner {
    justify-content: space-between;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    margin-top: 0;
    padding-top: 0;
    margin-right: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    border-top: 0 solid var(--color-border);
    transition: max-height 300ms ease, margin-top 300ms ease, padding-top 300ms ease,
      border-top-width 300ms ease, opacity 250ms ease, visibility 0s linear 300ms;
  }

  .nav-links.is-open {
    max-height: 16rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top-width: 1px;
    opacity: 1;
    visibility: visible;
    transition: max-height 300ms ease, margin-top 300ms ease, padding-top 300ms ease,
      border-top-width 300ms ease, opacity 250ms ease, visibility 0s linear 0s;
  }

  .nav-links a {
    padding: 0.6rem 0;
  }
}

/* Too narrow to fit logo, "Menu" toggle, and the CTA on one line: keep the
   logo and CTA on top (still space-between via .nav-inner) and drop the
   toggle to its own centered row underneath. */
@media (max-width: 24rem) {
  .nav-toggle {
    order: 2;
    flex-basis: 100%;
    justify-content: center;
    margin: 0.5rem auto 0;
  }

  .nav-links {
    order: 3;
  }
}

.nav-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-links a[aria-current='page'] {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
}

/* Desktop-only: pill-shaped hover background and an inset underline (drawn
   inside the padding box, like a button) instead of the plain text-hugging
   border-bottom, matching app.frnd.dk's nav treatment. */
@media (min-width: 48rem) {
  .nav-links {
    gap: 0.25rem;
  }

  .nav-links a {
    padding: 0.375rem 0.75rem;
    border-radius: 0.4rem;
    border-bottom: none;
    transition: color 200ms ease, background-color 200ms ease;
  }

  .nav-links a:hover {
    background: var(--color-border);
  }

  .nav-links a[aria-current='page'] {
    border-bottom: none;
    box-shadow: inset 0 -2px 0 var(--color-accent);
  }
}

/* The desktop underline above reads fine on an inline row, but stretched
   under a full-width stacked link in the mobile dropdown it looks like a
   stray divider. Swap it for a small dot next to the label instead. */
@media (max-width: 47.9375rem) {
  .nav-links a[aria-current='page'] {
    display: flex;
    align-items: center;
    border-bottom-color: transparent;
  }

  .nav-links a[aria-current='page']::after {
    content: '';
    width: 0.4rem;
    height: 0.4rem;
    margin-left: 0.6rem;
    border-radius: 50%;
    background: var(--color-accent);
  }
}

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.6rem 1.25rem;
  border-radius: 0.4rem;
  border: 1px solid transparent;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.link-arrow {
  display: inline-block;
  text-decoration: none;
  border-bottom: 1px solid rgb(184 92 56 / 30%);
  transition: border-color 200ms ease;
}

.link-arrow:hover {
  border-bottom-color: var(--color-accent);
}

/* A line of text with a link pinned to the right of it (e.g. a "learn more"
   link trailing a sentence) -- wraps the link onto its own line, still
   right-aligned, once the viewport is too narrow for both on one line. */
.split-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.5rem;
}

/* margin-left: auto (rather than justify-content) keeps the link pinned to
   the right even when it wraps onto its own line below the text -- with
   space-between, a lone item on a wrapped line falls back to flex-start. */
.split-line .link-arrow {
  margin-left: auto;
}

/* ---------- Page shell ---------- */

main {
  flex: 1;
  width: 100%;
}

.section {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.section::after {
  content: '';
  display: table;
  clear: both;
}

.section + .section {
  padding-top: 0;
}

/* ---------- Homepage hero ---------- */

.hero {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4rem);
  margin-bottom: 0.75rem;
  display: inline-flex;
  align-items: baseline;
}

.vowel-slot {
  display: inline-block;
  overflow: hidden;
  position: relative;
  width: 0;
  transition: width 400ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.vowel-slot::before {
  content: '\200b';
}

.vowel-slot span {
  position: absolute;
  left: 0;
  top: 0;
  transition: transform 400ms cubic-bezier(0.25, 0.1, 0.25, 1),
              opacity 300ms ease;
  transform: translateY(100%);
  opacity: 0;
  white-space: nowrap;
}

.vowel-slot span.active {
  transform: translateY(0);
  opacity: 1;
}

.vowel-slot span.exit {
  transform: translateY(-100%);
  opacity: 0;
}

.tagline {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--color-text-secondary);
  margin-bottom: 1.25rem;
}

.hero-lede {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  max-width: 34rem;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Three buttons of uneven width wrap into a ragged 2-then-1 layout on
   narrow screens. Stack them instead of leaving that to chance. */
@media (max-width: 40rem) {
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* ---------- Who it's for ---------- */

.audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.audience-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
}

.audience-card .icon {
  width: 1.3rem;
  height: 1.3rem;
}

.audience-card p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

/* A short list continuing a lead-in sentence -- bullets sit inside the text
   column, flush with the paragraph above, rather than hanging in the
   left-hand margin. */
.compact-list {
  list-style-position: inside;
  padding-left: 1rem;
  margin: 0.5rem 0 0;
}

.compact-list li + li {
  margin-top: 0.3rem;
}

/* ---------- Status / badges ---------- */

.status-note {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}

.status-note p {
  color: var(--color-text-secondary);
  margin: 0;
}

.status-note ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0.5rem 0 0;
}

.status-note li {
  color: var(--color-text-secondary);
}

.status-note li + li {
  margin-top: 0.3rem;
}

.status-note ul ul {
  margin-top: 0.4rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid currentcolor;
  white-space: nowrap;
}

.status-badge--soon {
  color: var(--color-accent);
}

/* ---------- Getting started steps ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  margin-top: 1.5rem;
}

.step {
  counter-increment: step;
  position: relative;
  padding: 1.5rem 0 1.5rem 3rem;
  border-top: 1px solid var(--color-border);
}

.step::after {
  content: '';
  display: table;
  clear: both;
}

.step:first-child {
  border-top: none;
  padding-top: 0;
}

.step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1.6rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.step:first-child::before {
  top: 0.1rem;
}

.step-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.step-heading h3 {
  margin: 0;
}

.step p {
  color: var(--color-text-secondary);
}

/* Decorative graphic per step, floated top-right so the paragraph text
   wraps around it instead of the icon fighting the heading for space. */
.step-icon {
  float: right;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 0 0.75rem 1rem;
  stroke: var(--color-accent);
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sub-steps nested inside a .step -- own counter so it doesn't interfere
   with the parent .steps numbering. */
.step > ol {
  list-style: none;
  counter-reset: substep;
  margin: 0.75rem 0 0;
}

.step > ol > li {
  counter-increment: substep;
  position: relative;
  padding-left: 2rem;
  margin-top: 0.6rem;
  color: var(--color-text-secondary);
}

.step > ol > li:first-child {
  margin-top: 0;
}

.step > ol > li::before {
  content: counter(substep) '.';
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  color: var(--color-accent-less);
}

.step ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0.5rem 0 0;
}

.step ul li {
  color: var(--color-text-secondary);
}

.step ul li + li {
  margin-top: 0.35rem;
}

/* ---------- Lightbox gallery ---------- */

/* Thumbnail row -- click to open the lightbox (see lightbox.js). */
.lightbox-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.lightbox-thumb {
  display: block;
  width: 6.5rem;
  height: 4.5rem;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 0.4rem;
  overflow: hidden;
  background: none;
  cursor: zoom-in;
  transition: border-color 200ms ease;
}

.lightbox-thumb:hover,
.lightbox-thumb:focus-visible {
  border-color: var(--color-accent);
}

.lightbox-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgb(44 40 37 / 88%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  z-index: 100;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-figure {
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.lightbox-figure img {
  display: block;
  max-width: 90vw;
  max-height: 75vh;
  border-radius: 0.5rem;
}

.lightbox-caption {
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  background: rgb(255 255 255 / 12%);
  cursor: pointer;
  transition: background-color 200ms ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgb(255 255 255 / 22%);
}

.lightbox-close svg,
.lightbox-prev svg,
.lightbox-next svg {
  width: 1.4rem;
  height: 1.4rem;
  stroke: #fff;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightbox-close {
  top: 1.25rem;
  right: 1.25rem;
}

.lightbox-prev {
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
}

/* ---------- Security page ---------- */

.lede {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

/* Decorative graphic per section, floated top-right so the paragraph text
   wraps around it — same convention as .step-icon on the getting-started
   page. */
.section-icon {
  float: right;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 0 0.75rem 1.5rem;
  stroke: var(--color-accent);
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tech-panel {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 2rem 1.75rem;
  margin-top: 1rem;
}

.tech-panel-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

.tech-panel-summary::-webkit-details-marker {
  display: none;
}

.tech-panel-summary h2 {
  margin: 0;
}

.tech-panel-chevron {
  width: 1.3rem;
  height: 1.3rem;
  stroke: var(--color-accent);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: transform 200ms ease;
}

.tech-panel[open] .tech-panel-chevron {
  transform: rotate(90deg);
}

.tech-panel-body {
  margin-top: 1.25rem;
  overflow: hidden;
  transition: max-height 300ms ease;
}

.tech-panel p,
.tech-panel li {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.tech-panel ul {
  padding-left: 1.25rem;
  margin: 0.75rem 0;
}

.tech-panel li + li {
  margin-top: 0.6rem;
}

.diagram-figure {
  margin: 1.5rem 0;
}

.diagram-figure svg {
  width: 100%;
  height: auto;
}

.diagram-figure text {
  font-family: 'CMU Serif', 'Latin Modern Roman', Georgia, serif;
  fill: var(--color-text);
}

.diagram-figure .diagram-caption {
  fill: var(--color-text);
  font-size: 0.7rem;
}

.diagram-figure .diagram-box {
  fill: var(--color-bg);
  stroke: var(--color-text-secondary);
}

.diagram-figure .diagram-arrow {
  stroke: var(--color-text);
  stroke-width: 1.5;
  fill: none;
}

/* The product's own box in a concept diagram -- everything routes through it,
   so it gets the accent outline the plain boxes do not. */
.diagram-figure .diagram-box--accent {
  fill: var(--color-bg-panel);
  stroke: var(--color-accent);
  stroke-width: 2;
}

/* Human-in-the-loop connector -- dashed so it reads as oversight, distinct
   from the solid arrows that carry the actual data flow. */
.diagram-figure .diagram-arrow--dashed {
  stroke-dasharray: 4 3;
}

/* ---- Homepage concept diagram (AI <-> Frnd <-> services) ---- */

.diagram-figure--concept .diagram-box {
  stroke-width: 1.5;
}

.diagram-figure--concept .diagram-caption {
  font-size: 0.72rem;
}

/* Container holding the individual service boxes -- a panel, so the boxes
   inside read as members of one cluster. */
.diagram-figure--concept .diagram-concept-group {
  fill: var(--color-bg-panel);
  stroke: var(--color-text-secondary);
  stroke-width: 1.5;
}

/* Nested 24x24 stroke icons, same convention as .icon elsewhere on the site. */
.diagram-figure--concept .diagram-concept-icon {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.diagram-figure--concept .diagram-concept-icon--person {
  stroke: var(--color-text-secondary);
}

/* ---- Security page key diagram (top-down funnel) ---- */

/* Portrait-shaped diagram: cap the width so it does not balloon to fill the
   column, and centre it instead. */
.diagram-figure--narrow svg {
  max-width: 39rem;
  display: block;
  margin: 0 auto;
}

/* Dotted separators between the "where does this live" layers (key holders,
   Frnd application, database), with a quiet label under each. */
.diagram-figure .diagram-layer-line {
  stroke: var(--color-muted);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  stroke-linecap: round;
}

.diagram-figure .diagram-layer-label {
  fill: var(--color-accent-less);
  font-size: 0.78rem;
  font-weight: 700;
}

.diagram-figure .diagram-layer-label-sub {
  font-size: 0.72rem;
  font-weight: 400;
}

/* ---------- Pricing page ---------- */

.tier-note {
  margin-top: 1.5rem;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.tier-card {
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.tier-card h3 {
  margin-bottom: 0.75rem;
}

.tier-card p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.licence-list {
  margin-top: 1rem;
  padding-left: 1.25rem;
}

.licence-list li {
  color: var(--color-text-secondary);
  margin-bottom: 0.6rem;
}

/* ---------- Icons ---------- */

.icon {
  width: 1.4rem;
  height: 1.4rem;
  stroke: var(--color-accent);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-row {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.icon-row p {
  color: var(--color-text-secondary);
  margin: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: auto;
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.attribution {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

/* ---------- Contact form ---------- */

.status-note--error {
  border-color: var(--color-accent);
}

.status-note--error p {
  color: var(--color-accent-hover);
}

.status-note--error p + p {
  margin-top: 0.5rem;
}

.contact-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 30rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-size: 0.9rem;
  font-weight: 700;
}

.form-field input,
.form-field textarea {
  font: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 0.4rem;
  padding: 0.6rem 0.75rem;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.form-field textarea {
  resize: vertical;
}

.char-count {
  font-size: 0.8rem;
  color: var(--color-muted);
  text-align: right;
}

.contact-form .btn {
  align-self: flex-start;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* Honeypot: off-screen (not display:none, which some bots skip) and out of
   the tab order and accessibility tree, so real keyboard/screen-reader
   users never land on it. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
