/* =========================================================================
   COMPONENTS — every section is assembled from these. If a section needs a
   new visual treatment, it becomes a component here first.
   ========================================================================= */

/* ---- Mono label: years, indices, tags. The thing that makes it read
        "designed" rather than "themed". ------------------------------------ */
.mono {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 500;
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  color: var(--ink-meta);
  font-variant-numeric: tabular-nums;
}
.mono--accent { color: var(--accent-ink); }
:root:not([data-theme="light"]) .mono,
.plate-night .mono { font-weight: 600; }

/* ---- Section header ---------------------------------------------------- */
.sec-head {
  display: grid;
  gap: var(--s-4);
  margin-bottom: clamp(2.5rem, 1.5rem + 3vw, 5rem);
}
.sec-head__index {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.sec-head__index::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}
.sec-head__title {
  font-family: var(--font-display);
  font-size: var(--t-h2);
  font-weight: 500;
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-tight);
  max-width: 20ch;
}
.sec-head__deck {
  color: var(--ink-secondary);
  font-size: var(--t-lead);
  line-height: 1.45;
  max-width: 46ch;
}

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  --btn-bg: transparent;
  --btn-ink: var(--ink);
  --btn-border: var(--border);
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 44px;                 /* touch target */
  padding: var(--s-3) var(--s-5);
  background: var(--btn-bg);
  color: var(--btn-ink);
  border: 1px solid var(--btn-border);
  border-radius: var(--r-full);
  font-size: var(--t-small);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--d-micro) var(--e-soft),
              border-color var(--d-micro) var(--e-soft),
              color var(--d-micro) var(--e-soft),
              transform var(--d-micro) var(--e-out);
}
.btn:hover { --btn-border: var(--accent); --btn-ink: var(--accent-ink); }
.btn:active { transform: scale(0.98); }

.btn--primary {
  --btn-bg: var(--accent);
  --btn-ink: var(--on-accent);
  --btn-border: var(--accent);
  font-weight: 600;
}
.btn--primary:hover {
  --btn-bg: var(--ink);
  --btn-ink: var(--bg);
  --btn-border: var(--ink);
}

/* Icon inside a button optically centres 1px right of geometric centre. */
.btn__icon { width: 14px; height: 14px; transform: translateX(1px); }

/* ---- Pill / tag -------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 5px var(--s-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  color: var(--ink-meta);
  white-space: nowrap;
}
.pill--live {
  border-color: var(--accent-line);
  color: var(--accent-ink);
}
/* Status dot is static. A pulsing "available" dot is the single most
   over-used piece of portfolio motion and it never survives a second visit. */
.pill__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* ---- Metric ------------------------------------------------------------ */
.metric { display: grid; gap: var(--s-2); }
.metric__value {
  font-family: var(--font-display);
  font-size: var(--t-numeral);
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--tr-tight);
  font-variant-numeric: tabular-nums;
}
.metric__value .unit { color: var(--ink-meta); }
.metric__label {
  color: var(--ink-meta);
  font-size: var(--t-small);
  line-height: 1.35;
  max-width: 22ch;
}

/* Inline metric chips inside timeline entries */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-2);
  font-size: var(--t-small);
  color: var(--ink-secondary);
}
.chip b {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---- Card (shared by case studies + products) -------------------------- */
.card {
  position: relative;
  display: grid;
  gap: var(--s-4);
  padding: var(--s-6);
  background: var(--bg-card);
  /* The card edge is the only thing separating it from the page, so it uses
     the full border token, not the subtle one. */
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color var(--d-state) var(--e-soft),
              transform var(--d-state) var(--e-out),
              background-color var(--d-state) var(--e-soft);
}
a.card:hover, a.card:focus-visible {
  border-color: var(--accent-line);
  transform: translateY(-3px);
}
.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}
.card__title {
  font-family: var(--font-display);
  font-size: var(--t-h3);
  font-weight: 500;
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-tight);
}
.card__body { color: var(--ink-secondary); font-size: var(--t-small); line-height: 1.55; }
.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-2);
}

/* Planned case study: holds identical space, reads as deliberate. */
.card--planned {
  background: transparent;
  border-style: dashed;
  border-color: var(--border);
}
.card--planned .card__title { color: var(--ink); }

/* Arrow that slides on hover — 6px, once, no loop. */
.card__arrow {
  width: 18px; height: 18px;
  color: var(--ink-meta);
  transition: transform var(--d-state) var(--e-out),
              color var(--d-micro) var(--e-soft);
}
a.card:hover .card__arrow { transform: translate(4px, -4px); }

/* ---- Rule / divider ---------------------------------------------------- */
.rule { height: 1px; background: var(--border-subtle); border: 0; }

/* ---- Link with wipe underline ------------------------------------------ */
.link {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: background-size var(--d-micro) var(--e-out),
              color var(--d-micro) var(--e-soft);
}
.link:hover, .link:focus-visible { background-size: 100% 1px; color: var(--accent-ink); }

/* =========================================================================
   REVEAL — the one enter recipe used site-wide: opacity + 10px rise +
   4px blur, 620ms, --e-out, 70ms stagger. Elements are visible by default;
   .js class is added by the script only when IntersectionObserver exists,
   so a JS failure or reduced-motion never hides content.
   ========================================================================= */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(4px);
  transition: opacity var(--d-enter) var(--e-out),
              transform var(--d-enter) var(--e-out),
              filter var(--d-enter) var(--e-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: blur(0);
}
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; filter: none; }
}

/* ---- Motto -------------------------------------------------------------
   One line, at scale, closing the About section. No quote marks and no
   attribution — it is the writer's own, and the surrounding copy is the
   context that earns it. */
.motto {
  margin: clamp(var(--s-7), 6vw, var(--s-9)) 0 0;
  padding-top: clamp(var(--s-6), 4vw, var(--s-8));
  border-top: 1px solid var(--border-subtle);
}
.motto__line {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 0.9rem + 4vw, 4rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.04em;
  max-width: 22ch;
}
.motto__line em {
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink-secondary);
}
.motto__line .dot { color: var(--accent-ink); }

/* Theme toggle shows the destination, not the current state: the sun means
   "switch to light", the moon means "switch to dark". */
.icon-btn__moon { display: none; }
[data-theme="light"] .icon-btn__sun  { display: none; }
[data-theme="light"] .icon-btn__moon { display: block; }

/* The arrow takes the accent only when the card is actually being engaged. */
.card:hover .card__arrow,
.card:focus-visible .card__arrow { color: var(--accent-ink); }

/* ---- Case-card thumbnail ----------------------------------------------
   Six text-only cards read as a wall of prose. The screenshots were already
   one click away; this brings one of them to the surface. */
.card__thumb {
  margin: calc(var(--s-6) * -1) calc(var(--s-6) * -1) 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  transition: transform var(--d-enter) var(--e-out);
}
.card:hover .card__thumb img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) {
  .card:hover .card__thumb img { transform: none; }
}

.card__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3); flex-wrap: wrap;
}
.card__read { color: var(--ink-meta); white-space: nowrap; }
