/* ══════════════════════════════════════════════════════════════════
   OpenCompany — website stylesheet
   Direction A · "The Charter" — principles-led Swiss editorial
   Display: Space Grotesk · Body: Newsreader · Accent: JetBrains Mono
   ══════════════════════════════════════════════════════════════════ */

/* ── Design tokens ──────────────────────────────────────────────── */
:root {
  /* palette — paper & ink, two accents, nothing else */
  --paper:      #f7f4ed;
  --paper-2:    #efeadd;
  --ink:        #16181d;
  --ink-soft:   #5a5e6a;
  --rule:       #ddd6c8;
  --ochre:      #8f6410;
  --sage:       #5c7566;
  --ink-invert: #f7f4ed;

  /* type */
  --f-display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-prose:   'Newsreader', Georgia, 'Times New Roman', serif;
  --f-ui:      'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* space — 8pt base */
  --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px;
  --s5: 48px; --s6: 64px; --s7: 96px;

  /* radius — editorial, near-sharp */
  --r-sm: 3px; --r-md: 6px; --r-pill: 999px;

  --measure: 66ch;
  --frame: 1120px;

  /* motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .5s;
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-prose);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

:focus-visible {
  outline: 2.5px solid var(--ochre);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ── Layout primitives ──────────────────────────────────────────── */
.frame {
  width: 100%;
  max-width: var(--frame);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ochre);
  margin: 0;
}
.eyebrow.sage { color: var(--sage); }

/* ── Skip link ──────────────────────────────────────────────────── */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--ink-invert);
  padding: 12px 18px; z-index: 100;
  font-family: var(--f-ui); font-size: 14px; font-weight: 600;
}
.skip:focus { left: 0; }

/* ══════════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════════ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header .frame {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); min-height: 64px;
}
.site-header.is-scrolled { box-shadow: 0 1px 12px rgba(22, 24, 29, .06); }
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-ui); font-weight: 700; font-size: 16px;
  letter-spacing: -.02em; text-decoration: none; flex: none;
}
.wordmark .mark {
  width: 26px; height: 26px; flex: none;
  border-radius: var(--r-sm);
  display: grid; place-content: center;
  overflow: hidden;
}
.wordmark .mark img { width: 100%; height: 100%; object-fit: contain; }
.site-nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); }
.site-nav a {
  font-family: var(--f-ui); font-size: 14px; font-weight: 500;
  text-decoration: none; color: var(--ink-soft); padding: 6px 0; position: relative;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px;
  background: var(--ochre); transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav .nav-cta {
  border: 1.5px solid var(--ink); border-radius: var(--r-pill);
  padding: 8px 18px; color: var(--ink);
}
.site-nav .nav-cta::after { display: none; }
.site-nav .nav-cta:hover { background: var(--ink); color: var(--ink-invert); }
.lang-switch {
  font-family: var(--f-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  padding: 5px 9px; color: var(--ink-soft); text-decoration: none;
  margin-left: 4px;
}
.lang-switch:hover { border-color: var(--ink); color: var(--ink); }
.lang-switch::after { display: none; }

/* ══════════════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════════════ */
.hero { padding: clamp(56px, 10vw, 124px) 0 clamp(48px, 8vw, 96px); }
.hero .docline {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: clamp(28px, 4vw, 44px);
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-soft);
}
.hero .docline::after { content: ''; height: 1px; flex: 1; background: var(--rule); }

.hero h1 {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(42px, 8.4vw, 98px);
  line-height: .98; letter-spacing: -.042em;
  margin: 0 0 clamp(24px, 3vw, 34px);
  max-width: 15ch;
}
/* Space Grotesk has no italic — emphasis is carried by colour alone */
.hero h1 em { font-style: normal; color: var(--ochre); }

.hero .lede {
  font-family: var(--f-prose); font-weight: 300;
  font-size: clamp(18px, 2.1vw, 22px); line-height: 1.55;
  color: #3d414c; max-width: 52ch; margin: 0;
}
.hero .hero-foot {
  margin-top: clamp(36px, 5vw, 54px);
  display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center;
}

.btn {
  font-family: var(--f-ui); font-size: 15px; font-weight: 600;
  text-decoration: none; padding: 14px 28px; border-radius: var(--r-pill);
  border: 1.5px solid transparent; display: inline-block;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease);
}
.btn-solid { background: var(--ink); color: var(--ink-invert); }
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(22,24,29,.18); }
.stamp {
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft);
}

/* ══════════════════════════════════════════════════════════════════
   SECTION shell
   ══════════════════════════════════════════════════════════════════ */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-head { display: grid; gap: var(--s2); margin-bottom: clamp(36px, 5vw, 58px); }
.section-head h2 {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(28px, 4.4vw, 50px); line-height: 1.04;
  letter-spacing: -.035em; margin: 0; max-width: 22ch;
}
.section-head h2 em { font-style: normal; color: var(--ochre); }
.section-head .sub {
  font-family: var(--f-prose); font-weight: 300;
  font-size: clamp(17px, 1.9vw, 19px); line-height: 1.6;
  color: var(--ink-soft); max-width: 58ch; margin: 0;
}

/* ══════════════════════════════════════════════════════════════════
   VALUES
   ══════════════════════════════════════════════════════════════════ */
.values {
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.value {
  padding: clamp(28px, 3.4vw, 40px) clamp(20px, 2.6vw, 32px) clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 14px; position: relative;
}
.value:last-child { border-right: 0; }
@media (max-width: 900px) { .value { border-right: 0; } }
.value .idx {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .16em; color: var(--ochre);
}
.value h3 {
  font-family: var(--f-ui); font-size: 18px; font-weight: 600;
  letter-spacing: -.015em; margin: 0;
}
.value p {
  font-family: var(--f-prose); font-weight: 300; font-size: 16px;
  line-height: 1.6; color: var(--ink-soft); margin: 0;
}
.value::before {
  content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 2px;
  background: var(--ochre); transform: scaleX(0); transform-origin: left;
  transition: transform .45s var(--ease);
}
.value:hover::before { transform: scaleX(1); }

/* ══════════════════════════════════════════════════════════════════
   WORK
   ══════════════════════════════════════════════════════════════════ */
.work-list { border-top: 1px solid var(--rule); }
.project {
  display: grid;
  grid-template-columns: minmax(180px, .9fr) minmax(0, 2.1fr);
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(28px, 3.6vw, 44px) 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.project-meta { display: flex; flex-direction: column; gap: 10px; }
.project-name {
  font-family: var(--f-ui); font-size: clamp(19px, 2.3vw, 23px);
  font-weight: 700; letter-spacing: -.025em; margin: 0;
}
.project-status {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .13em;
  text-transform: uppercase; display: inline-flex; align-items: center; gap: 7px;
  color: var(--ink-soft); width: fit-content;
}
.project-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); flex: none; }
.project-status.live { color: var(--sage); }
.project-status.live .dot {
  background: var(--sage);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 22%, transparent);
}
.project-status.dev { color: var(--ochre); }
.project-status.dev .dot { background: var(--ochre); }

.project-body { display: flex; flex-direction: column; gap: 12px; }
.project-tagline {
  font-family: var(--f-prose); font-size: clamp(17px, 1.9vw, 19px);
  line-height: 1.5; margin: 0; max-width: 54ch;
}
.project-desc {
  font-family: var(--f-prose); font-weight: 300; font-size: 15.5px;
  line-height: 1.65; color: var(--ink-soft); margin: 0; max-width: 62ch;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.project-tags span {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .06em;
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  padding: 3px 9px; color: var(--ink-soft);
}
.project.concept .project-name { color: var(--ink-soft); }
.project.concept .project-tagline { color: var(--ink-soft); }

/* ══════════════════════════════════════════════════════════════════
   MODEL
   ══════════════════════════════════════════════════════════════════ */
.model {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.model-grid {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px); align-items: start;
}
.model-points { display: flex; flex-direction: column; }
.model-point {
  display: grid; grid-template-columns: 34px 1fr; gap: 18px;
  padding: 22px 0; border-bottom: 1px solid var(--rule);
}
.model-point:first-child { padding-top: 0; }
.model-point:last-child { border-bottom: 0; }
.model-point .n { font-family: var(--f-mono); font-size: 12px; color: var(--ochre); padding-top: 3px; }
.model-point h4 {
  font-family: var(--f-ui); font-size: 16.5px; font-weight: 600;
  letter-spacing: -.01em; margin: 0 0 5px;
}
.model-point p {
  font-family: var(--f-prose); font-weight: 300; font-size: 15.5px;
  line-height: 1.62; color: var(--ink-soft); margin: 0;
}
.model-aside {
  font-family: var(--f-prose); font-style: italic; font-weight: 300;
  font-size: clamp(21px, 2.9vw, 31px); line-height: 1.3;
  letter-spacing: -.015em; color: var(--ink); margin: 0;
  border-left: 2px solid var(--ochre); padding-left: clamp(18px, 3vw, 28px);
}

/* ══════════════════════════════════════════════════════════════════
   COLLECTIVE
   ══════════════════════════════════════════════════════════════════ */
.collective-facts {
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.fact { padding: clamp(26px, 3vw, 36px) clamp(20px, 2.4vw, 30px) clamp(30px, 3.6vw, 44px) 0; }
.fact .k {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ochre); display: block; margin-bottom: 12px;
}
.fact p {
  font-family: var(--f-prose); font-weight: 300; font-size: 16px;
  line-height: 1.62; color: var(--ink-soft); margin: 0;
}
.fact strong {
  font-family: var(--f-ui); font-weight: 600; color: var(--ink);
  display: block; margin-bottom: 6px; font-size: 16.5px; letter-spacing: -.01em;
}

/* ══════════════════════════════════════════════════════════════════
   CONTACT + FOOTER
   ══════════════════════════════════════════════════════════════════ */
.inverted { background: var(--ink); color: var(--ink-invert); }
.contact { padding: clamp(64px, 9vw, 116px) 0; }
.contact-inner { max-width: 720px; margin-inline: auto; text-align: center; }
.contact .eyebrow { color: color-mix(in srgb, var(--ochre) 68%, #fff); }
.contact h2 {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(32px, 5.2vw, 60px); line-height: 1.02;
  letter-spacing: -.04em; margin: 16px 0 20px; color: var(--ink-invert);
}
.contact .lead {
  font-family: var(--f-prose); font-weight: 300;
  font-size: clamp(17px, 2vw, 19px); line-height: 1.6;
  color: #b9bcc7; margin: 0 0 clamp(36px, 5vw, 52px);
}
.contact-links { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.contact-link {
  font-family: var(--f-ui); font-size: 15px; font-weight: 600;
  text-decoration: none; padding: 14px 26px; border-radius: var(--r-pill);
  border: 1.5px solid #3a3e4a; color: var(--ink-invert);
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.contact-link:hover { border-color: var(--ochre); background: rgba(143,100,16,.14); }
.contact-link.primary { background: var(--ink-invert); color: var(--ink); border-color: var(--ink-invert); }
.contact-link.primary:hover { background: transparent; color: var(--ink-invert); }

.site-footer { border-top: 1px solid #2b2f3a; padding: 32px 0 44px; }
.footer-grid {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 24px; align-items: flex-start;
}
.footer-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-ui); font-weight: 700; font-size: 16px;
}
.footer-brand .mark {
  width: 24px; height: 24px; border-radius: var(--r-sm);
  display: grid; place-content: center; overflow: hidden;
}
.footer-brand .mark img { width: 100%; height: 100%; object-fit: contain; }
.footer-legal {
  font-family: var(--f-mono); font-size: 11px; line-height: 1.8;
  color: #8b8f9c; letter-spacing: .02em; text-align: right;
}
.footer-links {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-top: 26px; padding-top: 22px; border-top: 1px solid #2b2f3a;
}
.footer-links a {
  font-family: var(--f-ui); font-size: 13px; color: #8b8f9c; text-decoration: none;
}
.footer-links a:hover { color: var(--ink-invert); }

/* ══════════════════════════════════════════════════════════════════
   LEGAL PAGES — impressum, agb, subprocessors
   ══════════════════════════════════════════════════════════════════ */
.legal-page {
  padding: 0 0 clamp(48px, 6vw, 80px);
}
.legal-page .container {
  max-width: 760px; margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px);
}
.legal-top-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 20px 0; margin-bottom: 16px;
}
.legal-back {
  font-family: var(--f-ui); font-size: 14px; font-weight: 500;
  text-decoration: none; color: var(--ink-soft);
}
.legal-back:hover { color: var(--ink); }
.legal-lang {
  font-family: var(--f-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  padding: 5px 9px; color: var(--ink-soft); text-decoration: none;
}
.legal-lang:hover { border-color: var(--ink); color: var(--ink); }

.legal-page h1 {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(26px, 4vw, 42px); letter-spacing: -.03em;
  margin: 0 0 8px;
}
.legal-page h2 {
  font-family: var(--f-display); font-weight: 600;
  font-size: 19px; letter-spacing: -.02em;
  margin: 36px 0 12px;
}
.legal-page h3 {
  font-family: var(--f-ui); font-weight: 600;
  font-size: 15.5px; letter-spacing: -.01em;
  margin: 24px 0 8px; color: var(--ink);
}
.legal-page p, .legal-page li {
  font-family: var(--f-prose); font-weight: 300;
  font-size: 16px; line-height: 1.7; color: var(--ink-soft);
  margin: 0 0 12px;
}
.legal-page p strong { font-weight: 500; color: var(--ink); }
.legal-page a { color: var(--ochre); text-decoration: none; }
.legal-page a:hover { text-decoration: underline; }
.legal-meta {
  font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft);
  letter-spacing: .04em; margin: 0 0 32px;
}
.legal-section {
  border-top: 1px solid var(--rule);
  padding-top: 24px; margin-bottom: 8px;
}
.legal-section:first-of-type { border-top: 0; padding-top: 0; }

/* Subprocessor tables */
.subprocessor-table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
  font-family: var(--f-prose); font-size: 14px; line-height: 1.5;
}
.subprocessor-table th {
  font-family: var(--f-ui); font-weight: 600; font-size: 12px;
  text-align: left; padding: 10px 12px;
  border-bottom: 2px solid var(--ink); color: var(--ink);
}
.subprocessor-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--rule);
  color: var(--ink-soft); vertical-align: top;
}
.subprocessor-table td.provider { font-weight: 500; color: var(--ink); }
.subprocessor-table td.location { white-space: nowrap; }
.subprocessor-group { margin-bottom: 24px; }
.group-intro { margin-bottom: 12px; }
.legend { font-size: 14px; line-height: 1.8; }

/* Mobile: stack table rows */
@media (max-width: 640px) {
  .subprocessor-table thead { display: none; }
  .subprocessor-table, .subprocessor-table tbody,
  .subprocessor-table tr, .subprocessor-table td { display: block; width: 100%; }
  .subprocessor-table tr {
    border: 1px solid var(--rule); border-radius: var(--r-md);
    margin-bottom: 12px; padding: 8px;
  }
  .subprocessor-table td {
    border-bottom: 0; padding: 6px 0;
  }
  .subprocessor-table td::before {
    content: attr(data-label) ': '; font-family: var(--f-ui);
    font-weight: 600; font-size: 11px; color: var(--ink);
    text-transform: uppercase; letter-spacing: .06em; margin-right: 4px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
  .model-grid { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 720px) {
  .site-nav a:not(.nav-cta):not(.lang-switch) { display: none; }
  .footer-legal { text-align: left; }
}
@media (max-width: 420px) {
  body { font-size: 16px; }
}

/* ══════════════════════════════════════════════════════════════════
   MOTION — progressive enhancement; content visible without JS
   ══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal { opacity: 0; transform: translateY(18px); }
  .js-reveal.is-in {
    opacity: 1; transform: none;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
