/* Spitfire Cowboy — v0.2 (design polish) */

:root {
  --fire: #c45a2c;
  --fire-light: rgb(196 90 44 / 10%);
  --steel: #1c2836;
  --steel-soft: rgb(28 40 54 / 72%);
  --buckle: #d4a853;
  --buckle-light: rgb(212 168 83 / 12%);
  --parchment: #faf7f2;
  --dust: #8a8a8a;
  --olive: #4b5320;
  --ink: #0b1118;
  --paper: var(--parchment);
  --border: rgb(28 40 54 / 14%);
  --shadow: rgb(28 40 54 / 8%);

  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1060px;

  /* Spacing scale */
  --sp-xs: 8px;
  --sp-sm: 14px;
  --sp-md: 24px;
  --sp-lg: 40px;
  --sp-xl: 56px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

/* blueprint-ish background (subtle) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image:
    linear-gradient(to right, rgb(28 40 54 / 50%) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(28 40 54 / 50%) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* --- Links --- */
a {
  color: var(--fire);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Accessibility: clear focus */
:where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid rgb(196 90 44 / 55%);
  outline-offset: 3px;
  border-radius: 8px;
}

/* --- Layout --- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--sp-md);
}

/* --- Topbar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--steel);
  border-bottom: 1px solid rgb(255 255 255 / 8%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background:
    url('/assets/img/chubby-plane-nav.png') center / contain no-repeat;
  flex-shrink: 0;
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title strong {
  font-family: Bitter, Georgia, serif;
  font-size: 16px;
  letter-spacing: 0.2px;
  color: #fff;
}

.brand-title span {
  color: rgb(255 255 255 / 60%);
  font-size: 12px;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 14px;
}

.nav-links a {
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  color: rgb(255 255 255 / 78%);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-links a:hover {
  color: #fff;
  text-decoration: none;
  border-bottom-color: var(--fire);
}

/* --- Hero --- */
.hero {
  padding: var(--sp-xl) 0 var(--sp-md);
}

.kicker {
  font-family: "Black Ops One", system-ui, sans-serif;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--fire);
  margin-bottom: var(--sp-xs);
}

.hero h1 {
  font-family: Bitter, Georgia, serif;
  font-weight: 600;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.12;
  margin: 0 0 var(--sp-sm);
  color: var(--steel);
}

.hero-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

/* Workshop: inline comments */
.inline-comment {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--fire);
  border-radius: 12px;
  background: rgb(250 247 242 / 70%);
}

/* --- Carousel --- */
.carousel {
  position: relative;
  --carousel-frame-min-height: clamp(430px, 50vw, 500px);
  --carousel-media-height: clamp(220px, 30vw, 300px);
}

.carousel-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: var(--carousel-frame-min-height);
  border: 1px solid var(--border);
  background: rgb(255 255 255 / 85%);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px var(--shadow);
  overflow: hidden;
}

.carousel-slide {
  padding: var(--sp-md);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  animation: carouselFadeIn 0.35s ease-out;
}

@keyframes carouselFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.carousel-slide[hidden] {
  display: none;
}

.carousel-slide h2 {
  font-family: Bitter, Georgia, serif;
  font-size: clamp(22px, 3vw, 28px);
  margin: var(--sp-sm) 0 var(--sp-xs);
  color: var(--steel);
}

.carousel-slide p {
  margin: var(--sp-xs) 0;
}

.carousel-media {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgb(28 40 54 / 3%);
  min-height: var(--carousel-media-height);
  height: var(--carousel-media-height);
  margin-top: var(--sp-sm);
}

.carousel-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgb(17 26 35 / 8%) 0%, rgb(17 26 35 / 18%) 100%);
}

.carousel-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(0.95);
  display: block;
}

.hero-placeholder {
  min-height: 220px;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 18px;
  background:
    radial-gradient(1200px 420px at 20% 10%, rgb(212 168 83 / 25%), transparent 60%),
    radial-gradient(900px 360px at 80% 30%, rgb(196 90 44 / 22%), transparent 55%),
    linear-gradient(180deg, rgb(28 40 54 / 8%), rgb(28 40 54 / 3%));
}

.carousel-controls {
  position: absolute;
  top: var(--sp-sm);
  right: var(--sp-sm);
  display: flex;
  gap: var(--sp-xs);
  z-index: 2;
}

.carousel-btn {
  border: 1px solid rgb(255 255 255 / 25%);
  background: rgb(28 40 54 / 55%);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.carousel-btn:hover {
  background: rgb(28 40 54 / 80%);
  border-color: rgb(255 255 255 / 40%);
}

.carousel-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.carousel-dots {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding: var(--sp-sm) var(--sp-md) var(--sp-md);
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: rgb(28 40 54 / 12%);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.carousel-dot:hover {
  background: rgb(28 40 54 / 25%);
  transform: scale(1.15);
}

.carousel-dot[aria-current="true"] {
  background: var(--fire);
  border-color: var(--fire);
  transform: scale(1.15);
}

/* --- Motto tag --- */
.motto {
  display: inline-block;
  margin-top: var(--sp-sm);
  padding: var(--sp-xs) 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgb(255 255 255 / 60%);
  font-size: 14px;
}

/* --- Sub (intro text) --- */
.sub {
  font-size: 18px;
  line-height: 1.65;
  color: var(--steel-soft);
  max-width: 65ch;
  margin: 0;
}

/* --- Grid --- */
.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--sp-md);
}

/* --- Cards --- */
.card {
  border: 1px solid var(--border);
  background: rgb(255 255 255 / 85%);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
  box-shadow: 0 4px 20px rgb(28 40 54 / 12%);
}

.card .pad { padding: var(--sp-md); }

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  background: rgb(255 255 255 / 50%);
}

.badge .dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--fire);
  flex-shrink: 0;
}

/* --- List --- */
.list {
  margin: var(--sp-sm) 0 0;
  padding-left: 18px;
}
.list li + li {
  margin-top: 6px;
}

/* --- Sections --- */
.section {
  padding: var(--sp-lg) 0 var(--sp-md);
}

.section h2 {
  font-family: Bitter, Georgia, serif;
  margin: 0 0 var(--sp-xs);
  color: var(--steel);
}

.section > .small {
  margin-bottom: var(--sp-md);
}

/* --- Columns --- */
.columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-sm);
}

/* --- Pill (upgraded) --- */
.pill {
  border: 1px solid var(--border);
  border-left: 4px solid var(--fire);
  background: rgb(255 255 255 / 80%);
  border-radius: var(--radius);
  padding: var(--sp-sm) var(--sp-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pill:hover {
  border-left-color: var(--buckle);
  box-shadow: 0 2px 12px var(--shadow);
}

.pill strong {
  display: block;
  font-family: Bitter, Georgia, serif;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--steel);
}

/* --- Pattern cards (for patterns.html individual items) --- */
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-sm);
  margin-top: var(--sp-sm);
}

.pattern-card {
  border: 1px solid var(--border);
  background: rgb(255 255 255 / 85%);
  border-radius: var(--radius);
  padding: var(--sp-md);
  box-shadow: 0 2px 12px var(--shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.pattern-card:hover {
  box-shadow: 0 4px 20px rgb(28 40 54 / 12%);
}

.pattern-card h3 {
  font-family: Bitter, Georgia, serif;
  font-size: 16px;
  margin: 0 0 6px;
  color: var(--steel);
}

.pattern-card p {
  margin: 0;
  font-size: 14px;
  color: var(--steel-soft);
  line-height: 1.55;
}

/* Accent variants for pattern cards */
.pattern-card--fire {
  border-left: 4px solid var(--fire);
}

.pattern-card--buckle {
  border-left: 4px solid var(--buckle);
}

/* --- Anti-pattern cards (smell/damage/replace/guardrail) --- */
.antipattern-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--buckle);
  background: rgb(255 255 255 / 85%);
  border-radius: var(--radius);
  padding: var(--sp-md);
  box-shadow: 0 2px 12px var(--shadow);
  transition: box-shadow 0.2s;
}

.antipattern-card:hover {
  box-shadow: 0 4px 20px rgb(28 40 54 / 12%);
}

.antipattern-card h3 {
  font-family: Bitter, Georgia, serif;
  font-size: 16px;
  margin: 0 0 var(--sp-sm);
  color: var(--steel);
}

.antipattern-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px var(--sp-sm);
  font-size: 14px;
  line-height: 1.55;
}

.antipattern-label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--dust);
  padding-top: 2px;
}

.antipattern-value {
  color: var(--steel-soft);
}

/* Section failure-modes callout */
.failure-callout {
  margin-top: var(--sp-md);
  padding: var(--sp-sm) var(--sp-md);
  border: 1px solid var(--border);
  border-left: 4px solid var(--buckle);
  border-radius: var(--radius-sm);
  background: var(--buckle-light);
  font-size: 14px;
  color: var(--steel-soft);
}

.failure-callout strong {
  color: var(--steel);
}

/* --- Crew (unused but kept) --- */
.crew {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.crew .member {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 85%);
  padding: 14px;
}

.crew .member h3 {
  margin: 0 0 6px;
  font-family: Bitter, Georgia, serif;
}

/* --- Small / caption --- */
.small {
  color: var(--steel-soft);
  font-size: 13px;
}

/* --- CTA (upgraded) --- */
.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
}

.cta-card {
  border: 1px solid var(--border);
  border-left: 5px solid var(--fire);
  background:
    linear-gradient(135deg, rgb(196 90 44 / 4%) 0%, rgb(212 168 83 / 6%) 100%),
    rgb(255 255 255 / 90%);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgb(28 40 54 / 10%);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.cta-card:hover {
  box-shadow: 0 6px 32px rgb(28 40 54 / 14%);
}

/* --- Buttons --- */
.button {
  display: inline-block;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  border: none;
  background: var(--fire);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.button:hover {
  background: #a94b24;
  text-decoration: none;
  color: #fff;
  transform: translateY(-1px);
}
.button:active {
  transform: translateY(0);
}

/* Secondary button variant */
.button--secondary {
  background: var(--steel);
}
.button--secondary:hover {
  background: #14202e;
}

/* --- Footer (unified) --- */
.site-footer {
  background: var(--steel);
  margin-top: var(--sp-xl);
}
.site-footer .wrap {
  padding-top: 22px;
  padding-bottom: 22px;
}
.site-footer-inner {
  color: rgb(255 255 255 / 60%);
  font-size: 13px;
}
.site-footer-inner a {
  color: rgb(255 255 255 / 70%);
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer-inner a:hover {
  color: #fff;
  text-decoration: none;
}

/* Legacy .footer — removed; all pages now use .site-footer */

/* --- Code --- */
code, pre {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* --- Page accent kickers --- */
.page--patterns .kicker { color: var(--fire); }
.page--anti-patterns .kicker { color: var(--buckle); }
.page--projects .kicker { color: var(--fire); }
.page--workshop .kicker { color: var(--steel-soft); }

/* --- Responsive --- */
@media (width <= 880px) {
  .carousel {
    --carousel-frame-min-height: 470px;
    --carousel-media-height: 260px;
  }
  .grid { grid-template-columns: 1fr; }
  .columns { grid-template-columns: 1fr; }
  .crew { grid-template-columns: 1fr; }
  .pattern-grid { grid-template-columns: 1fr; }
}

@media (width <= 720px) {
  .carousel {
    --carousel-frame-min-height: 420px;
    --carousel-media-height: 220px;
  }
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .nav-links {
    gap: 2px;
  }
  .cta {
    flex-direction: column;
    text-align: center;
  }
  .pill {
    border-radius: var(--radius);
  }
  .antipattern-meta {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .antipattern-label {
    margin-top: var(--sp-xs);
  }
}
