/* ═══════════════════════════════════════════
   Selvyk v2 — Nordic / Scandinavian
   Dark navy · White · Grey · Maritime Teal accent
   ═══════════════════════════════════════════ */

:root {
  /* Core palette */
  --navy-deepest: #070b14;
  --navy-deep: #3a4a6a;
  --navy-border: rgba(255, 255, 255, 0.06);

  --white: #fafaf9;
  --white-muted: #f0f0ee;
  --white-subtle: #b4b8c0;

  --grey-bg: #f4f4f2;
  --grey-surface: #fff;
  --grey-border: rgba(0, 0, 0, 0.08);

  --fg: #121212;
  --fg-muted: #6b6b6e;
  --fg-light: #98989d;

  --accent: #e8a830;
  --accent-hover: #f0bc45;
  --accent-glow: rgba(232, 168, 48, 0.15);

  /* Typography */
  --font-display: "Fahkwang", Georgia, "Times New Roman", serif;
  --font-body:
    "Fahkwang", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;

  /* Sizing */
  --radius: 4px;
  --maxw: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ═══════════════════ RESET ═══════════════════ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--fg);
  background: var(--grey-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ═══════════════════ UTILITY ═══════════════════ */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}
.container.narrow {
  max-width: 760px;
}
.container.center {
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ═══════════════════ PRE-PAINT GATE ═══════════════════ */
html.locked body > :not(.gate) {
  visibility: hidden;
}
html.locked body > .gate {
  visibility: visible;
}

/* ═══════════════════ TYPOGRAPHY ═══════════════════ */
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-muted);
  margin: 0 0 20px;
}

.headline {
  font-family: var(--font-display);
  font-size: clamp(48px, 9vw, 96px);
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin: 0 0 32px;
  font-weight: 400;
}

.display {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.5vw, 64px);
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 32px;
  font-weight: 400;
}

.display .muted {
  color: var(--fg-muted);
  font-style: italic;
}

.sub {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--fg-muted);
  max-width: 560px;
  margin: 0 0 44px;
  line-height: 1.6;
  font-weight: 300;
}

.lead {
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--fg-muted);
  max-width: 660px;
  margin: 0 0 28px;
  line-height: 1.65;
  font-weight: 300;
}

/* Dark section overrides */
.section.dark,
.section.dark .eyebrow,
.section.dark .display .muted,
.section.dark .lead {
  color: var(--white-muted);
}
.section.dark .eyebrow {
  color: var(--white-subtle);
}
.section.dark .display {
  color: var(--white);
}

/* ═══════════════════ ANIMATIONS ═══════════════════ */
.fade-in {
  animation: fadeUp 0.9s var(--ease) both;
}
.fade-in:nth-child(1) {
  animation-delay: 0.1s;
}
.fade-in:nth-child(2) {
  animation-delay: 0.2s;
}
.fade-in:nth-child(3) {
  animation-delay: 0.35s;
}
.fade-in:nth-child(4) {
  animation-delay: 0.5s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════ NAVIGATION ═══════════════════ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--grey-border);
  transition:
    background 0.35s var(--ease),
    border-color 0.35s var(--ease);
}
.nav.scrolled {
  background: #fff;
  border-bottom: 1px solid var(--grey-border);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.nav-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
}
.brand-logo {
  display: block;
  /* width-driven with auto height keeps the aspect ratio locked even when a
     flex/grid track is narrower than the logo — prevents the squish on mobile */
  width: 204px;
  height: auto;
  max-width: 100%;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg);
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}
.nav-links a:hover {
  color: var(--fg);
}
.nav-links a:hover::after {
  width: 100%;
}

/* Language switch */
.lang-switch {
  background: none;
  border: 0;
  padding: 6px 2px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lang-switch[hidden] {
  display: none;
}
.lang-switch .lang-opt {
  transition: color 0.2s;
}
.lang-switch .lang-opt.active {
  color: var(--fg);
}
.lang-switch .lang-sep {
  opacity: 0.35;
}
.lang-switch:hover .lang-opt:not(.active) {
  color: var(--fg);
}

/* Hamburger */
.nav-burger {
  display: none;
  background: none;
  border: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
  /* 44x44 touch target; negative right margin keeps bars visually aligned */
  min-width: 44px;
  min-height: 44px;
  margin-right: -10px;
}
.nav-burger span {
  width: 22px;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.3s var(--ease);
}

@media (max-width: 860px) {
  /* nav-links is hidden on mobile, so drop the centered 3-col layout and give
     the brand the full row (minus the burger) — keeps the logo at full size */
  .nav-inner {
    grid-template-columns: 1fr auto;
  }
  .nav-links {
    display: none;
  }
  .nav-burger {
    display: flex;
  }
  .nav.open .nav-links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(250, 250, 249, 0.96);
    backdrop-filter: blur(20px);
    padding: 12px 28px;
    gap: 0;
    border-bottom: 1px solid var(--grey-border);
  }
  .nav.open .nav-links a {
    display: block;
    padding: 13px 0;
  }
}

/* ═══════════════════ HERO ═══════════════════ */
.hero {
  min-height: 100vh;
  padding: 180px 28px 100px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  background: var(--navy-deep);
  color: var(--white);
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero .eyebrow {
  color: var(--white-subtle);
}

.hero .headline {
  font-family: var(--font-display);
  font-size: clamp(52px, 10vw, 112px);
  letter-spacing: -0.01em;
  line-height: 1.15;
  font-weight: 400;
  color: var(--white);
}
.hero .headline .accent {
  font-style: italic;
  color: var(--white-muted);
  letter-spacing: 0;
}
.hero .sub {
  margin: 0 auto 44px;
  text-align: center;
  color: var(--white-muted);
}

/* Subtle label row under hero paragraph */
.hero-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white);
  margin: 0 0 40px;
}

/* CTA */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 32px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition:
    background 0.25s,
    color 0.25s,
    transform 0.2s var(--ease);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn-primary {
  background: var(--accent);
  color: var(--navy-deep);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--navy-deep);
  transform: translateY(-2px);
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--white-muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.scroll-line {
  width: 40px;
  height: 1px;
  background: rgba(250, 250, 249, 0.2);
  position: relative;
  overflow: hidden;
}

@media (max-width: 860px) {
  .hero {
    padding-top: 140px;
  }
  .hero-scroll {
    display: none;
  }
}

/* ═══════════════════ SECTIONS ═══════════════════ */
.section {
  padding: 140px 28px;
}
.section.dark {
  background: var(--navy-deep);
  color: var(--white);
}
.section.grey {
  background: var(--grey-bg);
}

@media (max-width: 768px) {
  .section {
    padding: 80px 20px;
  }
}

/* ═══════════════════ THE PROBLEM ═══════════════════ */
.resolution {
  border-left: 2px solid var(--accent);
  padding: 28px 0 28px 32px;
  margin-top: 48px;
}
.resolution-heading {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 26px);
  line-height: 1.4;
  color: var(--fg);
  margin-bottom: 12px;
  font-weight: 400;
}
.resolution-body {
  font-size: 16px;
  font-weight: 300;
  color: var(--fg-muted);
  line-height: 1.7;
}

/* ═══════════════════ TECHNOLOGY ═══════════════════ */
/* Pillars */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 56px;
}
.pillar {
  border-top: 1px solid var(--navy-border);
  padding-top: 24px;
  transition: border-color 0.35s var(--ease);
}
.pillar:hover {
  border-color: var(--accent);
}
.pillar-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 4px;
  letter-spacing: 0.01em;
  text-transform: none;
}
.pillar-body {
  font-size: 14px;
  font-weight: 300;
  color: var(--white-muted);
  line-height: 1.7;
}

@media (max-width: 720px) {
  .pillars {
    grid-template-columns: 1fr;
  }
}

/* Tech figure */
.tech-figure {
  margin: 48px 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--grey-border);
}
.tech-figure img {
  display: block;
  width: 100%;
  height: auto;
}

/* ═══════════════════ TEAM ═══════════════════ */
.team-section {
  background: var(--navy-deep);
  color: var(--white);
  padding: 120px 28px;
}
.team-section .eyebrow {
  color: var(--white-subtle);
}
.team-section .display {
  color: var(--white);
}
.team-section .display .muted {
  color: rgba(250, 250, 249, 0.5);
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 56px;
}
.team-card {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--navy-border);
  padding-top: 24px;
  transition: border-color 0.35s var(--ease);
}
.team-card:hover {
  border-color: var(--accent-hover);
}
.team-name {
  font-size: 17px;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 4px;
  letter-spacing: 0.01em;
  text-align: center;
}
.team-title {
  font-size: 12px;
  font-weight: 400;
  color: var(--white-subtle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
  text-align: center;
}
.team-photo {
  margin-top: auto;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}
/* Fine-tune Trygve's framing to show more body (useful for full-photo replacements) */
.team-photo--trygve {
  object-position: center 62%;
}
.team-email {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--white-subtle);
  transition: color 0.2s;
}
.team-email:hover {
  color: var(--accent);
}
.team-photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--navy-border);
  color: var(--white-subtle);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

@media (max-width: 720px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════ VISION ═══════════════════ */
/* Vision section now uses standard section styling */

/* ═══════════════════ CONTACT ═══════════════════ */
.cta-section {
  background: var(--grey-bg);
}

.mail-card {
  display: inline-flex;
  justify-content: center;
  margin: 56px auto 0;
}

.mail-link {
  position: relative;
  display: inline-block;
  padding: 0;
  background: transparent;
  border: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--fg);
  cursor: pointer;
  transition: color 0.2s;
}
.mail-link:hover {
  color: var(--accent);
}
.mail-card .mail-link {
  padding: 10px 8px;
}

.mail-text,
.mail-feedback {
  display: inline-block;
  transition:
    opacity 0.3s,
    transform 0.3s var(--ease);
}
.mail-feedback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a7c59;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.04em;
}
.mail-link.copied .mail-text {
  opacity: 0;
  transform: translateY(-8px);
}
.mail-link.copied .mail-feedback {
  opacity: 1;
  transform: translateY(0);
}

/* Inline variant */
.mail-link-inline {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  border-bottom: 1px solid var(--grey-border);
  line-height: 1.6;
  padding-bottom: 2px;
}
.mail-link-inline:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.mail-link-inline .mail-feedback {
  justify-content: flex-start;
}

/* ═══════════════════ IMPRINT / PRIVACY ═══════════════════ */
.imprint {
  margin: 56px 0 0;
  display: grid;
  grid-template-columns: minmax(160px, 200px) 1fr;
  column-gap: 36px;
  row-gap: 20px;
}
.imprint dt {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg);
  padding-top: 2px;
}
.imprint dd {
  font-size: 15px;
  font-weight: 300;
  color: var(--fg-muted);
  line-height: 1.6;
}

.placeholder {
  font-style: italic;
  color: var(--fg-light);
}

.imprint-note {
  margin-top: 40px;
  font-size: 13px;
  font-weight: 300;
  color: var(--fg-light);
  line-height: 1.7;
  font-style: italic;
  border-left: 2px solid var(--grey-border);
  padding-left: 20px;
}

/* Long-form legal prose (privacy policy) */
.legal {
  margin-top: 56px;
}
.legal .legal-meta {
  font-size: 13px;
  font-weight: 300;
  color: var(--fg-light);
  margin: 0 0 8px;
}
.legal .legal-lead {
  font-size: 16px;
  font-weight: 300;
  color: var(--fg-muted);
  line-height: 1.7;
  margin: 0 0 8px;
}
.legal h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 44px 0 14px;
}
.legal h4 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
  margin: 24px 0 8px;
}
.legal p,
.legal li {
  font-size: 15px;
  font-weight: 300;
  color: var(--fg-muted);
  line-height: 1.75;
}
.legal p {
  margin: 0 0 14px;
}
.legal ul {
  margin: 0 0 14px;
  padding-left: 20px;
}
.legal li {
  margin-bottom: 6px;
}
.legal a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal .legal-addr {
  font-style: normal;
  color: var(--fg-muted);
  line-height: 1.7;
}
.legal code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--grey-bg, rgba(0, 0, 0, 0.05));
  padding: 1px 6px;
  border-radius: 4px;
}

@media (max-width: 600px) {
  .imprint {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }
  .imprint dd {
    margin-bottom: 16px;
  }
}

/* ═══════════════════ FOOTER ═══════════════════ */
.footer {
  background: var(--navy-deep);
  color: var(--white-muted);
  padding: 16px 0 0;
}
.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.footer-links {
  justify-content: center;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 13px;
  font-weight: 300;
  color: var(--white-muted);
  transition: color 0.2s;
  /* larger tap area without disturbing the row layout */
  padding: 8px 2px;
  margin: -8px 0;
}
.footer-links a:hover {
  color: var(--accent);
}

.footer-base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  border-top: 1px solid var(--navy-border);
  font-size: 12px;
  font-weight: 300;
  color: var(--white-subtle);
}
.footer-base > :first-child {
  flex: 1;
}
.footer-base > :last-child {
  flex: 1;
  text-align: right;
}
.footer-coords {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  font-size: 11px;
}

@media (max-width: 640px) {
  .footer-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  .footer-links {
    gap: 16px;
    flex-direction: column;
  }
  .footer-base {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .footer-base > :first-child,
  .footer-base > :last-child {
    flex: unset;
    text-align: left;
  }
}

/* ═══════════════════ SUBPAGE LAYOUT ═══════════════════ */
.page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.subpage {
  padding-top: 160px;
  flex: 1;
}
.display--sub {
  font-size: clamp(22px, 6vw, 48px);
}

/* ═══════════════════ PASSWORD GATE ═══════════════════ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-deepest);
  backdrop-filter: blur(40px);
}
.gate[hidden] {
  display: none;
}
.gate-card {
  text-align: center;
  max-width: 380px;
  padding: 48px 32px;
}
.gate-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 24px;
}
.gate-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}
.gate-sub {
  font-size: 13px;
  font-weight: 300;
  color: var(--white-subtle);
  margin-bottom: 32px;
  letter-spacing: 0.04em;
}
.gate-form {
  display: flex;
  gap: 10px;
}
.gate-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--navy-border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font-family: var(--font-body);
  /* 16px minimum prevents iOS Safari from auto-zooming on focus */
  font-size: 16px;
  outline: none;
  transition: border-color 0.25s;
}
.gate-input:focus {
  border-color: var(--accent);
}
.gate-input::placeholder {
  color: var(--white-subtle);
}
.gate-submit {
  padding: 12px 24px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.25s,
    color 0.25s;
}
.gate-submit:hover {
  background: var(--accent);
  color: var(--navy-deepest);
}
.gate-error {
  margin-top: 14px;
  font-size: 13px;
  color: #c44a4a;
  min-height: 20px;
}

/* Shake */
.shake {
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}
