/* Vitræna — vitraena.is
   Nordic minimal, glacier blue. */

:root {
  --bg: #fafbfb;
  --ink: #10181b;
  --ink-soft: #47565c;
  --ink-faint: #8b9ca3;
  --hairline: #e3e9ea;
  --accent: #0e7191;        /* glacier blue, deep */
  --accent-dark: #0a5d78;
  --accent-soft: #5dc4e1;   /* glacier blue, light */
  --ice: #eef6f8;

  /* Torrex brand, used only inside its ticket card */
  --t-cream: #ede8d9;
  --t-red: #7b1e1e;
  --t-ink: #201a15;

  --max: 1080px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #cfeaf2; color: var(--ink); }

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

/* ---- language switching: EN default, IS when <html lang="is"> ---- */
html[lang="en"] [lang="is"] { display: none !important; }
html[lang="is"] [lang="en"] { display: none !important; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

h1, h2 { letter-spacing: -0.025em; line-height: 1.12; font-weight: 650; }
h3 { letter-spacing: -0.015em; line-height: 1.25; font-weight: 650; }

/* skip link, for keyboard users */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 0.7rem 1.1rem;
  border-radius: 0 0 8px 0; font-size: 0.9rem; font-weight: 600; text-decoration: none;
}
.skip:focus { left: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 251, 251, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.mark { width: 28px; height: 28px; border-radius: 7px; display: block; }
.wordmark {
  font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink);
}
.wordmark .ae { color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 2rem; }
.nav-links { display: flex; gap: 1.75rem; }
.nav-links a {
  color: var(--ink-soft); text-decoration: none; font-size: 0.92rem;
  background: linear-gradient(var(--ink), var(--ink)) no-repeat 0 100% / 0% 1px;
  transition: color .2s, background-size .25s;
  padding-bottom: 2px;
}
.nav-links a:hover { color: var(--ink); background-size: 100% 1px; }
.nav-links a[aria-current="page"] {
  color: var(--ink); font-weight: 600;
  background: linear-gradient(var(--accent-soft), var(--accent-soft)) no-repeat 0 100% / 100% 2px;
}

.lang {
  display: flex; gap: 2px;
  border: 1px solid var(--hairline); border-radius: 999px; padding: 2px;
  background: #fff;
}
.lang button {
  font: inherit; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
  border: 0; background: transparent; color: var(--ink-faint);
  padding: 3px 10px; border-radius: 999px; cursor: pointer;
  transition: background .2s, color .2s;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- mobile nav ---------- */
.nav-toggle {
  display: none;
  width: 40px; height: 40px; margin-right: -8px;
  border: 0; background: transparent; cursor: pointer;
  align-items: center; justify-content: center;
  border-radius: 8px;
}
.nav-toggle:hover { background: var(--ice); }
.nav-toggle span {
  display: block; position: relative;
  width: 20px; height: 1.5px; background: var(--ink); border-radius: 2px;
  transition: background .2s;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: ""; position: absolute; left: 0;
  width: 20px; height: 1.5px; background: var(--ink); border-radius: 2px;
  transition: transform .25s ease, top .2s ease;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

.mobile-menu {
  display: none;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
}
.mobile-menu.open { display: block; }
.mobile-menu ul { list-style: none; padding: 0.5rem 0 1.2rem; }
.mobile-menu a {
  display: block; padding: 0.85rem 0;
  color: var(--ink-soft); text-decoration: none; font-size: 1.05rem;
  border-bottom: 1px solid var(--hairline);
}
.mobile-menu li:last-child a { border-bottom: 0; }
.mobile-menu a[aria-current="page"] { color: var(--accent); font-weight: 650; }

/* ---------- shared ---------- */
section { padding: 6.5rem 0; scroll-margin-top: 80px; }
section.tight { padding: 4.5rem 0; }

.label {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 2.4rem;
}
.label::before { content: ""; width: 18px; height: 2px; background: var(--accent-soft); }

.divider { position: relative; height: 1px; background: var(--hairline); max-width: var(--max); margin: 0 auto; }
.divider .shard {
  position: absolute; left: 50%; top: 50%;
  width: 9px; height: 9px; transform: translate(-50%, -50%) rotate(45deg);
  background: var(--bg); border: 1px solid var(--accent-soft);
}

.lede { font-size: 1.16rem; color: var(--ink-soft); max-width: 62ch; }
.lede + .lede { margin-top: 1.1rem; }

/* ---------- hero (home) ---------- */
.hero { position: relative; overflow: hidden; padding: 9.5rem 0 8.5rem; }

.contours {
  position: absolute; top: 0; right: 0; height: 100%; width: min(70vw, 900px);
  pointer-events: none;
  stroke: var(--accent-soft); stroke-width: 1.5; opacity: 0.35;
}
.glow {
  position: absolute; pointer-events: none;
  width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(93, 196, 225, 0.16), transparent 72%);
  top: -220px; right: -160px;
}

.kicker {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.6rem;
}
.hero h1 { font-size: clamp(2.7rem, 6.4vw, 4.7rem); max-width: 15ch; position: relative; }
.hero .sub {
  margin-top: 1.8rem; max-width: 54ch;
  font-size: 1.13rem; color: var(--ink-soft); position: relative;
}
.cta-row { margin-top: 2.8rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-block; text-decoration: none;
  background: var(--accent); color: #fff;
  font-size: 0.95rem; font-weight: 600;
  padding: 0.8rem 1.5rem; border-radius: 8px;
  transition: background .2s, transform .15s;
}
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-ghost {
  display: inline-block; text-decoration: none;
  background: transparent; color: var(--ink);
  border: 1px solid var(--hairline);
  font-size: 0.95rem; font-weight: 600;
  padding: 0.8rem 1.5rem; border-radius: 8px;
  transition: border-color .2s, background .2s, transform .15s;
}
.btn-ghost:hover { border-color: var(--accent-soft); background: #fff; transform: translateY(-1px); }

/* ---------- page head (subpages) ---------- */
.page-head {
  position: relative; overflow: hidden;
  padding: 5.5rem 0 4rem;
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--ice), var(--bg));
}
.page-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); max-width: 18ch; }
.page-head .lede { margin-top: 1.4rem; }

/* ---------- cards ---------- */
.cards {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 2rem 1.9rem;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.card:hover {
  border-color: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -18px rgba(16, 24, 27, 0.28);
}
.card .ico {
  width: 34px; height: 34px; margin-bottom: 1.2rem;
  stroke: var(--accent); stroke-width: 1.6; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
.card h3 { font-size: 1.12rem; }
.card p { margin-top: 0.7rem; color: var(--ink-soft); font-size: 0.97rem; }

/* ---------- feature rows ---------- */
.feature {
  display: grid; gap: 3rem; align-items: center;
  grid-template-columns: 1fr 1fr;
}
.feature + .feature { margin-top: 5.5rem; }
.feature h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.feature p { margin-top: 1rem; color: var(--ink-soft); }
.feature .art {
  aspect-ratio: 4 / 3; border-radius: 14px;
  background: linear-gradient(140deg, var(--ice), #fff);
  border: 1px solid var(--hairline);
  display: grid; place-items: center;
  overflow: hidden;
}
.feature .art svg { width: 62%; height: auto; stroke: var(--accent); stroke-width: 1.3; fill: none; opacity: 0.75; }
.feature.flip .txt { order: 2; }

/* ---------- process steps ---------- */
.steps { counter-reset: step; display: grid; gap: 2.2rem; }
.step { position: relative; padding-left: 3.4rem; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0.1rem;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--accent);
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  border: 1px solid var(--accent-soft);
  display: grid; place-items: center;
  background: #fff;
}
.step h3 { font-size: 1.08rem; }
.step p { margin-top: 0.45rem; color: var(--ink-soft); font-size: 0.97rem; max-width: 60ch; }

/* ---------- work: the Torrex ticket ---------- */
.torrex-card {
  position: relative;
  max-width: 720px;
  background: var(--t-cream);
  color: var(--t-ink);
  border-radius: 16px;
  padding: 3rem 3.2rem;
  box-shadow: 0 1px 2px rgba(16, 24, 27, 0.06), 0 12px 32px -16px rgba(16, 24, 27, 0.18);
}
.torrex-card::before {
  content: "";
  position: absolute; inset: 11px;
  border: 2px solid var(--t-red);
  border-radius: 9px;
  opacity: 0.85;
  pointer-events: none;
}
.notch {
  position: absolute; top: 50%;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg);
  transform: translateY(-50%);
}
.notch-l { left: -11px; }
.notch-r { right: -11px; }

.torrex-tag {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--t-red);
}
.torrex-tag::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--t-red); animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.torrex-name {
  margin-top: 0.9rem;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.torrex-tagline {
  margin-top: 0.4rem;
  font-style: italic;
  color: var(--t-red);
  font-size: 1.05rem;
}
.torrex-copy { margin-top: 1.3rem; max-width: 46ch; color: #5a5148; }
.torrex-platforms {
  margin-top: 1.1rem;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: #8a8172;
}
.torrex-link {
  display: inline-block; margin-top: 1.6rem;
  color: var(--t-red); font-weight: 700; text-decoration: none; font-size: 0.98rem;
  background: linear-gradient(var(--t-red), var(--t-red)) no-repeat 0 100% / 100% 1px;
  padding-bottom: 3px;
  transition: background-size .25s;
}
.torrex-link:hover { background-size: 100% 3px; }

/* ---------- contact ---------- */
.contact { text-align: center; }
.contact .label { justify-content: center; }
.mail {
  font-size: clamp(1.5rem, 3.6vw, 2.5rem); font-weight: 650; letter-spacing: -0.01em;
  color: var(--accent); text-decoration: none;
  background: linear-gradient(var(--accent-soft), var(--accent-soft)) no-repeat 0 100% / 100% 2px;
  padding-bottom: 4px; transition: background-size .25s;
}
.mail:hover { background-size: 100% 4px; }

/* ---------- company / legal details block ---------- */
.legal-card {
  background: #fff; border: 1px solid var(--hairline); border-radius: 14px;
  padding: 2.2rem 2.2rem;
}
.legal-card h3 { font-size: 1.05rem; margin-bottom: 1.4rem; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.75rem 2rem; font-size: 0.96rem; }
.dl dt {
  color: var(--ink-faint); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; padding-top: 0.2rem;
}
.dl dd { color: var(--ink); }
.dl dd a { color: var(--accent); text-decoration: none; }
.dl dd a:hover { text-decoration: underline; }

/* ---------- cta band ---------- */
.cta-band {
  background: var(--ice);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  text-align: center;
  padding: 5rem 0;
}
.cta-band h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); max-width: 20ch; margin: 0 auto; }
.cta-band p { margin-top: 1rem; color: var(--ink-soft); }
.cta-band .cta-row { justify-content: center; }

/* ---------- prose (policy pages) ---------- */
.prose { max-width: 68ch; }
.prose h2 {
  font-size: 1.3rem; margin-top: 3rem; margin-bottom: 0.9rem;
  padding-top: 1.6rem; border-top: 1px solid var(--hairline);
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-size: 1.03rem; margin-top: 1.8rem; margin-bottom: 0.5rem; }
.prose p { color: var(--ink-soft); margin-bottom: 1rem; }
.prose ul { color: var(--ink-soft); margin: 0 0 1rem 1.2rem; }
.prose li { margin-bottom: 0.45rem; }
.prose a { color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 650; }
.updated {
  font-size: 0.8rem; color: var(--ink-faint);
  letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600;
  margin-bottom: 2.4rem;
}

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 8rem 0; }
.notfound .code {
  font-size: clamp(4rem, 14vw, 8rem); font-weight: 700; line-height: 1;
  color: var(--accent-soft); letter-spacing: -0.04em;
}
.notfound h1 { margin-top: 1rem; font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
.notfound p { margin-top: 1rem; color: var(--ink-soft); }
.notfound .cta-row { justify-content: center; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--hairline); padding: 3.5rem 0 2.2rem; }
.foot-grid {
  display: grid; gap: 2.5rem;
  grid-template-columns: 1.4fr 1fr 1fr;
  padding-bottom: 2.5rem;
}
.foot-grid .blurb { margin-top: 1rem; color: var(--ink-faint); font-size: 0.9rem; max-width: 34ch; }
.foot-col h4 {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 1rem;
}
.foot-col ul { list-style: none; display: grid; gap: 0.6rem; }
.foot-col a { color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; transition: color .2s; }
.foot-col a:hover { color: var(--accent); }

.foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--ink-faint);
  border-top: 1px solid var(--hairline);
  padding-top: 1.8rem;
}
.foot .wordmark { font-size: 1rem; }
.foot-links { list-style: none; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.foot-links a {
  color: var(--ink-faint); text-decoration: none;
  transition: color .2s;
}
.foot-links a:hover { color: var(--accent); }
.foot-legal { font-size: 0.8rem; color: var(--ink-faint); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .torrex-tag::before { animation: none; }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; gap: 2rem; }
  .feature.flip .txt { order: 0; }
  .feature .art { max-width: 460px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid .brand-col { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-right { gap: 0.75rem; }
  section { padding: 4.5rem 0; }
  .hero { padding: 6rem 0 5.5rem; }
  .page-head { padding: 3.5rem 0 2.8rem; }
  .contours { width: 100vw; opacity: 0.22; }
  .torrex-card { padding: 2.2rem 1.8rem; }
  .legal-card { padding: 1.6rem 1.4rem; }
  .dl { grid-template-columns: 1fr; gap: 0.3rem; }
  .dl dd { margin-bottom: 0.9rem; }
  .foot { justify-content: flex-start; }
}

@media (max-width: 520px) {
  .foot-grid { grid-template-columns: 1fr; gap: 2rem; }
}
