/* ==========================================================================
   www.ggordongordon.com — landing page
   Dark, single-look by design (all three linked apps are dark). Each project
   card sets its own --accent / --accent-rgb inline; everything inside the card
   — mark, chips, hover glow, CTA — reads from those, so the three cards carry
   their own product palettes without any extra rules.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #0f1115;
  --bg-deep: #0a0c0f;
  --panel: #161920;
  --panel-hi: #1b1f28;
  --border: #262b36;
  --border-hi: #333a48;
  --text: #e4e7ee;
  --text-dim: #b6bcc9;
  --muted: #8f96a6;
  --accent: #d9a441;
  --accent-rgb: 217, 164, 65;
  --ok: #55a97a;

  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1120px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* A single soft brass bloom behind the hero. Fixed so it doesn't travel with
   the scroll and read as a moving blob. */
body::before {
  content: '';
  position: fixed;
  inset: -20vh 0 auto 0;
  height: 90vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(var(--accent-rgb), 0.10), transparent 70%),
    radial-gradient(40% 40% at 12% 8%, rgba(91, 141, 217, 0.07), transparent 70%);
}

main, .site-head, .site-foot { position: relative; z-index: 1; }

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 16px;
  background: var(--panel-hi);
  border: 1px solid var(--border-hi);
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 50;
}
.skip:focus { left: 0; }

:where(a, button):focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.85);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- header --------------------------------------------------------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 17, 21, 0.78);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 15.5px;
  white-space: nowrap;
}

.wordmark-mark { color: var(--accent); flex: none; }

.head-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14.5px;
}

.head-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}
.head-nav a:hover { color: var(--text); }

/* Nav and the support link share the header's right side, so .head-inner keeps
   two children and its space-between still puts the wordmark hard left. */
.head-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

/* Deliberately not styled as a nav link: it is an outbound support action, not
   a destination. A quiet accent pill separates it from Projects/About without
   competing with them. */
.coffee {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.coffee:hover {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: rgba(var(--accent-rgb), 0.6);
}

.coffee-cup { font-size: 14px; line-height: 1; }

@media (max-width: 560px) {
  .head-nav { gap: 18px; font-size: 14px; }
  .head-right { gap: 16px; }
  /* Drops to the cup alone so the header still fits a phone. The anchor carries
     aria-label="Buy me a coffee", so what a screen reader announces is
     unchanged — the label is hidden visually, not removed. */
  .coffee-text { display: none; }
  .coffee { padding: 6px 11px; }
}

/* Below roughly 383px the wordmark, the nav and the pill together are wider
   than the viewport — measured at 42px of overflow at 320px and 2px at 360px.
   The mark alone still links home and still identifies the site, and the name
   is the <h1> immediately below, so the word is what gives way. */
@media (max-width: 400px) {
  .wordmark span { display: none; }
}

/* --- hero ----------------------------------------------------------------- */

.hero { padding: 96px 0 72px; }

.eyebrow {
  margin: 0 0 22px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(42px, 7.5vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.hero-sub {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-size: clamp(21px, 3vw, 27px);
  line-height: 1.3;
  color: var(--text-dim);
  font-style: italic;
  letter-spacing: -0.01em;
}

.lede {
  margin: 28px 0 0;
  max-width: 58ch;
  font-size: 17.5px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 38px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease),
              border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: #1a1204;
}
.btn-primary:hover { background: #e8b555; transform: translateY(-1px); }

.btn-ghost {
  border-color: var(--border-hi);
  color: var(--text-dim);
}
.btn-ghost:hover {
  border-color: rgba(var(--accent-rgb), 0.55);
  color: var(--text);
  transform: translateY(-1px);
}

/* --- sections ------------------------------------------------------------- */

.section { padding: 76px 0; }

.section-alt {
  background: linear-gradient(180deg, transparent, rgba(10, 12, 15, 0.6) 12%, rgba(10, 12, 15, 0.6) 88%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head { margin-bottom: 40px; }

.section-head h2 {
  position: relative;
  margin: 0;
  padding-top: 20px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-head h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 38px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.section-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15.5px;
}

/* --- project cards -------------------------------------------------------- */

.grid {
  display: grid;
  /* min() keeps the track from forcing 310px on a narrower screen — a bare
     minmax(310px, …) overflows the viewport horizontally at 320px. */
  grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr));
  gap: 20px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 26px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(165deg, var(--panel-hi), var(--panel) 55%);
  overflow: hidden;
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease),
              box-shadow 0.22s var(--ease);
}

/* Accent hairline along the card's top edge, brightening on hover. */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(var(--accent-rgb), 0.9),
    rgba(var(--accent-rgb), 0.15) 55%,
    transparent);
  opacity: 0.6;
  transition: opacity 0.22s var(--ease);
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow:
    0 18px 40px -22px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(var(--accent-rgb), 0.08),
    0 0 60px -30px rgba(var(--accent-rgb), 0.7);
}

.card:hover::before,
.card:focus-within::before { opacity: 1; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 13px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.11);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hi);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(85, 169, 122, 0.16);
}

.card-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 23px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.card-tagline {
  margin: 8px 0 0;
  font-size: 14.5px;
  font-weight: 600;
  color: rgba(var(--accent-rgb), 0.92);
}

.card-body {
  margin: 14px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
}

.card-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 24px;
}

/* The CTA covers the whole card, so clicking anywhere opens the app. */
.cta {
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  color: rgba(var(--accent-rgb), 1);
  padding: 4px 0;
}
.cta::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.cta:hover { text-decoration: underline; text-underline-offset: 3px; }

.arrow {
  display: inline-block;
  transition: transform 0.2s var(--ease);
}
.card:hover .arrow { transform: translateX(3px); }

/* --- colophon ------------------------------------------------------------- */

.colophon {
  display: grid;
  /* Explicit counts rather than auto-fit, so the row always divides evenly by
     the number of items. Three across, then straight to one — an intermediate
     two-column step would leave the third item alone on its own row. */
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 40px;
}

@media (max-width: 860px) {
  .colophon { grid-template-columns: 1fr; gap: 26px; }
}

.col-item h3 {
  margin: 0 0 8px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.col-item p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}

/* --- about ---------------------------------------------------------------- */

.prose {
  margin: 0 0 18px;
  max-width: 68ch;
  font-size: 17px;
  color: var(--text-dim);
}

/* --- footer --------------------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
  padding: 28px 0;
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.foot-copy {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 14px;
}

.foot-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}
.foot-nav a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 640px) {
  .hero { padding: 64px 0 52px; }
  .section { padding: 60px 0; }
  .wrap { padding: 0 20px; }
  .card { padding: 22px 20px 20px; }
  .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover, .card:focus-within, .btn:hover { transform: none; }
}
