:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1d2433;
  --muted: #5a6478;
  --border: #e3e7ee;
  --primary: #0b3b5c;
  --primary-dark: #072a42;
  --accent: #14a3a3;
  --accent-soft: #e3f5f5;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --max: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--primary); text-underline-offset: .2em; }
a:hover { color: var(--accent); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.25; color: var(--primary-dark); margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--primary); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; color: #fff; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 68px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: .65rem;
  text-decoration: none; color: var(--primary-dark); font-weight: 700;
}
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--primary); color: #fff; font-size: .95rem; letter-spacing: .02em;
}
.brand-text small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; }

.main-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; }
.main-nav a {
  display: block; padding: .45rem .8rem; border-radius: 8px;
  text-decoration: none; color: var(--text); font-weight: 500;
}
.main-nav a:hover { background: var(--accent-soft); color: var(--primary-dark); }
.main-nav a[aria-current="page"] { background: var(--primary); color: #fff; }

.lang-switch {
  font-size: .9rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--border); border-radius: 999px; padding: .3rem .8rem; color: var(--primary);
}
.lang-switch:hover { border-color: var(--accent); }

.nav-wrap { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

/* PCB trace backgrounds */
.hero,
.page-hero,
.section-pcb,
.site-footer { position: relative; isolation: isolate; overflow: hidden; }
.hero::before,
.page-hero::before,
.section-pcb::before,
.site-footer::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("../img/pcb-pattern.svg") repeat;
}
.hero::before {
  opacity: .3;
  -webkit-mask-image: linear-gradient(to left, #000 20%, transparent 85%);
  mask-image: linear-gradient(to left, #000 20%, transparent 85%);
}
.page-hero::before {
  opacity: .25;
  -webkit-mask-image: linear-gradient(to left, #000, transparent 75%);
  mask-image: linear-gradient(to left, #000, transparent 75%);
}
.section-pcb::before { opacity: .1; background-size: 260px; }
.site-footer::before { opacity: .08; }

/* Hero */
.hero {
  color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(20, 163, 163, .35), transparent 45%),
    linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: clamp(3rem, 8vw, 5.5rem) 0;
}
.hero-inner { display: grid; gap: 2rem; align-items: center; grid-template-columns: 1fr; }
.hero-art { justify-self: center; width: min(300px, 75vw); filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .35)); }
@media (min-width: 860px) {
  .hero-inner { grid-template-columns: 1.35fr 1fr; }
  .hero-art { width: 100%; max-width: 400px; }
}
.hero h1 { color: #fff; max-width: 22ch; }
.hero .eyebrow { color: #9fe3e3; }
.hero p { max-width: 62ch; color: #dbe6ef; font-size: 1.125rem; }

.page-hero {
  background:
    radial-gradient(circle at 90% 0%, rgba(20, 163, 163, .3), transparent 50%),
    linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; padding: clamp(2.25rem, 6vw, 3.5rem) 0;
}
.page-hero h1 { color: #fff; margin: 0; }

.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .75rem;
}

.breadcrumb { font-size: .9rem; margin-bottom: .5rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; color: #9fb4c6; }
.breadcrumb a { color: #cfe0ec; }
.breadcrumb [aria-current] { color: #fff; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.3rem; border-radius: 10px; font-weight: 600; text-decoration: none;
  border: 2px solid transparent; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #0f8a8a; color: #fff; }
.btn-ghost { border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn-ghost:hover { border-color: #fff; color: #fff; }
.btn-outline { border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* Sections */
.section { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-intro { max-width: 68ch; color: var(--muted); }

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.grid .card { border-top: 3px solid var(--accent); transition: transform .2s, box-shadow .2s; }
.grid .card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(11, 59, 92, .14); }
/* Copper-pad corner accent, echoing PCB silkscreen markings. */
.grid .card::after {
  content: ""; position: absolute; right: 1rem; top: 1rem; width: 8px; height: 8px;
  border-radius: 50%; border: 2px solid var(--accent); opacity: .5;
}
.card p:last-child { margin-bottom: 0; }
.card-icon {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 1rem;
}
.card-icon svg { width: 24px; height: 24px; }

.prose { max-width: 72ch; }
.prose p { margin-bottom: 1.1em; }

.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.facts li { display: flex; gap: .75rem; align-items: flex-start; }
.facts svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--accent); margin-top: .2rem; }

.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.contact-list li { display: flex; gap: 1rem; align-items: center; }
.contact-list .label { display: block; font-size: .85rem; color: var(--muted); }
.contact-list a { font-weight: 600; font-size: 1.1rem; overflow-wrap: anywhere; }
.contact-list .card-icon { flex: 0 0 44px; margin-bottom: 0; }
.email-reveal {
  font: inherit; font-weight: 600; cursor: pointer;
  color: var(--primary); background: var(--accent-soft);
  border: 1px solid var(--accent); border-radius: 8px; padding: .35rem .9rem;
}
.email-reveal:hover { background: var(--accent); color: #fff; }
.email-reveal[hidden] { display: none; }

.notice {
  border-left: 4px solid var(--accent); background: var(--accent-soft);
  padding: 1.25rem 1.5rem; border-radius: 0 var(--radius) var(--radius) 0;
}

.two-col { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 860px) {
  .two-col { grid-template-columns: 1.6fr 1fr; align-items: start; }
}

/* Footer */
.site-footer { margin-top: auto; background: var(--primary-dark); color: #b9c7d4; padding: 2rem 0; font-size: .95rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }
.site-footer a { color: #fff; }
.footer-links { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; }

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .container { padding: 0 1rem; }
  .header-inner { min-height: 0; padding-block: .6rem; gap: .5rem; }
  .brand-mark { width: 34px; height: 34px; }
  .header-inner { flex-wrap: wrap; }
  /* Lets the language switch sit beside the brand while the menu takes its own row. */
  .nav-wrap { display: contents; }
  .brand { flex: 1 1 0; min-width: 0; }
  .brand-mark { flex: 0 0 auto; }
  .brand-text { min-width: 0; overflow: hidden; }
  .brand-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lang-switch { flex: 0 0 auto; padding: .3rem .65rem; }
  .main-nav { order: 3; width: 100%; }
  .main-nav ul { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: .15rem; }
  .main-nav a { white-space: nowrap; padding: .4rem .4rem; font-size: .88rem; text-align: center; }
  .hero p { font-size: 1.05rem; }
  .actions { flex-direction: column; }
  .actions .btn { justify-content: center; }
  .card { padding: 1.25rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 359px) {
  .site-header { position: static; }
  .main-nav ul { grid-template-columns: 1fr 1fr; justify-content: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
