/* HELLiGSØ - the styles of every page.
   Earth colours ("jordfarver"): sand, clay, terracotta and umber in the light theme, dark soil in the dark one. The
   script at the top of each page's <head> sets <html data-theme="light|dark">: the visitor's choice on the theme
   button, else the device's setting. Without JavaScript the page is light. */
:root {
  color-scheme: light;
  --bg: #eee5d6;          /* sand */
  --bg-glow: #f6f0e5;
  --ink: #36271d;         /* umber */
  --muted: #6b5948;       /* clay */
  --accent: #a5532e;      /* terracotta */
  --accent-ink: #8c4425;  /* terracotta dark enough for small text */
  --line: rgba(54, 39, 29, .14);
  --card: rgba(255, 255, 255, .38);
  --flag-edge: rgba(54, 39, 29, .18);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1510;          /* dark soil */
  --bg-glow: #2b2019;
  --ink: #ece1d0;
  --muted: #a69480;
  --accent: #d68b60;
  --accent-ink: #e3a079;
  --line: rgba(236, 225, 208, .14);
  --card: rgba(255, 255, 255, .035);
  --flag-edge: rgba(236, 225, 208, .2);
}

html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background-color: var(--bg);
  background-image: radial-gradient(ellipse 70% 55% at 50% 45%, var(--bg-glow), transparent 70%);
  color: var(--ink);
  font: 400 1rem/1.5 "Avenir Next", Avenir, "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Only the texts in the page's language show (t() in include/site.php writes both). */
html:not([lang="da"]) [data-lang="da"],
html:not([lang="en"]) [data-lang="en"] { display: none; }

/* The logo (inline SVG from tools/logo.php): text colour, with the i's dot and the Ø's stroke in terracotta. The dot
   is a ring, drawn as a line (.dot.line) as wide as the letters'. */
.mark { display: block; height: auto; overflow: visible; }
.mark .ink { stroke: currentColor; }
.mark .accent { stroke: var(--accent); }
.mark .dot { fill: var(--accent); }
.mark .dot.line { fill: none; stroke: var(--accent); }

/* The top: the logo small (not on the front page), the menu, the language buttons and the theme button. */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem 1rem;
  padding: clamp(.75rem, 3vw, 1.75rem) clamp(.75rem, 3vw, 2rem) 0;
}
.brand { margin-right: auto; padding: .5rem; line-height: 0; color: var(--ink); }
.brand .mark { width: 132px; stroke-width: 8; }
.front .menu { margin-left: auto; }
.menu, .languages { display: flex; gap: .25rem; }
.menu a, .languages button, .theme {
  padding: .5rem;
  font: inherit;
  font-size: .75rem;
  letter-spacing: .18em;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.menu a { text-transform: uppercase; }
.menu a:hover, .menu a[aria-current="page"] { color: var(--ink); }
.menu a[aria-current="page"],
html[lang="da"] [data-set-lang="da"] .code,
html[lang="en"] [data-set-lang="en"] .code { text-decoration: underline 1px var(--accent); text-underline-offset: .5em; }

/* The language and theme buttons need the script, so without it they are not shown. */
html:not(.js) .languages, html:not(.js) .theme { display: none; }
.languages button, .theme { display: inline-flex; align-items: center; gap: .5rem; border: 0; background: none; cursor: pointer; }
.flag {
  width: 21px;
  height: 14px;
  border-radius: 2px;
  background: center / cover no-repeat;
  box-shadow: 0 0 0 1px var(--flag-edge);
  opacity: .55;
  transition: opacity .2s;
}
.flag-da { background-image: url("images/flag-da.svg"); }
.flag-en { background-image: url("images/flag-en.svg"); }
.languages button:hover,
html[lang="da"] [data-set-lang="da"],
html[lang="en"] [data-set-lang="en"] { color: var(--ink); }
.languages button:hover .flag,
html[lang="da"] [data-set-lang="da"] .flag,
html[lang="en"] [data-set-lang="en"] .flag { opacity: 1; }

/* The theme button: a moon in the light theme, a sun in the dark one - what it switches to. Thin lines, like the logo. */
.theme:hover { color: var(--ink); }
.theme > span { display: block; line-height: 0; }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
html:not([data-theme="dark"]) .theme .to-light,
html[data-theme="dark"] .theme .to-dark { display: none; }

/* Narrow screens: the logo and the language buttons on one row, the menu centred on its own row under them. */
@media (max-width: 600px) {
  .top { column-gap: .5rem; }
  .brand .mark { width: 112px; }
  .languages { margin-left: auto; }
  .menu, .front .menu { order: 3; width: 100%; margin-left: 0; justify-content: center; }
}
/* The narrowest phones: a little less space, so the logo, the language buttons and the theme button share a row. */
@media (max-width: 380px) {
  .top { column-gap: .25rem; }
  .brand .mark { width: 100px; }
  .languages button, .theme { padding-inline: .35rem; }
  .languages button { gap: .35rem; }
}

/* The front page: the logo large in the middle. */
.hero { display: grid; place-content: center; justify-items: center; padding: 2rem 1rem; text-align: center; }
.hero h1 { margin: 0; line-height: 0; }
.hero .mark { width: clamp(250px, 74vw, 620px); }
.rule { display: block; width: 3rem; height: 1px; background: var(--accent); }
.hero .rule { margin: 2rem 0 1.75rem; }
.tagline {
  margin: 0;
  font-size: .8rem;
  letter-spacing: .32em;
  padding-inline-start: .32em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The other pages: a column of text. */
.page {
  box-sizing: border-box;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 9vh, 5.5rem) 1rem 4rem;
}
.page h1 { margin: 0; font-size: clamp(2.1rem, 7vw, 3.1rem); font-weight: 300; line-height: 1.15; letter-spacing: .02em; }
.page .rule { margin: 1.5rem 0 2rem; }
.page p { margin: 0 0 1.1rem; font-size: 1.0625rem; line-height: 1.7; }
.page .lead { font-size: clamp(1.15rem, 3.2vw, 1.3rem); line-height: 1.6; }
.more { color: var(--ink); text-decoration: underline 1px var(--accent); text-underline-offset: .3em; transition: color .2s; }
.more:hover { color: var(--accent-ink); }

/* About: the company's facts. */
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .7rem 2rem;
  margin: 2.5rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.facts dt { padding-top: .2rem; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; }
@media (max-width: 480px) {
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 1rem; }
}

/* Products: one card each. */
.product {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.product-icon { display: block; width: 64px; height: 64px; border-radius: 14px; }
.product h2 { margin: .1rem 0 .6rem; font-size: 1.5rem; font-weight: 400; line-height: 1.3; }
.badge {
  display: inline-block;
  margin-left: .6rem;
  padding: .25rem .7rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: .62rem;
  line-height: 1.3;
  letter-spacing: .16em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
  color: var(--accent-ink);
}
.product p { margin: 0 0 .9rem; }
.product .meta { font-size: .8rem; letter-spacing: .06em; color: var(--muted); }
.more { display: inline-block; margin-top: .25rem; }
@media (max-width: 480px) {
  .product { grid-template-columns: 1fr; gap: 1rem; padding: 1.4rem; }
  .product-icon { width: 56px; height: 56px; border-radius: 12px; }
}

footer.bottom { padding: 0 1rem 1.5rem; text-align: center; font-size: .75rem; letter-spacing: .12em; color: var(--muted); }
.sep { margin: 0 .6em; }

/* The front page's logo draws itself letter by letter, then the dot and the stroke through the Ø; then the line and
   the tagline. Not on the other pages, and not when the device asks for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .hero .mark .ink { stroke-dasharray: 1; animation: draw .9s calc(var(--i) * 60ms) cubic-bezier(.5, 0, .2, 1) both; }
  .hero .mark .accent { stroke-dasharray: 1; animation: draw .45s .95s cubic-bezier(.5, 0, .2, 1) both; }
  .hero .mark .dot { transform-box: fill-box; transform-origin: center; animation: pop .5s .8s cubic-bezier(.3, 1.6, .5, 1) both; }
  .hero .rule { animation: widen .9s 1s cubic-bezier(.2, .7, .2, 1) both; }
  .hero .tagline { animation: rise 1s 1.1s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes pop { from { transform: scale(0); } }
  @keyframes widen { from { transform: scaleX(0); } }
  @keyframes rise { from { opacity: 0; transform: translateY(.6rem); } }
}
