/* Styles shared by the public case-study page and the gated artifacts page.
   Extracted from index.html so both pages load one copy. Linked AFTER
   tailwind.css so these rules win ties. */

/* Single source of truth for the style rules below. Keep these in sync
   with the tailwind.config colors above — Tailwind needs literals there. */
:root {
  --page:  #efe9df;
  --ink:   #35332d;
  --muted: #5f5c53;
  --faint: #68655b;
  --control: #848079;
}

::selection { background-color: var(--ink); color: var(--page); }

/* Stats are plain text now, so the expandable detail needs a quiet cue.
   Dotted underline on the label: invisible at rest, visible on hover. */
.metric-toggle .stat-label {
  display: inline-block;
  padding-bottom: 1px;
  border-bottom: 1px dotted transparent;
  transition: border-color 150ms ease;
}
.metric-toggle:hover .stat-label { border-bottom-color: var(--faint); }
.metric-toggle[aria-expanded="true"] .stat-label { border-bottom-color: var(--ink); }

/* Visible keyboard focus for every interactive element. Mouse clicks
   do not trigger :focus-visible, so this stays out of the way. */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Links that only resolve on Apple's internal network get a visible marker
   so an external reader knows before clicking. */
a[data-internal]::after {
  content: " Apple internal";
  display: inline-block;
  margin-left: .4em;
  padding: .1em .45em;
  border: 1px solid var(--control);
  border-radius: 3px;
  font-size: .62em;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  vertical-align: .12em;
  white-space: nowrap;
}

.artifact-tab.active {
  border-color: var(--ink);
  color: var(--ink);
  background-color: #fff;
  font-weight: 500;
}

.acc-head:hover .acc-icon { color: var(--ink); }
.acc-head[aria-expanded="true"] span:first-child { font-weight: 500; }

/* Method panels. Values are deliberately large: a short number under a
   multi-word label looks orphaned at body size. */
.stat-row { display: flex; flex-wrap: wrap; gap: 2rem 2.5rem; }
.stat-row > * { flex: 1 1 0; min-width: 7rem; }
.stat-value {
  display: block;
  font-size: clamp(34px, 3.4vw, 46px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.stat-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 17px;
  line-height: 1.3;
  color: var(--muted);
}
.step-num {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--control);
}

/* Reveal on scroll. Off entirely for anyone who has asked for less motion. */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
[data-reveal].visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

.nav-link { color: var(--muted); transition: color 150ms ease; }
.nav-link:hover { color: var(--ink); }
.nav-active {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

/* Projects dropdown */
.menu-item {
  display: block;
  padding: 0.4em 1.1em;
  font-size: 0.85em;
  color: var(--muted);
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}
.menu-item:hover { background-color: rgba(0, 0, 0, 0.04); color: var(--ink); }
[aria-expanded="true"] .menu-caret { transform: rotate(180deg); }
