/* Tuna Semiconductors — site stylesheet
   Colors from the Tuna brand manual (identidade-tuna tokens).
   Headings: DIN 2014 (brand) with Bahnschrift as the Windows fallback. */
:root {
  --navy: #05274C;
  --navy-2: #053868;
  --blue: #006DBF;
  --blue-mid: #034883;
  --cyan: #00A3FE;
  --grey: #DDDDDD;
  --soft: #E8EEF5;
  --sec: #5B6B7F;
  --white: #FFFFFF;
  --on-navy: #E6EEF7;
  --on-navy-sec: #A9BFD8;
  --rule-navy: #1D4772;
  --focus: var(--blue);

  --font-title: "DIN 2014", "Bahnschrift", "D-DIN", "TeX Gyre Heros", "Helvetica Neue", Arial, sans-serif;
  --font-body: "TeX Gyre Heros", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Type scale, 17 px base */
  --fs-sm: .8125rem;   /* 13 */
  --fs-xs: .875rem;    /* 15 */
  --fs-md: 1.0625rem;  /* 17 */
  --fs-lg: 1.3125rem;  /* 21 */
  --fs-xl: 1.6875rem;  /* 27 */
  --fs-2x: clamp(1.75rem, 3.4vw, 2.25rem);  /* 36 */
  --fs-3x: clamp(2.25rem, 4.6vw, 3rem);     /* 48 */
  --fs-4x: clamp(2.5rem, 6vw, 4.25rem);     /* 68 */

  --max: 1180px;
  --gutter: 24px;
  --radius: 3px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--navy);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--blue-mid); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 1px; }

h1, h2, h3, h4 {
  font-family: var(--font-title);
  font-stretch: 87.5%;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
  margin: 0 0 .5em;
  letter-spacing: -.005em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-3x); }
h2 { font-size: var(--fs-2x); }
h3 { font-size: var(--fs-lg); line-height: 1.25; margin-bottom: .35em; }
h4 { font-size: var(--fs-md); }
p { margin: 0 0 1em; }
p, li { max-width: 68ch; }
strong { font-weight: 700; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--white); padding: 8px 12px; z-index: 100; }
.muted { color: var(--sec); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--grey); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: block; }
.brand img { height: 40px; width: auto; }
.nav { display: flex; gap: 32px; align-items: center; }
.nav a { color: var(--navy); font-family: var(--font-title); font-weight: 600; font-size: 1rem; text-decoration: none; padding: 6px 0; }
.nav a:hover { color: var(--blue); }
.nav a[aria-current="page"] { color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }
.nav a.btn { color: var(--white); padding: 9px 18px; }
.nav a.btn[aria-current="page"] { box-shadow: none; background: var(--blue-mid); border-color: var(--blue-mid); }
.menu-toggle { display: none; background: none; border: 1px solid var(--grey); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; color: var(--navy); font: inherit; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; background: var(--blue); color: var(--white);
  padding: 13px 24px; border-radius: var(--radius); border: 2px solid var(--blue);
  font-family: var(--font-title); font-size: 1.0625rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--blue-mid); border-color: var(--blue-mid); color: var(--white); }
.on-navy .btn, .btn-cyan { background: var(--cyan); border-color: var(--cyan); color: var(--navy); }
.on-navy .btn:hover, .btn-cyan:hover { background: var(--white); border-color: var(--white); color: var(--navy); }
.link-quiet { font-family: var(--font-title); font-weight: 600; font-size: 1.0625rem; }

/* ---------- Navy surfaces ---------- */
.on-navy { background: var(--navy); color: var(--on-navy); --focus: var(--cyan); }
.on-navy h1, .on-navy h2, .on-navy h3, .on-navy h4 { color: var(--white); }
.on-navy a:not(.btn) { color: var(--white); }
.on-navy a:not(.btn):hover { color: var(--cyan); }

/* ---------- Home hero: live SAR conversion ---------- */
.hero { padding: 72px 0 80px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; }
.hero h1 { font-size: var(--fs-4x); line-height: 1.02; letter-spacing: -.015em; margin-bottom: .4em; }
.hero .lead { font-size: var(--fs-lg); line-height: 1.5; color: var(--on-navy); max-width: 34em; margin-bottom: 1.75em; }
.hero .actions { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }

.sar { margin: 0; }
.sar-plot { position: relative; background: var(--navy-2); border: 1px solid var(--rule-navy); border-radius: var(--radius); }
.sar-plot svg { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: manipulation; }
.sar-plot svg text { font-family: var(--font-title); font-stretch: 87.5%; }
.sar-readout { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding: 16px 2px 0; }
.sar-bits { display: flex; gap: 4px; font-family: var(--font-title); font-variant-numeric: tabular-nums; }
.sar-bits span {
  width: 1.7em; height: 2.1em; display: grid; place-items: center;
  border: 1px solid var(--rule-navy); border-radius: 2px;
  font-size: 1.15rem; font-weight: 700; color: var(--on-navy-sec);
  transition: background-color .12s, color .12s, border-color .12s;
}
.sar-bits span.set { color: var(--cyan); border-color: var(--cyan); }
.sar-bits span.clear { color: var(--on-navy); }
.sar-bits span.now { background: var(--white); color: var(--navy); border-color: var(--white); }
.sar-code { font-family: var(--font-title); font-size: var(--fs-lg); color: var(--white); font-variant-numeric: tabular-nums; }
.sar-code small { display: block; font-size: var(--fs-sm); color: var(--on-navy-sec); font-family: var(--font-body); }
.sar-control { display: flex; align-items: center; gap: 14px; padding-top: 14px; font-size: var(--fs-xs); color: var(--on-navy-sec); }
.sar-control label { white-space: nowrap; }
.sar-control input[type="range"] { flex: 1; accent-color: var(--cyan); min-width: 0; }
.sar figcaption { font-size: var(--fs-xs); color: var(--on-navy-sec); line-height: 1.5; padding-top: 12px; max-width: 60ch; }
.sar figcaption b { color: var(--on-navy); font-weight: 700; }

/* ---------- Inner page header ---------- */
.page-head { padding: 72px 0 56px; border-bottom: 1px solid var(--grey); }
.page-head h1 { max-width: 20ch; margin-bottom: .45em; }
.page-head .lead { font-size: var(--fs-lg); line-height: 1.5; color: var(--sec); max-width: 36em; margin: 0; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-soft { background: var(--soft); }
.section > .container > h2:first-child { margin-bottom: .9em; }
.split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 56px; align-items: start; }
.split > :first-child p { color: var(--sec); }
.split .sticky { position: sticky; top: 112px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; align-items: start; }

/* Index of design areas (home) */
.index { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--navy); }
.index li { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--grey); max-width: none; }
.index h3 { margin: 0; font-size: var(--fs-lg); }
.index p { margin: 0; color: var(--sec); }

/* Capability blocks (capabilities page) */
.blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 56px; }
.block { border-top: 2px solid var(--navy); padding-top: 20px; }
.block h3 { font-size: var(--fs-xl); }
.block .kind { display: block; color: var(--blue-mid); font-weight: 600; font-size: var(--fs-xs); margin-bottom: 6px; }

/* Lists with a short rule as marker */
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding: 9px 0 9px 26px; border-bottom: 1px solid var(--grey); }
.ticks li:last-child { border-bottom: 0; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 1.15em; width: 12px; height: 2px; background: var(--blue); }
.section-soft .ticks li { border-bottom-color: #CBD7E5; }

/* ---------- Datasheet table ---------- */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: start; }
.chip-name { font-size: var(--fs-3x); letter-spacing: .01em; margin-bottom: .25em; }
.state { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--blue-mid); margin-top: 4px; }
.state::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--blue); background: linear-gradient(90deg, var(--blue) 50%, transparent 50%); }
.spec-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); background: var(--white); font-variant-numeric: tabular-nums; }
.spec-table caption { caption-side: top; text-align: left; font-family: var(--font-title); font-weight: 600; color: var(--navy); padding-bottom: 10px; }
.spec-table thead th { background: var(--navy); color: var(--white); font-family: var(--font-title); font-weight: 600; text-align: left; padding: 11px 16px; }
.spec-table tbody th, .spec-table tbody td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--grey); vertical-align: top; }
.spec-table tbody tr:nth-child(even) { background: var(--soft); }
.spec-table tbody th { font-weight: 400; color: var(--sec); width: 42%; }
.spec-table tbody td { font-weight: 700; color: var(--navy); }
.table-note { font-size: var(--fs-xs); color: var(--sec); margin-top: 12px; }

/* ---------- Design flow (a real sequence) ---------- */
.flow { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); counter-reset: step; }
.flow li { position: relative; padding: 44px 24px 0 0; counter-increment: step; }
.flow li::before {
  content: counter(step); position: absolute; top: 0; left: 0; z-index: 1;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--white); border: 2px solid var(--blue); color: var(--blue);
  font-family: var(--font-title); font-weight: 700; font-size: .95rem;
}
.flow li::after { content: ""; position: absolute; top: 15px; left: 30px; right: 0; height: 2px; background: var(--blue); }
.flow li:last-child::after { display: none; }
.flow li:last-child::before { background: var(--navy); border-color: var(--navy); color: var(--white); }
.flow h3 { font-size: var(--fs-lg); }
.flow p { color: var(--sec); font-size: var(--fs-xs); margin: 0; }

/* ---------- Facts ---------- */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 48px; }
.fact h3 { margin-bottom: .3em; }
.fact p { margin: 0; color: var(--sec); }

/* ---------- Engagement models ---------- */
.models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--navy); }
.models > div { padding: 24px 28px 8px 0; }
.models > div + div { padding-left: 28px; border-left: 1px solid var(--grey); }
.models p { color: var(--sec); }

/* ---------- Team ---------- */
.team { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 40px; }
.member .photo { aspect-ratio: 4 / 5; background: var(--soft); overflow: hidden; border-radius: var(--radius); margin-bottom: 20px; }
.member .photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.member h3 { margin-bottom: 4px; }
.member .role { display: block; color: var(--blue); font-family: var(--font-title); font-weight: 600; margin-bottom: 10px; }
.member p { color: var(--sec); margin: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 72px; align-items: start; }
.form .field { margin-bottom: 20px; }
.form label { display: block; font-weight: 700; color: var(--navy); font-size: var(--fs-xs); margin-bottom: 6px; }
.form input, .form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid #9FB0C4; border-radius: var(--radius);
  font: inherit; color: var(--navy); background: var(--white);
}
.form input:focus-visible, .form textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.form textarea { min-height: 180px; resize: vertical; }
.form ::placeholder { color: #7F8FA3; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form .consent { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; color: var(--sec); font-size: var(--fs-xs); }
.form .consent input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--blue); }
.form .hp { position: absolute; left: -9999px; }
.req { color: var(--blue); }
.notice { padding: 14px 18px; border-left: 4px solid var(--blue); background: var(--soft); margin-bottom: 28px; }
.notice.error { border-left-color: #B3261E; }
.contact-list { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--navy); }
.contact-list li { padding: 16px 0; border-bottom: 1px solid var(--grey); }
.contact-list .k { display: block; color: var(--sec); font-size: var(--fs-sm); margin-bottom: 2px; }

/* ---------- Prose (privacy) ---------- */
.prose { max-width: 44rem; }
.prose h2 { font-size: var(--fs-xl); margin-top: 1.6em; }

/* ---------- Footer with closing call to action ---------- */
.site-footer { padding: 0 0 28px; font-size: var(--fs-xs); color: var(--on-navy-sec); }
.site-footer .on-navy-sec { color: var(--on-navy-sec); }
.footer-cta { display: flex; justify-content: space-between; align-items: center; gap: 24px 48px; flex-wrap: wrap; padding: 72px 0 64px; border-bottom: 1px solid var(--rule-navy); }
.footer-cta h2 { margin-bottom: .25em; font-size: var(--fs-2x); }
.footer-cta p { margin: 0; font-size: var(--fs-md); color: var(--on-navy); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 4fr); gap: 40px; padding: 48px 0 40px; }
.footer-grid img { height: 36px; width: auto; margin-bottom: 18px; }
.footer-grid h4 { color: var(--white); font-size: 1rem; margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--rule-navy); padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: var(--fs-sm); }

/* ---------- 404 ---------- */
.notfound .actions { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid, .feature, .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .split .sticky { position: static; }
  .flow { grid-template-columns: minmax(0, 1fr); margin-top: 32px; }
  .flow li { padding: 0 0 28px 52px; }
  .flow li::after { top: 30px; bottom: 0; left: 14px; right: auto; width: 2px; height: auto; }
  .flow li:last-child { padding-bottom: 0; }
  .team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  body { font-size: 1rem; }
  .section { padding: 64px 0; }
  .hero { padding: 48px 0 56px; }
  .page-head { padding: 48px 0 40px; }
  .site-header .container { height: 64px; }
  .brand img { height: 32px; }
  .menu-toggle { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--white); flex-direction: column; align-items: flex-start; gap: 0; padding: 4px var(--gutter) 20px; border-bottom: 1px solid var(--grey); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; width: 100%; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--blue); padding-left: 12px; }
  .nav a.btn { width: auto; margin-top: 10px; padding: 10px 18px; }
  .index li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .blocks, .two-col, .facts, .team, .form .row, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .models { grid-template-columns: minmax(0, 1fr); }
  .models > div, .models > div + div { padding: 20px 0 4px; border-left: 0; }
  .models > div + div { border-top: 1px solid var(--grey); }
  .team { max-width: 420px; }
  .sar-bits span { width: 1.45em; font-size: 1rem; }
  .footer-cta { padding: 56px 0 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.nowrap { white-space: nowrap; }
