/* ERICI — European RISC-V Industrial Computing Initiative — shared styles */

:root {
  /* palette from the Oct 2026 slides */
  --ink:      #0B2A43;
  --ink-soft: #3F5568;
  --muted:    #5E6E7B;
  --blue0:    #EAF4FB;
  --blue1:    #D4E9F8;
  --blue2:    #8DC3EA;
  --blue3:    #2F86C9;
  --blue4:    #124C7C;
  --green0:   #EAF7EF;
  --green1:   #D5F0DE;
  --green2:   #8ED3A6;
  --green3:   #2E9B64;
  --green4:   #14653D;
  --grey1:    #EEF2F5;
  --grey2:    #AAB6C0;

  --bg:       #FFFFFF;
  --bg-soft:  var(--blue0);
  --surface:  #FFFFFF;
  --line:     #D9E3EB;
  --link:     var(--blue4);
  --brand:    linear-gradient(90deg, var(--blue3), var(--green3));

  --font: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:      #E6EEF5;
    --ink-soft: #B4C3D0;
    --muted:    #8A9BA9;
    --blue0:    #0F2232;
    --blue1:    #15324A;
    --blue2:    #2F6E9F;
    --blue3:    #4FA3E3;
    --blue4:    #8DC3EA;
    --green0:   #0F261B;
    --green1:   #163826;
    --green2:   #2E7A50;
    --green3:   #4CC08A;
    --green4:   #8ED3A6;
    --grey1:    #1A2632;
    --grey2:    #4A5A68;
    --bg:       #0A1620;
    --bg-soft:  #0E1E2B;
    --surface:  #102231;
    --line:     #1F3446;
    --link:     #8DC3EA;
  }
}

:root[data-theme="dark"] {
  --ink:      #E6EEF5;
  --ink-soft: #B4C3D0;
  --muted:    #8A9BA9;
  --blue0:    #0F2232;
  --blue1:    #15324A;
  --blue2:    #2F6E9F;
  --blue3:    #4FA3E3;
  --blue4:    #8DC3EA;
  --green0:   #0F261B;
  --green1:   #163826;
  --green2:   #2E7A50;
  --green3:   #4CC08A;
  --green4:   #8ED3A6;
  --grey1:    #1A2632;
  --grey2:    #4A5A68;
  --bg:       #0A1620;
  --bg-soft:  #0E1E2B;
  --surface:  #102231;
  --line:     #1F3446;
  --link:     #8DC3EA;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

a { color: var(--link); }
a:hover { color: var(--green3); }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- brand bar: the blue-to-green strip from the slides ---- */
.brand-bar {
  height: 6px;
  background: var(--brand);
}

/* ---- header ---- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}
.logo:hover { color: var(--ink); }
.logo svg { width: 28px; height: 28px; flex: none; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.2rem 1.4rem;
}
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--green3); }

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--blue2); }
.theme-toggle svg { width: 16px; height: 16px; }

.head-tools { display: flex; align-items: center; gap: 0.5rem; }
.nav { margin-left: auto; }
.menu-toggle { display: none; }

/* ---- hero ---- */
.hero {
  background:
    radial-gradient(60% 80% at 85% 20%, color-mix(in srgb, var(--green1) 70%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem);
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.2rem;
  color: var(--green4);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 4px;
  height: 1.4em;
  background: var(--green3);
  flex: none;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5.4vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  font-weight: 700;
}
.hero h1 .accent {
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  margin: 1.4rem 0 0;
  max-width: 36em;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
}
.badge {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--blue2);
  background: var(--blue1);
  color: var(--blue4);
}
.badge.green {
  border-color: var(--green2);
  background: var(--green1);
  color: var(--green4);
}
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 2rem 0 0;
}
.btn {
  display: inline-block;
  padding: 0.75rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--blue3);
  color: var(--blue4);
  background: var(--surface);
}
.btn:hover { border-color: var(--green3); color: var(--green4); }
.btn.primary {
  border-color: transparent;
  background: var(--blue4);
  color: #FFFFFF;
}
.btn.primary:hover { background: var(--green4); color: #FFFFFF; }
:root[data-theme="dark"] .btn.primary { background: var(--blue3); color: #06121C; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.primary { background: var(--blue3); color: #06121C; }
}

/* ---- hero stack figure (teaser for the reference stack section) ---- */
.stack {
  margin: 0;
  display: grid;
  gap: 8px;
}
.layer {
  border-radius: 8px;
  border: 1.5px solid var(--blue3);
  background: var(--blue1);
  padding: 0.7rem 1rem;
  text-align: center;
  line-height: 1.3;
}
.layer b { display: block; font-size: 1rem; }
.layer span { font-size: 0.82rem; color: var(--ink-soft); }
.layer.green { border-color: var(--green3); background: var(--green1); }
.layer.hv {
  /* fixed solid fills: white text must stay readable in both themes */
  border-color: #14653D;
  background: #2E9B64;
  color: #FFFFFF;
}
.layer.hv span { color: rgba(255, 255, 255, 0.85); }
.layer.soc {
  border-color: #124C7C;
  background: #124C7C;
  color: #FFFFFF;
}
.layer.soc span { color: rgba(255, 255, 255, 0.8); }
.parts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stack figcaption {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}
.stack figcaption a { color: inherit; }

/* ---- sections ---- */
.section {
  padding: clamp(3rem, 7vw, 5rem) 0;
  border-top: 1px solid var(--line);
}
.section.alt { background: var(--bg-soft); }
.section-tag {
  margin: 0 0 0.4rem;
  color: var(--green4);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.section h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  line-height: 1.15;
}
.section p { max-width: 42em; color: var(--ink-soft); }
.section p.wide { max-width: none; }   /* intro above full-width content */
.placeholder {
  border: 1.5px dashed var(--grey2);
  border-radius: 8px;
  padding: 1.2rem 1.4rem;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 42em;
}

/* ---- why now: reasons ---- */
.reasons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
  margin: 2rem 0 0;
}
.reason {
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue3);
  border-radius: 10px;
  background: var(--surface);
  padding: 1.1rem 1.2rem 1.2rem;
}
.reason:nth-child(even) { border-top-color: var(--green3); }
.reason .num {
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--green3);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.95rem;
}
.reason h3 { margin: 0.7rem 0 0.4rem; font-size: 1.1rem; line-height: 1.25; }
.section .reason p { margin: 0; font-size: 0.95rem; }

/* ---- why now: timeline ---- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  position: relative;
}
/* the rail: blue-to-green, like the brand bar */
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0.55rem;
  height: 3px;
  background: var(--brand);
  border-radius: 2px;
}
.timeline li {
  position: relative;
  padding: 1.7rem 0.8rem 0 0;
}
.timeline li::before {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--blue3);
}
.section.alt .timeline li::before { background: var(--bg-soft); }
.timeline li.now::before { background: var(--green3); border-color: var(--green3); }
.timeline b { display: block; font-size: 1.15rem; }
.timeline span { display: block; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.4; }
.timeline li.now b { color: var(--green4); }

.closing { margin-top: 2.5rem; font-size: 1.08rem; }

/* ---- the gap: product cards ---- */
.products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 2rem 0 0;
}
.product {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.product-img {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 240px;
  padding: 1rem;
  overflow: hidden;
}
/* each photo sits on the background it was shot on */
.product-img.light { background: #FFFFFF; }
.product-img.light img { height: 150%; max-width: none; }   /* trim the photo's white margin */
.product-img.dark {
  background: #010101;
}
/* the Milk-V photo has its own black-to-green backdrop: fade its top and right edges to black */
.product-img.dark img {
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 30%),
                      linear-gradient(to bottom, transparent 0, #000 20%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to left, transparent 0, #000 30%),
              linear-gradient(to bottom, transparent 0, #000 20%);
  mask-composite: intersect;
}
.product-img img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.product-body { padding: 1.1rem 1.3rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.product h3 { margin: 0; font-size: 1.2rem; }
.product .maker { margin: 0.15rem 0 0.7rem; font-size: 0.9rem; color: var(--muted); }
.product ul { margin: 0 0 1rem; padding-left: 1.1rem; color: var(--ink-soft); font-size: 0.95rem; }
.product li { margin: 0.2rem 0; }
.product .credit {
  margin: auto 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---- the gap: checklist ---- */
.sub { margin: 3rem 0 1rem; font-size: 1.3rem; }
.table-scroll { overflow-x: auto; }
.checklist {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.95rem;
}
.checklist th,
.checklist td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.checklist thead th {
  background: var(--blue1);
  color: var(--blue4);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.checklist tbody th { font-weight: 500; color: var(--ink); }
.checklist tbody tr:last-child > * { border-bottom: 0; }
.checklist td { white-space: nowrap; width: 1%; }
.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.mark::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  flex: none;
}
.mark.yes  { color: var(--green4); }
.mark.yes::before  { background: var(--green3); }
.mark.part { color: var(--blue4); }
.mark.part::before { background: linear-gradient(90deg, var(--blue3) 50%, transparent 50%);
                     border: 1.5px solid var(--blue3); }
.mark.none { color: var(--muted); }
.mark.none::before { border: 1.5px solid var(--grey2); }

.note { font-size: 0.85rem; color: var(--muted) !important; margin-top: 1rem; }
.takeaway {
  margin: 2rem 0 0;
  padding: 1.1rem 1.4rem;
  border-left: 4px solid var(--green3);
  background: var(--green0);
  border-radius: 0 8px 8px 0;
  color: var(--ink) !important;
  font-size: 1.08rem;
  font-weight: 500;
}

/* ---- reference stack: layer table ---- */
.layers { margin: 2rem 0 0; display: grid; gap: 8px; }
.lrow {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.lrow > * { padding: 0.85rem 1.1rem; }
.lrow.head {
  border: 0;
  background: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.lrow.head > * { padding-top: 0; padding-bottom: 0.2rem; }
.lname b, .lex b { display: block; line-height: 1.3; }
.lname span, .lex span { display: block; font-size: 0.88rem; line-height: 1.4; }
.lname span { opacity: 0.85; }
.lex span { color: var(--ink-soft); }
.lex b a { color: inherit; text-decoration-color: var(--blue2); text-underline-offset: 3px; }
.lex b a:hover { color: var(--green3); }
/* layer colors match the hero stack; fixed fills keep white text readable in both themes */
.l-gp { background: var(--blue1); border-right: 3px solid var(--blue3); }
.l-rt { background: var(--green1); border-right: 3px solid var(--green3); }
.l-hv { background: #2E9B64; color: #FFFFFF; }
.l-fw { background: var(--blue1); border-right: 3px solid var(--blue3); }
.l-hw { background: #124C7C; color: #FFFFFF; }
.alts {
  list-style: none;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 0.4rem;
  border-left: 1px dashed var(--line);
}
.alts li {
  font-size: 0.85rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--grey2);
  color: var(--ink-soft);
  background: var(--bg);
}

/* ---- reference stack: boot example ---- */
.boot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem clamp(2rem, 5vw, 4rem);
  align-items: center;
  margin-top: 1.5rem;
}
.code {
  margin: 0;
  padding: 1.1rem 1.3rem;
  border-radius: 10px;
  background: #0B2A43;
  color: #E6EEF5;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: auto;
}
.code .c { color: #8ED3A6; }

/* ---- join ---- */
.join {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem clamp(2rem, 5vw, 4rem);
}
.join .sub { margin-top: 2rem; }
.invite, .principles { list-style: none; margin: 0; padding: 0; }
.invite li {
  padding: 0.75rem 0 0.75rem 1.1rem;
  border-left: 3px solid var(--blue3);
  margin-bottom: 0.6rem;
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}
.invite li:nth-child(even) { border-left-color: var(--green3); }
.invite b { display: block; }
.invite span { display: block; font-size: 0.92rem; color: var(--ink-soft); }
.principles li {
  position: relative;
  padding: 0 0 0.9rem 1.8rem;
  color: var(--ink-soft);
}
.principles li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--green3);
  /* check mark */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8'/%3E%3C/svg%3E");
}
.principles li::after {
  content: "";
  position: absolute;
  left: 0.33rem;
  top: 0.48rem;
  width: 0.3rem;
  height: 0.52rem;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.principles b { color: var(--ink); }
.contact {
  margin-top: 1.2rem;
  padding: 1.4rem 1.5rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.contact::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand);
}
.contact-title { margin: 0 0 0.9rem; font-size: 1.2rem; font-weight: 700; color: var(--ink) !important; }
.section .contact-who { margin: 0.9rem 0 0; font-size: 0.88rem; color: var(--muted); }

/* ---- footer ---- */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.site-foot p { margin: 0; }
.site-foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-foot a { color: var(--ink-soft); }

/* ---- responsive ---- */
@media (max-width: 1000px) {
  .reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .products { grid-template-columns: 1fr; }
  .join { grid-template-columns: 1fr; }
  .boot { grid-template-columns: 1fr; }
  .lrow { grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); }
  .lrow .alts { grid-column: 1 / -1; border-left: 0; border-top: 1px dashed var(--line); }
  .lrow.head { display: none; }
  .alts::before { content: "Alternatives:"; font-size: 0.85rem; color: var(--muted); padding: 0.2rem 0.2rem 0.2rem 0; }
  .stack { max-width: 460px; }
}

@media (max-width: 720px) {
  .menu-toggle {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
  }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.4rem var(--gutter) 0.8rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: flex; }
  .reasons { grid-template-columns: 1fr; }
  /* vertical timeline on phones */
  .timeline { grid-template-columns: 1fr; padding-left: 1.6rem; }
  .lrow { grid-template-columns: 1fr; }
  .lname { border-right: 0 !important; }
  .timeline::before { left: 0.4rem; right: auto; top: 0.3rem; bottom: 0.3rem; width: 3px; height: auto;
                      background: linear-gradient(180deg, var(--blue3), var(--green3)); }
  .timeline li { padding: 0 0 1rem; }
  .timeline li::before { left: -1.6rem; top: 0.3rem; }
  .timeline b { display: inline; margin-right: 0.5rem; }
  .timeline span { display: inline; }
  .checklist th, .checklist td { padding: 0.6rem 0.7rem; }
  .checklist td { white-space: normal; }
  .nav a { padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
}

/* ---- legal pages ---- */
.legal { padding: clamp(2.5rem, 6vw, 4rem) 0 4rem; }
.legal h1 { margin: 0 0 1.5rem; font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1.1; }
.legal h2 { margin: 2rem 0 0.5rem; font-size: 1.15rem; }
.legal p { max-width: 42em; color: var(--ink-soft); margin: 0 0 0.8rem; }
.legal p.wide { max-width: none; }
.legal .note { font-size: 0.85rem; color: var(--muted); margin-top: 2.5rem; }
/* marks text that must be filled in before publishing */
.todo {
  background: #FFE9A8;
  color: #5A4200;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-weight: 600;
}
