/* ==========================================================================
   Tillner GmbH – shared stylesheet for tillner.ch and all product sites.
   The same file is deployed on every domain. No JavaScript, no external
   requests, no cookies.

   PRODUCT COLOURS
   Every site sets <html data-site="…">. Add one line per product below and
   the whole site (buttons, links, tints, focus rings) follows.
   ========================================================================== */

:root {
  --c-tillner: #2a7d78;   /* company – darkened teal from the logo, readable under white text */
  --c-tusks:   #0b66d6;   /* tusks.io – taken from the logo */
  /* --c-newproduct: #1f8a5b; */

  --brand: var(--c-tillner);
}
[data-site="tusks"],    [data-product="tusks"]    { --brand: var(--c-tusks); }
/* [data-site="newproduct"], [data-product="newproduct"] { --brand: var(--c-newproduct); } */

:root, [data-product] {
  --brand-deep: color-mix(in srgb, var(--brand) 72%, #06101f);
  --brand-tint: color-mix(in srgb, var(--brand) 9%, #fff);
  --brand-line: color-mix(in srgb, var(--brand) 28%, #fff);
}

:root {
  --paper:   #f4f6f9;
  --surface: #ffffff;
  --ink:     #0f1b2d;
  --muted:   #55627a;
  --line:    #d8dee8;

  /* phase colours, as used on the shop floor and in the product */
  --run:   #2f9e55;
  --setup: #f0a31c;
  --stop:  #d8414b;
  --idle:  #b7c0ce;

  --wrap: 78rem;
  --gap: clamp(1.25rem, 3vw, 2.5rem);
  --radius: 6px;
  --shadow: 0 1px 2px rgb(15 27 45 / .06), 0 12px 32px -12px rgb(15 27 45 / .22);
}

/* ---------- fonts (self-hosted, SIL Open Font License) ------------------- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 1.0625rem/1.6 "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-deep); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 2px; }
p { margin: 0 0 1em; max-width: 68ch; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3 { margin: 0; font-stretch: 82%; font-weight: 750; line-height: 1.04; letter-spacing: -.012em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5.4rem); font-weight: 800; font-stretch: 76%; line-height: .96; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); }
h3 { font-size: 1.3rem; line-height: 1.15; font-stretch: 88%; font-weight: 700; }
.lead { font-size: clamp(1.15rem, 1.6vw, 1.35rem); line-height: 1.5; color: #2b3950; max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }
.band { padding-block: clamp(3.5rem, 8vw, 7rem); }
.band--surface { background: var(--surface); border-block: 1px solid var(--line); }
.band--tint { background: var(--brand-tint); border-block: 1px solid var(--brand-line); }
.band--ink { background: var(--ink); color: #e9eef6; }
.band--ink a { color: #fff; }
.band--ink .muted { color: #a9b6c9; }
.band-head { display: grid; gap: 1rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); }

.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--surface); padding: .6rem 1rem; }

/* ---------- buttons ------------------------------------------------------ */
.btn {
  display: inline-block; padding: .8em 1.35em; border-radius: var(--radius);
  font-weight: 650; font-stretch: 92%; text-decoration: none; line-height: 1.2;
  border: 2px solid var(--brand); background: var(--brand); color: #fff;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.btn--ghost { background: transparent; color: var(--brand-deep); }
.btn--ghost:hover { background: var(--brand-tint); color: var(--brand-deep); border-color: var(--brand); }
.band--ink .btn--ghost { color: #fff; border-color: #fff; }
.band--ink .btn--ghost:hover { background: #fff; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

/* ---------- header ------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem 2rem; flex-wrap: wrap; padding-block: .7rem; }
.logo { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.logo img { height: 3.75rem; width: auto; }
.logo img.logo-tillner { height: 3.1rem; }
.nav { display: flex; gap: .25rem 1.5rem; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 550; padding-block: .35rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-color: var(--brand); color: var(--ink); }
.nav .btn { padding: .55em 1em; color: #fff; border: 2px solid var(--brand); }
.nav .btn:hover { color: #fff; border-color: var(--brand-deep); }

/* language toggle: two plain links, the current one is marked */
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); font-size: .85rem; font-weight: 650; }
.lang a { padding: .3rem .7rem; text-decoration: none; color: var(--muted); border: 0; }
.lang a[aria-current] { background: var(--ink); color: #fff; }
.lang a:not([aria-current]):hover { background: var(--brand-tint); color: var(--ink); }

/* ---------- hero --------------------------------------------------------- */
.hero { padding-block: clamp(2.5rem, 5vw, 4.5rem) 0; overflow: clip; }
.hero h1 { max-width: 19ch; }
.hero .lead { margin-top: 1.5rem; }
.hero-shot { margin: clamp(2.5rem, 5vw, 4rem) 0 0; position: relative; }
.hero-shot::before {           /* solid brand block the screenshot sits on */
  content: ""; position: absolute; inset: 18% -100vw -1px; background: var(--brand); z-index: 0;
}
.hero-shot img { position: relative; z-index: 1; border-radius: 10px 10px 0 0; border: 1px solid var(--line); border-bottom: 0; box-shadow: var(--shadow); width: 100%; aspect-ratio: 16 / 8.2; object-fit: cover; object-position: top; }

/* The phase band: one shift on one line, drawn the way the product records it. */
.phase { background: var(--ink); color: #c7d1df; padding-block: 1.1rem 1.25rem; }
.phase-bar {
  height: 14px; border-radius: 3px;
  background: linear-gradient(90deg,
    var(--setup) 0 6%, var(--run) 6% 31%, var(--stop) 31% 34%, var(--run) 34% 52%,
    var(--idle) 52% 58%, var(--run) 58% 74%, var(--setup) 74% 79%, var(--run) 79% 93%, var(--stop) 93% 95%, var(--run) 95% 100%);
  animation: shift 2.4s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes shift { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.phase-legend { display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; margin-top: .7rem; font-size: .85rem; }
.phase-legend span::before { content: ""; display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .45em; background: var(--dot); }

/* ---------- generic grids ------------------------------------------------ */
.cols-3 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.cols-3 > * > h3 { margin-bottom: .5rem; }
.fact { border-top: 3px solid var(--ink); padding-top: 1rem; }
.fact p { color: var(--muted); margin: 0; }

.toc { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.toc a { text-decoration: none; padding: .4rem .85rem; border: 1px solid var(--brand-line); border-radius: 999px; background: var(--surface); color: var(--brand-deep); font-weight: 600; font-size: .95rem; }
.toc a:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- feature (text left, screenshots right) ------------------------ */
.feature { display: grid; gap: var(--gap); padding-block: clamp(2.5rem, 5vw, 4.5rem); border-top: 1px solid var(--line); }
.feature:first-of-type { border-top: 0; padding-top: 0; }
@media (min-width: 62rem) {
  .feature { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; }
  .feature-text { position: sticky; top: 6.5rem; }
}
.feature-text h3 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); font-stretch: 80%; margin-bottom: 1rem; }
.ticks { margin-top: 1.25rem; display: grid; gap: .55rem; }
.ticks li { padding-left: 1.5rem; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .5em; width: .7rem; height: .7rem; border-radius: 2px; background: var(--brand); }

/* CSS-only tabs: radio inputs + labels. Works with keyboard arrows. */
.tabs { position: relative; }
.tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.tablist { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.tablist label { cursor: pointer; padding: .45rem .9rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .95rem; color: var(--muted); user-select: none; }
.tablist label:hover { border-color: var(--brand); color: var(--ink); }
.panel { display: none; }
.tabs > input:nth-of-type(1):checked ~ .panels > .panel:nth-child(1),
.tabs > input:nth-of-type(2):checked ~ .panels > .panel:nth-child(2),
.tabs > input:nth-of-type(3):checked ~ .panels > .panel:nth-child(3),
.tabs > input:nth-of-type(5):checked ~ .panels > .panel:nth-child(5),
.tabs > input:nth-of-type(6):checked ~ .panels > .panel:nth-child(6),
.tabs > input:nth-of-type(4):checked ~ .panels > .panel:nth-child(4) { display: block; }
.tabs > input:nth-of-type(1):checked ~ .tablist > label:nth-child(1),
.tabs > input:nth-of-type(2):checked ~ .tablist > label:nth-child(2),
.tabs > input:nth-of-type(3):checked ~ .tablist > label:nth-child(3),
.tabs > input:nth-of-type(5):checked ~ .tablist > label:nth-child(5),
.tabs > input:nth-of-type(6):checked ~ .tablist > label:nth-child(6),
.tabs > input:nth-of-type(4):checked ~ .tablist > label:nth-child(4) { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs > input:nth-of-type(1):focus-visible ~ .tablist > label:nth-child(1),
.tabs > input:nth-of-type(2):focus-visible ~ .tablist > label:nth-child(2),
.tabs > input:nth-of-type(3):focus-visible ~ .tablist > label:nth-child(3),
.tabs > input:nth-of-type(5):focus-visible ~ .tablist > label:nth-child(5),
.tabs > input:nth-of-type(6):focus-visible ~ .tablist > label:nth-child(6),
.tabs > input:nth-of-type(4):focus-visible ~ .tablist > label:nth-child(4) { outline: 3px solid var(--brand); outline-offset: 3px; }

.shot { margin: 0; }
.zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; font: inherit; }

/* Lightbox without JavaScript: the Popover API. Esc or a click anywhere closes it. */
.lightbox { border: 0; padding: 0; margin: auto; background: transparent; max-width: 96vw; max-height: 94vh; overflow: auto; border-radius: 8px; }
.lightbox::backdrop { background: rgb(15 27 45 / .82); }
.lightbox button { display: block; padding: 0; border: 0; background: none; cursor: zoom-out; }
.shot .lightbox img { width: auto; max-width: 96vw; border: 0; box-shadow: none; }
.shot img, .shot video { width: 100%; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.shot figcaption { margin-top: .8rem; font-size: .92rem; color: var(--muted); max-width: 75ch; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1rem .45rem; border-radius: 3px; background: var(--ink); color: #fff; margin-right: .4rem; vertical-align: .08em; }

/* ---------- steps (a real sequence, therefore numbered) ------------------ */
.steps { counter-reset: step; display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.steps li { counter-increment: step; border-top: 3px solid var(--brand); padding-top: 1rem; }
.steps li::before { content: counter(step); display: block; font-size: 3rem; font-weight: 800; font-stretch: 70%; line-height: 1; color: var(--brand); margin-bottom: .5rem; }
.steps p { color: var(--muted); margin: .4rem 0 0; }
.steps .step-meta { color: var(--brand-deep); font-weight: 650; font-size: .95rem; margin-top: .25rem; }
.how-foot { display: grid; gap: 1.5rem var(--gap); margin-top: clamp(2rem, 4vw, 3rem); padding-top: 1.75rem; border-top: 1px solid var(--line); align-items: start; }
.how-foot .ticks { margin-top: 0; }
@media (min-width: 62rem) { .how-foot { grid-template-columns: 1fr 1fr; } }

/* ---------- pricing ------------------------------------------------------ */
.plans { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); max-width: 56rem; }
.plan { background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--brand); border-radius: var(--radius); padding: 1.75rem; display: flex; flex-direction: column; }
.plan .price { font-size: 2.6rem; font-weight: 800; font-stretch: 72%; line-height: 1; margin: .75rem 0 .2rem; }
.plan .price-alt { font-size: .55em; font-weight: 650; color: var(--muted); margin-left: .35em; white-space: nowrap; }
.plan .ticks { margin-bottom: 1.5rem; }
.plan .btn { margin-top: auto; text-align: center; }

/* ---------- product showcase on the company page ------------------------- */
.product { background: var(--surface); border: 1px solid var(--brand-line); border-top: 8px solid var(--brand); border-radius: 10px; padding: clamp(1.25rem, 3.5vw, 3rem); box-shadow: var(--shadow); }
.product-head { display: grid; gap: var(--gap); align-items: end; margin-bottom: 2rem; }
@media (min-width: 62rem) { .product-head { grid-template-columns: 5fr 6fr; } }
.product-logo { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.25rem; font-weight: 700; color: var(--brand-deep); }
.product-logo img { height: 4.75rem; width: auto; }
.product h2 { font-size: clamp(2rem, 4vw, 3.4rem); font-stretch: 76%; }
.product-points { display: grid; gap: 1.25rem var(--gap); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.product-points h3 { font-size: 1.1rem; margin-bottom: .3rem; }
.product-points p { margin: 0; color: var(--muted); font-size: .97rem; }

/* ---------- team, jobs, contact ----------------------------------------- */
.team { display: grid; gap: 1.5rem var(--gap); grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.person { display: grid; grid-template-columns: 4rem 1fr; gap: 1rem; align-items: center; }
.person .avatar { width: 4rem; height: 4rem; border-radius: 50%; background: var(--brand-tint); border: 1px solid var(--brand-line); color: var(--brand-deep); display: grid; place-items: center; font-weight: 750; font-stretch: 80%; font-size: 1.3rem; object-fit: cover; }
.person strong { display: block; line-height: 1.25; }
.person span, .person a { font-size: .92rem; }
.person span { display: block; color: var(--muted); }

details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: 1rem 2.5rem 1rem 0; font-weight: 650; font-size: 1.1rem; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: .25rem; top: .7rem; font-size: 1.6rem; font-weight: 400; color: var(--brand); line-height: 1; }
details[open] > summary::after { content: "–"; }
summary:hover { color: var(--brand-deep); }
details > div { padding: 0 0 1.25rem; }
details > .prose > :last-child { margin-bottom: 0; }
summary .meta { display: block; font-weight: 400; font-size: .92rem; color: var(--muted); }
.faq-group { margin-bottom: 3rem; max-width: 52rem; }
.faq-group h2 { font-size: 1.7rem; margin-bottom: 1rem; }

.contact { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.contact address { font-style: normal; font-size: 1.15rem; line-height: 1.55; }
.contact .big { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 750; font-stretch: 80%; display: block; text-decoration: none; line-height: 1.3; }

/* ---------- legal documents ------------------------------------------- */
.legal-layout > * { max-width: 52rem; }
.legal-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.legal-nav a { text-decoration: none; padding: .4rem .85rem; border: 1px solid var(--brand-line); border-radius: 999px; background: var(--surface); color: var(--brand-deep); font-weight: 600; font-size: .95rem; }
.legal-nav a:hover { border-color: var(--brand); }
.legal-nav a[aria-current] { background: var(--brand); border-color: var(--brand); color: #fff; }
.prose h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); margin-bottom: .75rem; }
.prose .updated { color: var(--muted); margin-bottom: 2rem; }
.prose h2 { font-size: 1.55rem; font-stretch: 85%; margin: 2.75rem 0 .9rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.prose h3 { font-size: 1.15rem; margin: 1.75rem 0 .6rem; }
.prose ul { list-style: disc; padding-left: 1.4rem; margin: 0 0 1em; max-width: 66ch; }
.prose li { margin-bottom: .35rem; }
.prose li > p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 1.25rem 0 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.prose table { border-collapse: collapse; width: 100%; min-width: 36rem; font-size: .95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.prose th { background: var(--brand-tint); font-weight: 650; }
.prose tr:last-child td { border-bottom: 0; }

/* ---------- release articles ------------------------------------------ */
.byline { display: flex; align-items: center; gap: .8rem; margin: .5rem 0 2rem; color: var(--muted); font-size: .95rem; line-height: 1.35; }
.byline .avatar { width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--brand-tint); border: 1px solid var(--brand-line); color: var(--brand-deep); font-weight: 750; font-stretch: 80%; }
.article .shot { margin: 1.5rem 0 1.75rem; }
.article .shot .zoom { width: auto; max-width: 100%; }
.article .shot img { width: auto; max-width: 100%; height: auto; max-height: 34rem; }
.article .shot .lightbox img { max-height: none; }
.article .btn { text-decoration: none; margin-top: .5rem; }

/* ---------- footer ------------------------------------------------------- */
.site-footer { background: var(--ink); color: #a9b6c9; padding-block: 3.5rem 2rem; font-size: .95rem; }
.site-footer .cols { display: grid; gap: 2rem var(--gap); grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.site-footer h2 { font-size: 1rem; font-stretch: 100%; letter-spacing: 0; color: #fff; margin-bottom: .75rem; font-weight: 650; }
.site-footer a { color: #dbe3ee; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer li { margin-bottom: .35rem; }
.site-footer .about { grid-column: span 2; max-width: 30rem; }
.built-by { display: inline-flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.built-by img { height: 3rem; width: auto; }
.built-by:hover { text-decoration: none !important; }
.site-footer .legal { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #2a384e; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
@media (max-width: 40rem) { .site-footer .about { grid-column: auto; } }

/* ---------- small screens & preferences ---------------------------------- */
@media (max-width: 48rem) {
  .site-header { position: static; }
  .site-header .wrap { gap: .6rem 1rem; }
  .nav { width: 100%; order: 3; gap: .1rem 1.1rem; font-size: .95rem; }
  .logo img { height: 3rem; }
  .logo img.logo-tillner { height: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .phase-bar { animation: none; }
  * { transition: none !important; }
}
@media print {
  .site-header, .lightbox, .actions, .tablist, video { display: none !important; }
  .panel { display: block !important; break-inside: avoid; margin-bottom: 1rem; }
}
