/* ------------------------------------------------------------------
   Versola Engineering · Components
   Reusable building blocks. Page-specific layout lives in style.css.
   ------------------------------------------------------------------ */

/* Base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink-700);
  font: 400 var(--t-body)/var(--lh-body) var(--f-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; }
::selection { background: var(--accent); color: #fff; }

/* Typography ------------------------------------------------------- */
h1, h2, h3, h4 { margin: 0; color: var(--ink-900); font-family: var(--f-display); font-weight: 700; text-wrap: balance; }
.t-hero { font-size: var(--t-hero); line-height: 1.05; letter-spacing: var(--track-tight); font-weight: 700; }
.t-h2 { font-size: var(--t-h2); line-height: var(--lh-head); letter-spacing: var(--track-head); font-weight: 700; }
.t-h3 { font-size: var(--t-h3); line-height: 1.25; letter-spacing: -0.01em; }
.t-h4 { font-size: var(--t-h4); line-height: 1.3; letter-spacing: -0.01em; }
.t-lead { font-size: var(--t-lead); line-height: 1.5; color: var(--ink-700); }
.t-body { font-size: var(--t-body); }
.t-small { font-size: var(--t-small); line-height: 1.5; }
.t-meta { font: 500 14px/1.3 var(--f-body); letter-spacing: 0; color: var(--ink-500); }
.t-mu { color: var(--ink-500); }
.t-num { font-family: var(--f-display); font-weight: 700; letter-spacing: var(--track-tight); line-height: 1; color: var(--ink-900); font-variant-numeric: tabular-nums; }
p { margin: 0; }
.measure { max-width: 62ch; }

/* Layout ----------------------------------------------------------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--sec-y) 0; }
.section--tint { background: var(--surface-100); }
.section--inv { background: var(--inv-bg); color: var(--inv-text); }
.section--inv h1, .section--inv h2, .section--inv h3, .section--inv h4, .section--inv .t-num { color: var(--inv-text); }
.section--inv .t-mu, .section--inv .t-meta, .section--inv .t-lead { color: var(--inv-mu); }
.section-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-6); align-items: end; margin-bottom: var(--s-8); }
.section-head .t-meta { margin-bottom: var(--s-4); }
.section-head .t-lead { max-width: 46ch; }
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rule { border: 0; border-top: 1px solid var(--line-200); margin: 0; }
.section--inv .rule { border-color: var(--inv-line); }
.stack > * + * { margin-top: var(--s-4); }

/* Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 48px; padding: 0 var(--s-5); border-radius: var(--r-sm);
  font: 500 15px/1 var(--f-body); white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ink-900); color: #fff; }
.btn--primary:hover { background: var(--accent); }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-hover); }
.btn--secondary { background: transparent; color: var(--ink-900); border-color: var(--line-200); }
.btn--secondary:hover { border-color: var(--ink-900); }
.section--inv .btn--primary { background: #fff; color: var(--ink-900); }
.section--inv .btn--primary:hover { background: var(--accent); color: #fff; }
.section--inv .btn--secondary { color: #fff; border-color: var(--inv-line); }
.section--inv .btn--secondary:hover { border-color: #fff; }
.btn--sm { height: 40px; padding: 0 var(--s-4); font-size: 14px; }
.btn--lg { height: 56px; padding: 0 var(--s-6); font-size: 16px; }
.btn--block { width: 100%; }

/* Text link with arrow */
.link { display: inline-block; font-weight: 500; color: var(--ink-900); border-bottom: 1px solid var(--ink-900); padding-bottom: 1px; transition: color var(--dur), border-color var(--dur); }
.link:hover { color: var(--accent); border-color: var(--accent); }
.section--inv .link { color: #fff; border-color: var(--inv-line); }
.section--inv .link:hover { border-color: #fff; }

/* Tags & chips ----------------------------------------------------- */
.tag { display: inline-flex; align-items: center; height: 28px; padding: 0 var(--s-3); border-radius: var(--r-pill); border: 1px solid var(--line-200); font: 500 13px/1 var(--f-body); color: var(--ink-700); background: var(--paper); }
.tag--solid { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
.tag--accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* Index number (asymmetric lists) ---------------------------------- */
.index { font: 500 14px/1.3 var(--f-body); color: var(--ink-300); font-variant-numeric: tabular-nums; }

/* Cards ------------------------------------------------------------ */
.card { background: var(--paper); border: 1px solid var(--line-200); border-radius: var(--r-lg); padding: var(--s-6); }
.card--tint { background: var(--surface-100); border-color: transparent; }
.card--inv { background: #1f1f1f; border-color: var(--inv-line); }
.card--hover { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.card--hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* Metric ----------------------------------------------------------- */
.metric { display: grid; gap: var(--s-2); }
.metric .t-num { font-size: clamp(32px, 3.2vw, 44px); }
.metric .t-small { color: var(--ink-500); max-width: 22ch; }
.metric-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); padding: var(--s-6) 0; border-top: 1px solid var(--line-200); border-bottom: 1px solid var(--line-200); }
.metric-row .metric { padding-left: var(--s-5); border-left: 1px solid var(--line-200); }
.metric-row .metric:first-child { padding-left: 0; border-left: 0; }
.section--inv .metric-row, .section--inv .metric-row .metric { border-color: var(--inv-line); }

/* Checklist -------------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.list li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.5; }
.list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 14px; height: 10px; border-left: 2px solid var(--ink-900); border-bottom: 2px solid var(--ink-900); transform: rotate(-45deg) scale(.8); }
.section--inv .list li::before { border-color: #fff; }

/* Definition rows (asymmetric, text-heavy) ------------------------- */
.rows { display: grid; }
.row, .price-row { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) 160px; gap: var(--s-7); align-items: start; padding: var(--s-6) 0; border-top: 1px solid var(--line-200); }
.row:last-child, .price-row:last-child { border-bottom: 1px solid var(--line-200); }
.row .t-h3, .price-row .t-h3 { margin-bottom: var(--s-1); }
.row .price, .price-row .price { font-family: var(--f-display); font-weight: 700; font-size: 20px; color: var(--ink-900); white-space: nowrap; text-align: right; }
.price-row .price { font-size: 24px; }

/* Forms ------------------------------------------------------------ */
.field { display: grid; gap: var(--s-2); }
.field > span { font: 500 13px/1 var(--f-body); color: var(--ink-500); }
.input, .select, .textarea {
  width: 100%; font: 400 15px/1.4 var(--f-body); color: var(--ink-900);
  background: var(--surface-100); border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 13px 14px; transition: border-color var(--dur), background var(--dur);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-200); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink-900); background: var(--paper); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23141414' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.textarea { resize: vertical; min-height: 96px; }

/* Segmented control ------------------------------------------------ */
.seg { display: inline-flex; padding: 4px; background: var(--surface-100); border-radius: var(--r-pill); gap: 2px; }
.seg button { height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-500); font-size: 14px; font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink-900); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* Accordion -------------------------------------------------------- */
.acc { border-top: 1px solid var(--line-200); }
.acc summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr 24px; gap: var(--s-4); align-items: baseline; padding: var(--s-5) 0; font-family: var(--f-body); font-weight: 600; font-size: 17px; color: var(--ink-900); }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .plus { position: relative; width: 24px; height: 24px; align-self: center; }
.acc summary .plus::before, .acc summary .plus::after { content: ""; position: absolute; background: var(--ink-900); left: 50%; top: 50%; transform: translate(-50%,-50%); transition: transform var(--dur) var(--ease); }
.acc summary .plus::before { width: 14px; height: 2px; }
.acc summary .plus::after { width: 2px; height: 14px; }
.acc[open] summary .plus::after { transform: translate(-50%,-50%) rotate(90deg); }
.acc .acc-body { padding: 0 0 var(--s-5); max-width: 64ch; color: var(--ink-700); }
.acc:last-of-type { border-bottom: 1px solid var(--line-200); }

/* Nav -------------------------------------------------------------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.86); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line-100); }
.nav-in { height: 72px; display: flex; align-items: center; gap: var(--s-6); }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; font: 700 17px/1 var(--f-display); letter-spacing: -0.02em; color: var(--ink-900); }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--ink-900); color: #fff; display: grid; place-items: center; font: 700 14px var(--f-display); }
.brand span em { font-style: normal; color: var(--ink-500); font-weight: 500; }
.nav-menu { display: flex; gap: var(--s-5); white-space: nowrap; margin-left: auto; font-size: 15px; font-weight: 500; color: var(--ink-700); }
.nav-menu a:hover { color: var(--ink-900); }
.nav-actions { display: flex; align-items: center; gap: var(--s-4); }
.burger { display: none; width: 44px; height: 44px; border: 1px solid var(--line-200); border-radius: var(--r-sm); background: none; position: relative; cursor: pointer; }
.burger span, .burger span::before, .burger span::after { content: ""; position: absolute; left: 12px; width: 18px; height: 2px; background: var(--ink-900); top: 21px; }
.burger span::before { top: -6px; left: 0; } .burger span::after { top: 6px; left: 0; }

/* Footer ----------------------------------------------------------- */
.footer { padding: var(--s-8) 0 var(--s-6); border-top: 1px solid var(--line-200); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-8); align-items: start; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); font-size: 15px; justify-content: flex-end; }
.footer-links a:hover, .footer p a:hover { color: var(--accent); }
.footer .t-meta { margin-bottom: var(--s-3); }
.footer-list { display: grid; gap: var(--s-2); font-size: 15px; }
.footer-bottom { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line-100); display: flex; justify-content: space-between; gap: var(--s-4); }

/* Utilities -------------------------------------------------------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mt-2 { margin-top: var(--s-2); } .mt-4 { margin-top: var(--s-4); } .mt-5 { margin-top: var(--s-5); } .mt-6 { margin-top: var(--s-6); } .mt-7 { margin-top: var(--s-7); } .mt-8 { margin-top: var(--s-8); }
.accent { color: var(--accent); }

/* Responsive ------------------------------------------------------- */
@media (max-width: 1024px) {
  .nav-in { gap: var(--s-4); }
  .nav-menu { gap: var(--s-4); font-size: 14px; }
  .nav-actions > a:first-child { display: none; }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s-6); }
  .metric-row .metric:nth-child(3) { padding-left: 0; border-left: 0; }
  .row, .price-row { grid-template-columns: 1fr; gap: var(--s-4); }
  .row .price, .price-row .price { text-align: left; }
  .footer-links { justify-content: flex-start; }
  .section-head { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .nav-menu, .nav-actions { display: none; }
  .burger { display: block; margin-left: auto; }
  .nav.open .nav-menu { display: grid; position: absolute; top: 72px; left: 0; right: 0; background: var(--paper); padding: var(--s-5) var(--gutter); gap: var(--s-4); border-bottom: 1px solid var(--line-200); font-size: 18px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}
