/* ===========================================================
   Coolaboola — Ru McGuinness portfolio
   Design tokens per design_handoff_coolaboola_portfolio/README.md
   =========================================================== */

:root {
  --accent: #F26B2E;
  --bg: #121110;
  --surface: #1a1917;
  --surface-alt: #1d1b19;
  --border: #262421;
  --border-strong: #3a3733;
  --text: #e9e6e1;
  --text-secondary: #b5b0a8;
  --text-muted: #8f8a83;
  --ghost: #37332f;
  --rail-width: 210px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Instrument Sans', sans-serif;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

img { max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: -9999px;
  top: 16px;
  z-index: 100;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 24px;
}
.skip-link:focus { left: 16px; }

@keyframes fadeup {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ---------- Rail nav (desktop) ---------- */
.rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail-width);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 64px 28px 36px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  z-index: 10;
}

.rail-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: .5px;
  margin-bottom: 36px;
}
.rail-logo .dot { color: var(--accent); }

.rail-link {
  font-size: 13px;
  letter-spacing: 1px;
  padding: 7px 0;
  color: var(--text-muted);
  transition: color .15s ease;
}
.rail-link:hover { color: var(--accent); }
.rail-link .num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--accent);
  margin-right: 10px;
  font-size: 11px;
}

.rail-social {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
}
.rail-social a { color: var(--text-muted); }
.rail-social a:hover { color: var(--accent); }

/* ---------- Mobile top bar ---------- */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 17, 16, .94);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.topbar-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 16px;
}
.topbar-logo .dot { color: var(--accent); }
.topbar-nav {
  display: flex;
  gap: 16px;
  font-size: 12px;
  letter-spacing: .5px;
}
.topbar-nav a { color: var(--text-muted); }
.topbar-nav a.active { color: var(--accent); }

/* ---------- Main / sections ---------- */
main { margin-left: var(--rail-width); }

.section { padding: 96px 64px; border-top: 1px solid var(--border); box-sizing: border-box; }

.eyebrow {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 600;
}

.bighead {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: clamp(48px, 5vw, 72px);
  margin: 0 0 8px;
  letter-spacing: -1px;
  color: var(--ghost);
}
.bighead .slash { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 48px;
  align-items: center;
  padding: 64px 64px 88px;
  border-top: none;
  animation: fadeup .7s ease both;
}
.hero-eyebrow { margin-bottom: 20px; }
.hero-h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: clamp(56px, 6.5vw, 92px);
  line-height: .98;
  margin: 0 0 28px;
  letter-spacing: -1px;
}
.hero-h1 .dot { color: var(--accent); }
.hero-intro {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 0 32px;
}
.button-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  padding: 0 26px;
  height: 46px;
  border-radius: 28px;
  line-height: 1;
  box-sizing: border-box;
}
.btn-filled {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  transition: opacity .15s ease;
}
.btn-filled:hover { opacity: .85; color: var(--bg); }
.btn-outline {
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  font-weight: 500;
  transition: border-color .15s ease, color .15s ease;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.hero-image-wrap {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 380px;
}
.hero-image-frame {
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
}
.hero-image {
  position: relative;
  display: block;
  width: 100%;
  border-radius: 4px;
  filter: grayscale(100%) contrast(1.05);
  background: var(--surface-alt);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 1100px;
  margin-top: 24px;
}
.about-lede { font-size: 22px; line-height: 1.5; margin: 0; font-weight: 500; }
.about-body { font-size: 16px; line-height: 1.7; color: var(--text-secondary); }
.about-body p { margin: 0 0 18px; }
.about-body p:last-child { margin-bottom: 0; }

/* ---------- Work / case studies ---------- */
.work-section { padding: 96px 0; }
.work-head { padding: 0 64px; }
.work-head-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 36px;
}
.scroll-hint { font-size: 13px; color: var(--text-muted); }

.case-scroller {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  margin: 0 64px;
  padding: 0 0 20px;
  scroll-snap-type: x mandatory;
}
.case-scroller::-webkit-scrollbar { height: 8px; }
.case-scroller::-webkit-scrollbar-track { background: var(--surface-alt); border-radius: 4px; }
.case-scroller::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.case-card {
  flex: none;
  width: 400px;
  max-width: 82vw;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease;
}
.case-card:hover { border-color: var(--accent); }
.case-cover {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  display: block;
  background: var(--surface-alt);
}
.case-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.case-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  margin: 0;
  line-height: 1.2;
  min-height: 48px;
}
.case-block { min-height: 90px; }
.case-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.case-label.result { color: var(--accent); }
.case-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.case-result {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.case-result .case-text { color: var(--text); font-weight: 500; }

/* ---------- How ---------- */
.how-body { max-width: 1100px; display: flex; flex-direction: column; gap: 24px; }
.how-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px;
}
.how-card p:first-child { font-size: 19px; line-height: 1.6; margin: 0 0 16px; font-weight: 500; }
.how-card p:last-child { font-size: 16px; line-height: 1.7; margin: 0; color: var(--text-secondary); }

.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.how-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px;
}
.how-panel h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 18px;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.skill-tag {
  border: 1.5px solid var(--border-strong);
  border-radius: 18px;
  padding: 7px 15px;
  font-size: 13px;
  color: var(--text-secondary);
}
.who-list { margin: 0; padding: 0 0 0 18px; font-size: 15px; line-height: 1.9; color: var(--text-secondary); }

/* ---------- Writing / Lab (card grids) ---------- */
.card-grid-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 36px;
  max-width: 1100px;
}
.card-grid-head a { font-size: 13px; color: var(--text-muted); }
.card-grid-head a:hover { color: var(--accent); }

.lab-intro { font-size: 15px; color: var(--text-muted); margin: 0 0 36px; max-width: 560px; }

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1100px;
}

.content-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px;
  color: var(--text);
  transition: border-color .15s ease;
}
.content-card:hover { border-color: var(--accent); color: var(--text); }
.content-cover {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  background: #242220;
}
.content-meta {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
  font-weight: 600;
}
.content-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 21px;
  line-height: 1.25;
}
.content-blurb {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.content-cta {
  margin-top: auto;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}
.lab-card .content-meta { margin-bottom: -2px; }

/* ---------- Talk / footer ---------- */
.talk-line {
  font-size: 20px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 28px;
}
.pill-row { display: flex; gap: 14px; flex-wrap: wrap; }
.pill {
  border: 1.5px solid var(--border-strong);
  border-radius: 24px;
  padding: 11px 22px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill-accent {
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.pill-accent:hover { background: var(--accent); color: var(--bg); }

.footer-bar {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .rail { display: none !important; }
  .topbar { display: flex !important; }
  main { margin-left: 0 !important; }

  .hero {
    grid-template-columns: 1fr !important;
    padding-top: 48px !important;
    padding-left: 24px;
    padding-right: 24px;
  }
  .hero-image-wrap { max-width: 320px; }
  .hero-h1 { font-size: clamp(44px, 11vw, 64px) !important; }
  .bighead { font-size: clamp(40px, 10vw, 56px) !important; }

  .about-grid, .how-grid, .card-grid { grid-template-columns: 1fr !important; }

  .section, .work-head { padding-left: 24px !important; padding-right: 24px !important; }
  .case-scroller { margin-left: 24px !important; margin-right: 24px !important; }

  .talk-line { font-size: clamp(20px, 5.5vw, 28px) !important; }
}
