/* Palette — see CLAUDE.md. Defined once here so every rule uses the same values. */
:root {
  --bg: #0f1117;
  --text: #e6e6e6;
  --muted: #9aa0ab;
  --border: #2e3440;
  --hover-fill: #1c2130;
  --hover-border: #4c566a;
  --accent: #cc6a1f; /* medium dark orange, used sparingly for contrast */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--text);
  /* A faint orange glow at the top and a subtle dot grid, layered over the base color. */
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(204, 106, 31, 0.12), transparent 70%),
    radial-gradient(var(--border) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg);
  /* Column layout so the footer sits at the bottom even on short pages. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* Keyboard focus ring — shows up when tabbing, not when clicking. */
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.accent {
  color: var(--accent);
}

/* Scroll progress bar */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  /* script.js sets scaleX from 0 to 1. Scaling is smoother than changing width. */
  transform: scaleX(0);
  transform-origin: left;
  z-index: 20;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease, padding 0.25s ease;
}

/* Once you've scrolled, the header gets a frosted background so text behind it stays out of the way. */
.site-header.is-scrolled {
  padding: 0.85rem 2rem;
  background: rgba(15, 17, 23, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom-color: var(--border);
}

.wordmark {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.wordmark:hover {
  color: var(--muted);
}

/* Main */

main {
  /* Grows to fill leftover space, pushing the footer down. */
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.showcase {
  margin-bottom: 4.5rem;
}

/* Small numbered label above each section heading. */
.eyebrow {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

.showcase h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

/* Short orange line under each heading; it draws itself in when the section is revealed. */
.showcase h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin-top: 0.5rem;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s ease 0.2s;
}

.showcase.is-visible h2::after,
html:not(.js) .showcase h2::after {
  transform: scaleX(1);
}

.section-note {
  color: var(--muted);
  margin: 0.75rem 0 1.5rem;
}

.card-grid {
  display: grid;
  /* Cards are at least 260px wide and wrap on their own — no media queries needed. */
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 17, 23, 0.6);
  transition: background 0.15s ease, border-color 0.15s ease;
}

/* Orange line along the card's top edge that grows on hover. */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.card:hover {
  background: var(--hover-fill);
  border-color: var(--hover-border);
}

.card:hover::before,
.card:focus-within::before {
  transform: scaleX(1);
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--muted);
  font-size: 0.925rem;
  line-height: 1.5;
}

.card a {
  display: inline-block;
  margin-top: 0.85rem;
  color: var(--text);
  font-size: 0.925rem;
  text-decoration: none;
  border-bottom: 1px solid var(--hover-border);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.card a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.card a:hover .arrow {
  transform: translateX(4px);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
}

.social-links ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.social-links a {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.925rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.social-links a:hover {
  background: var(--hover-fill);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Scroll reveal
   Only hide things when JS is running (the "js" class is added by script.js),
   so the page never ends up blank if the script doesn't load. */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease var(--delay, 0ms),
    transform 0.6s ease var(--delay, 0ms),
    background 0.15s ease,
    border-color 0.15s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Phones */

@media (max-width: 600px) {
  .site-header,
  .site-header.is-scrolled,
  main,
  .site-footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .showcase {
    margin-bottom: 3.5rem;
  }

  /* Phones have no hover, so give a tap some feedback instead. */
  .card:active {
    background: var(--hover-fill);
    border-color: var(--hover-border);
  }

  .card:active::before {
    transform: scaleX(1);
  }
}

/* If someone has asked their OS for less motion, turn the animations off. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
