/* Advance Tech Inc. — Base styles
   Resets, typography defaults, schematic utilities.
   Loaded after tokens.css; before any page-specific styles. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; tab-size: 4; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--red); color: var(--paper); }

/* Typography helpers */
.font-display { font-family: var(--font-display); font-variation-settings: "opsz" 96; letter-spacing: -0.025em; }
.font-body    { font-family: var(--font-body); }
.font-mono    { font-family: var(--font-mono); }

.mono-label {
  font-family: var(--font-mono);
  font-size: var(--t-eyebrow);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Layout */
.wrap {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
@media (min-width: 1024px) {
  .wrap { padding-inline: var(--pad-x-lg); }
}

/* Schematic corner brackets — apply to a relative-positioned element */
.schematic {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--ink);
}
.schematic > .corner {
  position: absolute; width: 14px; height: 14px;
  border-color: var(--ink); border-style: solid; border-width: 0;
}
.corner.tl { top: -1px; left:  -1px; border-top-width: 2px; border-left-width:  2px; }
.corner.tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.corner.bl { bottom: -1px; left:  -1px; border-bottom-width: 2px; border-left-width:  2px; }
.corner.br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

/* Image — technical treatment with gradient + slight desaturation */
.image-spec { position: relative; overflow: hidden; }
.image-spec > img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.94) contrast(1.04); }
.image-spec::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, transparent 60%, rgba(11,11,10,0.32) 100%),
    radial-gradient(circle at 50% 50%, transparent 60%, rgba(11,11,10,0.12) 100%);
}

/* Dimension callouts on images */
.dim {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  position: absolute;
  display: inline-flex; align-items: center; gap: 4px;
  z-index: 2;
}
.dim::before { content: ""; width: 14px; height: 1px; background: currentColor; display: inline-block; }
.dim.on-image { color: var(--paper); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 500;
  border-radius: var(--r-2);
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-out),
              color      var(--dur-fast) var(--ease-out),
              transform  var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--red); border-color: var(--red); }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost { color: var(--ink); border-color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-ghost.on-dark { color: var(--paper); border-color: var(--paper); }
.btn-ghost.on-dark:hover { background: var(--paper); color: var(--ink); }

.btn-alert { background: var(--red); color: var(--paper); border-color: var(--red); }
.btn-alert:hover { background: var(--ink); border-color: var(--ink); }

.btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Nav link */
.nav-link {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: var(--r-2);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.nav-link:hover { background: var(--ink); color: var(--paper); }
.nav-link[aria-current="page"] { background: var(--red); color: var(--paper); }
.nav-link:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Card */
.card { background: var(--paper); border: 1px solid var(--ink); }
.card-dark { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }

/* Spec row */
.spec-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--grid);
  align-items: baseline;
}
.spec-row:last-child { border-bottom: 0; }

/* Status dot (pulsing) */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  animation: pulse 1.6s ease-in-out infinite;
}

/* Reveal on load */
@keyframes appear { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.appear   { animation: appear 700ms var(--ease-out) both; }
.d-1      { animation-delay: 60ms;  }
.d-2      { animation-delay: 160ms; }
.d-3      { animation-delay: 260ms; }
.d-4      { animation-delay: 360ms; }
.d-5      { animation-delay: 460ms; }

/* Subtle hover lift for cards */
.lift { transition: transform var(--dur-med) var(--ease-out), border-color var(--dur-med); }
.lift:hover { transform: translateY(-2px); border-color: var(--red); }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper); padding: 12px 16px;
  font-family: var(--font-mono); font-size: var(--t-mono);
}
.skip-link:focus { left: 16px; top: 16px; z-index: 100; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
