/* components.css — nav, buttons, cards, the interpunct motif. Depends on variables.css, base.css. */

/* The interpunct divider — the brand mark, reused as a functional UI element (not just a logo) */
.interpunct {
  color: var(--color-accent);
  font-weight: 700;
}
.interpunct-divider {
  display: inline-block;
  margin-inline: var(--space-2);
  color: var(--color-accent);
}
.interpunct-rule {
  border: none;
  border-top: var(--border-hairline);
  position: relative;
  margin-block: var(--space-6);
}
.interpunct-rule::after {
  content: "·";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-bg);
  color: var(--color-accent);
  font-size: var(--step-2);
  padding-inline: var(--space-2);
}

/* Site header / nav — styled like the solid CTA button: solid emerald bar,
   light text (same background/foreground pairing as .btn--solid) instead of
   a translucent bar over the page background. */
.site-header {
  border-bottom: 1px solid var(--color-accent-strong);
  position: sticky;
  top: 0;
  background: var(--color-accent);
  z-index: 10;
  min-height: var(--header-h);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
}
.brand {
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--color-bg);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand .interpunct { font-size: 1.2em; color: var(--color-bg); }
.brand__sub {
  font-size: 0.55em;
  vertical-align: 2px;
  color: color-mix(in srgb, var(--color-bg) 75%, transparent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* Below this width the full lockup ("Interpunct · Technology Services" plus
   nav) no longer fits one row — drop the subtitle rather than let the brand
   wrap and change the header's height (which the hero's fill-the-screen
   calc below relies on being constant). */
@media (max-width: 30rem) {
  .brand__sub { display: none; }
}
.nav-links {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--step--1);
}
.nav-links a { color: color-mix(in srgb, var(--color-bg) 80%, transparent); }
.nav-links a:hover { color: var(--color-bg); }

/* Buttons */
.btn {
  display: inline-block;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  padding: 0.7em 1.4em;
  border-radius: var(--radius);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.btn:hover, .btn:focus-visible {
  background: var(--color-accent);
  color: var(--color-bg);
  text-decoration: none;
}
.btn--solid {
  background: var(--color-accent);
  color: var(--color-bg);
}
.btn--solid:hover { background: var(--color-accent-strong); }

/* Cards (services grid) */
.card {
  background: var(--color-surface);
  border: var(--border-hairline);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.card__label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: var(--space-2);
}
.card__achievements {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0 0;
  font-size: var(--step--1);
  color: var(--color-text-muted);
}
.card__achievements li {
  padding-left: 1.1em;
  position: relative;
  margin-bottom: var(--space-2);
}
.card__achievements li::before {
  content: "·";
  color: var(--color-accent);
  position: absolute;
  left: 0;
  font-weight: 700;
}

/* Footer */
.site-footer {
  padding-block: var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}
.site-footer a { color: var(--color-text-muted); }
.site-footer a:hover { color: var(--color-accent); }

/* Hero typed-loop line. The static text inside #typeline-text (see index.html)
   is the no-JS fallback and must always be a complete, readable sentence on
   its own — main.js clears and re-drives it only if it actually runs. */
/* Hero fills exactly one screen (viewport minus the fixed-height header) and
   centers its content, regardless of screen size or orientation — 100svh
   (falls back to 100vh) tracks the actual visible viewport on mobile instead
   of jumping when browser chrome shows/hides. */
.hero {
  position: relative;
  overflow: hidden; /* safety clip if a heading ever can't be shrunk to fit (see main.js) */
  /* Cancel the generic .section padding-block — vertical spacing here is
     fully owned by .hero .wrap's own (scalable) padding below, since the
     section as a whole now has to fit exactly one screen. */
  padding-block: 0;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero .wrap {
  width: 100%;
  padding-block: calc(var(--space-6) * var(--hero-scale, 1));
  text-align: center;
}
/* --hero-scale is 1 (i.e. normal size) until main.js measures the actual
   header height and available viewport space on this device and dials it
   down — only as far as needed — so the heading, typeline and CTA always
   fit one screen without guessing at breakpoints. No-JS fallback: normal
   full size, same as the rest of the page. */
/* The heading has its own scale variable, separate from --hero-scale below:
   it has to shrink much further on narrow screens to stay on one line than
   the vertical rhythm (padding/typeline) ever needs to for short screens —
   sharing one variable between both made the typeline shrink to the point
   of illegibility on narrow-but-tall phones. See main.js. */
.hero h1 {
  font-size: calc(var(--step-4) * var(--hero-h1-scale, 1));
  line-height: 1.1;
  text-transform: uppercase;
}
/* Forced to a single line only once main.js is confirmed running (it's the
   one measuring the shrink needed to make that true) — the no-JS fallback
   below lets it wrap normally rather than risk clipped/overflowing text. */
.hero.is-fitted h1 {
  white-space: nowrap;
}
.hero .typeline {
  font-size: calc(var(--step-1) * var(--hero-scale, 1));
  margin-top: calc(var(--space-3) * var(--hero-scale, 1));
}
/* CTA docks to the hero's bottom-right corner at a fixed inset, independent
   of heading/typeline length, screen size, or orientation. */
.hero__cta {
  position: absolute;
  right: var(--space-4);
  bottom: var(--space-4);
}
.typeline {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  letter-spacing: 0.02em;
  color: var(--color-accent);
  margin: var(--space-3) 0 0;
}
.typeline .cursor {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  margin-left: 2px;
  vertical-align: -0.1em;
  background: var(--color-accent);
}
/* Blink only once JS has actually taken over the line (class added in main.js) —
   a static page with JS disabled/failed never shows a blinking cursor next to
   text that isn't going anywhere. */
.typeline .cursor.is-active {
  animation: typeline-blink 1s step-end infinite;
}
@keyframes typeline-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .typeline .cursor.is-active { animation: none; }
}

/* Current-page nav indicator (aria-current="page", set per-file in the
   header — see index.html/about.html/contact.html HEADER comments).
   Predictable "you are here" signal, low-cost accessibility/UX addition. */
.nav-links a[aria-current="page"] {
  color: var(--color-bg);
  font-weight: 700;
}
