/* ============================================================
   AINITT Global — base.css
   Reset · typography · layout · grid · section rhythm
   Structural primitives for .btn / .card / .spec / .dark-section
   Visual variants live in components.css
   Load order: tokens.css → base.css → components.css
   ============================================================ */

/* ---------------- Reset ---------------- */
*,*::before,*::after{box-sizing:border-box}

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:var(--font);
  font-size:var(--fs-body);
  line-height:var(--lh-body);
  color:var(--ink);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  overflow-x:hidden;
}

img,svg,video{display:block;max-width:100%}
img{height:auto}
a{color:inherit;text-decoration:none}
p{margin:0}
ul,ol{margin:0;padding:0;list-style:none}
hr{margin:0;border:0;border-top:var(--border)}

button,input,select,textarea{font:inherit;color:inherit;margin:0}
button{background:none;border:0;padding:0;cursor:pointer}
input,textarea,select{max-width:100%}

/* ---------------- Accessibility ---------------- */
:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:3px;
  border-radius:2px;
}
.dark-section :focus-visible{outline-color:var(--on-dark-accent)}

.sr-only{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
  border:0;
}

.skip-link{
  position:absolute;
  left:16px;top:-64px;
  z-index:200;
  padding:10px 16px;
  background:var(--ink);
  color:#fff;
  font-size:.85rem;
  border-radius:var(--r-sm);
  transition:top .16s ease;
}
.skip-link:focus{top:12px}

/* ---------------- Typography ---------------- */
h1,h2,h3,h4,h5{
  margin:0;
  font-weight:600;
  letter-spacing:var(--ls-tight);
  line-height:var(--lh-h2);
}
h1{font-size:var(--fs-h1-page);line-height:var(--lh-h1)}
h2{font-size:var(--fs-h2);line-height:var(--lh-h2)}
h3{font-size:var(--fs-h3);line-height:var(--lh-h3);letter-spacing:-.01em}
h4{font-size:.94rem;line-height:var(--lh-h3);letter-spacing:0}
h5{font-size:.8rem;line-height:var(--lh-h3);letter-spacing:.04em}

.hero-title{
  font-size:var(--fs-h1-hero);
  line-height:var(--lh-h1-hero);
  max-width:820px;
}

.lead{font-size:var(--fs-body-2);line-height:var(--lh-body-2);color:var(--ink-2)}
.note{font-size:var(--fs-note);line-height:1.6;color:var(--ink-2)}

.eyebrow{
  display:inline-block;
  font-size:var(--fs-eyebrow);
  line-height:1;
  font-weight:600;
  letter-spacing:var(--ls-eyebrow);
  text-transform:uppercase;
  color:var(--ink-3);
}
.dark-section .eyebrow{color:var(--on-dark-accent)}

.txtlink{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:var(--accent);
  font-size:.9rem;
  font-weight:600;
  transition:gap .18s ease,color .18s ease;
}
.txtlink:hover{gap:10px;color:var(--accent-strong)}
.dark-section .txtlink{color:var(--on-dark-accent)}

/* ---------------- Layout ---------------- */
.wrap{
  width:100%;
  max-width:var(--max);
  margin:0 auto;
  padding:0 var(--pad-x);
}

.sec{padding:var(--sec-y) 0}
.sec--tight{padding:var(--sec-y-tight) 0}
.sec--sm{padding:var(--sec-y-sm) 0}
.sec--gray{
  background:var(--bg-2);
  border-top:var(--border);
  border-bottom:var(--border);
}
.sec--flush{padding-top:0}
.sec--flush-bottom{padding-bottom:0}

.sec-head{max-width:720px;margin-bottom:40px}
.sec-head > p{margin-top:12px;color:var(--ink-2);font-size:var(--fs-body);line-height:var(--lh-body-2)}
.sec-head--row{
  max-width:none;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:24px;
  flex-wrap:wrap;
}
.sec-head--row > div:first-child{max-width:720px}

/* ---------------- Grid ---------------- */
.grid{display:grid;gap:var(--card-gap)}
.grid > *{min-width:0}
.grid--2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid--3{grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--card-gap-lg)}
.grid--4{grid-template-columns:repeat(4,minmax(0,1fr))}
.grid--cols-2-1{grid-template-columns:1fr 1.15fr;gap:56px}

.stack{display:grid;gap:12px}
.actions{display:flex;gap:12px;flex-wrap:wrap}

/* ---------------- Primitive: button ---------------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:11px 20px;
  border:1px solid transparent;
  border-radius:var(--r-sm);
  font-size:var(--fs-btn);
  font-weight:600;
  line-height:1.2;
  text-align:center;
  white-space:nowrap;
  cursor:pointer;
  background:transparent;
  color:var(--ink);
  transition:background-color var(--ease),border-color var(--ease),color var(--ease),opacity var(--ease);
}

/* ---------------- Primitive: card ---------------- */
.card{
  display:flex;
  flex-direction:column;
  min-width:0;
  background:var(--bg);
  border:var(--border);
  border-radius:var(--r);
  overflow:hidden;
}

/* ---------------- Primitive: spec table ---------------- */
.spec{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:2px 14px;
  margin:0;
  font-size:.8rem;
}
.spec > div{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:10px;
  min-width:0;
  padding:6px 0;
  border-bottom:1px solid var(--bg-3);
}
.spec dt{color:var(--ink-3);margin:0}
.spec dd{
  margin:0;
  color:var(--ink);
  font-family:var(--mono);
  font-size:var(--fs-spec);
  font-weight:500;
  line-height:1.4;
  white-space:nowrap;
}

/* ---------------- Primitive: dark section ---------------- */
.dark-section{
  position:relative;
  isolation:isolate;
  background:var(--navy);
  color:var(--on-dark);
  overflow:hidden;
}
.dark-section__bg{
  position:absolute;
  inset:0;
  z-index:-2;
  width:100%;
  height:100%;
  max-width:none;
  object-fit:cover;
  object-position:center;
}
.dark-section__veil{
  position:absolute;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:var(--overlay-hero);
}
.dark-section__veil--side{background:var(--overlay-hero-side)}
.dark-section .wrap{position:relative}

/* ---------------- Page head (inner pages) ---------------- */
.page-head{
  padding:56px 0 40px;
  border-bottom:var(--border);
  background:var(--bg-2);
}
.page-head h1{margin-top:14px}
.page-head p{
  margin-top:16px;
  max-width:680px;
  color:var(--ink-2);
  font-size:var(--fs-body-2);
  line-height:var(--lh-body-2);
}

/* ---------------- Responsive skeleton ---------------- */
@media (max-width:1080px){
  :root{--sec-y:72px;--sec-y-tight:56px}
  .grid--4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid--3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid--cols-2-1{grid-template-columns:1fr;gap:36px}
}

@media (max-width:760px){
  :root{
    --pad-x:20px;
    --sec-y:56px;
    --sec-y-tight:44px;
    --sec-y-sm:44px;
  }
  body{line-height:1.65}
  .grid--2,
  .grid--3,
  .grid--4{grid-template-columns:minmax(0,1fr)}
  .sec-head{margin-bottom:28px}
  .sec-head--row{gap:16px}
  .actions .btn{flex:1 1 auto}
}

@media (max-width:460px){
  .hero-title{font-size:1.86rem}
  .spec{grid-template-columns:1fr}
  .actions{flex-direction:column}
  .actions .btn{width:100%;white-space:normal}
}
