/* =================================================
   Andy Dixon — styles.css
   Dark, warm overhaul
   ================================================= */

:root {
  --bg:          #0d0c09;
  --bg-mid:      #131109;
  --panel:       #1c1915;
  --panel-alt:   #232018;
  --panel-hover: #2c2820;

  --text:        #d4ccb2;
  --text-soft:   #706654;
  --text-muted:  #454036;
  --charcoal:    #ede6d0;

  --accent:      #c98c42;
  --accent-lt:   #e0a85c;
  --accent-soft: rgba(201, 140, 66, 0.13);
  --accent-glow: rgba(201, 140, 66, 0.26);

  --line:        rgba(255, 205, 130, 0.09);
  --line-mid:    rgba(255, 205, 130, 0.16);

  --shadow:      0 24px 64px rgba(0, 0, 0, 0.6);
  --shadow-sm:   0 8px 28px  rgba(0, 0, 0, 0.4);

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --content-width: 1200px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  font-family: "Manrope", sans-serif;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255, 200, 100, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 200, 100, .028) 1px, transparent 1px),
    radial-gradient(ellipse 90% 55% at 14% 0%,   rgba(210, 148, 55, .16), transparent),
    radial-gradient(ellipse 60% 45% at 86% 100%,  rgba(180,  90, 35, .09), transparent);
  background-size: 64px 64px, 64px 64px, 100% 100%, 100% 100%;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---- Page shell ---- */
.page-shell {
  width: min(calc(100% - 2rem), var(--content-width));
  margin: 0 auto;
  padding: 1rem 0 5rem;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 1rem;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  padding: 0.8rem 0.9rem;
  background: rgba(18, 16, 11, 0.85);
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  backdrop-filter: blur(22px);
  box-shadow: 0 4px 28px rgba(0,0,0,.55), 0 0 0 1px rgba(255,200,100,.04);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #8c5a1c);
  color: #0d0c09;
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0.1em;
  box-shadow: 0 2px 14px var(--accent-glow);
  flex-shrink: 0;
}

.brand-text { display: grid; }
.brand-text strong { font-size: 0.94rem; color: var(--charcoal); line-height: 1.3; }
.brand-text span   { color: var(--text-soft); font-size: 0.78rem; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
}

.site-nav a {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 140ms, background 140ms;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-lt);
  outline: none;
}

/* ---- Panel ---- */
.panel {
  background: linear-gradient(155deg, var(--panel) 0%, var(--panel-alt) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ---- Hero ---- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.85fr);
  gap: 1.75rem;
  padding: clamp(1.6rem, 3.5vw, 3rem);
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #1e1b13 0%, #16140e 65%, #1b1810 100%);
  border-color: var(--line-mid);
  box-shadow: var(--shadow), 0 0 70px rgba(201,140,66,.1);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 85% at 78% 42%, rgba(201,140,66,.1), transparent),
    radial-gradient(ellipse 45% 45% at 18% 78%, rgba(180, 80, 28,.07), transparent);
  pointer-events: none;
  animation: hero-breathe 10s ease-in-out infinite alternate;
}

@keyframes hero-breathe {
  from { opacity: .55; }
  to   { opacity: 1;   }
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-copy h1 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(2.8rem, 6.5vw, 6.4rem);
  font-family: "Fraunces", serif;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.033em;
  color: var(--charcoal);
}

.hero-text {
  max-width: 56ch;
  margin: 1.5rem 0 0;
  font-size: 1.07rem;
  color: var(--text-soft);
  line-height: 1.72;
}

.hero-text-secondary { margin-top: 0.9rem; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2.2rem;
}

/* ---- Buttons ---- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.72rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), #8c5218);
  color: #0e0c08;
  box-shadow: 0 4px 20px var(--accent-glow), 0 1px 0 rgba(255,220,130,.22) inset;
}

.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow), 0 1px 0 rgba(255,220,130,.22) inset;
}

.button-secondary {
  border-color: var(--line-mid);
  color: var(--text);
  background: rgba(255,255,255,.04);
}

.button-secondary:hover {
  background: rgba(201,140,66,.1);
  border-color: rgba(201,140,66,.32);
  color: var(--accent-lt);
  transform: translateY(-2px);
}

/* ---- Hero stats ---- */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 2.2rem 0 0;
}

.hero-stats div {
  padding: 1rem 1.1rem;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: border-color 200ms, background 200ms;
}

.hero-stats div:hover {
  border-color: rgba(201,140,66,.22);
  background: rgba(201,140,66,.05);
}

.hero-stats dt {
  margin: 0 0 0.3rem;
  color: var(--text-muted);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
}

.hero-stats dd {
  margin: 0;
  color: var(--charcoal);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
}

/* ---- Hero aside ---- */
.hero-aside {
  display: grid;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.hero-service { align-items: start; }

.portrait-card {
  overflow: hidden;
  margin: 0;
  border-radius: calc(var(--radius-lg) - 6px);
  background: linear-gradient(180deg, #252018, #1a1812);
  border: 1px solid var(--line-mid);
}

.portrait-card img {
  width: 100%;
  height: 100%;
  min-height: 26rem;
  object-fit: cover;
  object-position: center top;
  filter: sepia(0.1) contrast(1.06) brightness(0.97);
}

.note-card {
  padding: 1.15rem 1.25rem;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.note-card p { margin: 0; color: var(--text-soft); }

.note-label {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* ---- Eyebrow ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  display: block;
  width: 1.75rem;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

/* ---- Section spacing ---- */
.content-grid,
.section-stack,
.split-section,
.contact-section {
  margin-top: 2rem;
}

/* ---- Content grid (About) ---- */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr);
  gap: 1.5rem;
}

/* ---- Section headings ---- */
.section-heading {
  padding: 1rem 1rem 0.5rem;
}

.section-heading h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--charcoal);
  font-size: clamp(2rem, 3.8vw, 3.6rem);
  max-width: 16ch;
}

/* ---- Prose ---- */
.prose {
  padding: 1.8rem 2rem;
}

.prose p,
.prose ul {
  margin: 0;
  color: var(--text-soft);
}

.prose p + p,
.prose p + ul {
  margin-top: 1.1rem;
}

/* ---- Tech badges ---- */
.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.7rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.tech-badges span {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(201, 140, 66, 0.2);
  color: var(--accent-lt);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* ---- Project cards ---- */
.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  counter-reset: projects;
}

.project-card {
  position: relative;
  overflow: hidden;
  padding: 1.75rem 1.9rem 1.5rem;
  counter-increment: projects;
  transition: transform 210ms ease, border-color 210ms ease, box-shadow 210ms ease;
  display: flex;
  flex-direction: column;
}

.project-card::before {
  content: '0' counter(projects);
  position: absolute;
  top: -0.8rem;
  right: 0.6rem;
  font-size: 7rem;
  font-family: "Fraunces", serif;
  font-weight: 600;
  color: rgba(255, 210, 140, 0.05);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  transition: color 210ms;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(201, 140, 66, 0.36);
  box-shadow: var(--shadow), 0 0 36px rgba(201, 140, 66, 0.12);
  outline: none;
}

.project-card:hover::before {
  color: rgba(201, 140, 66, 0.12);
}

.project-kicker {
  display: inline-block;
  margin-bottom: 0.85rem;
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.project-card h3,
.mini-card h3,
.service-card h3,
.feature-card h3,
.stack-card h2 {
  margin: 0;
  color: var(--charcoal);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
}

.project-card p,
.mini-card p,
.service-card p,
.feature-card p,
.stack-card p,
.contact-grid p,
.link-list,
.mini-card a,
.contact-card a {
  color: var(--text-soft);
}

.project-card p,
.mini-card p,
.service-card p,
.feature-card p,
.stack-card p {
  margin: 0.7rem 0 0;
  line-height: 1.62;
}

.card-arrow {
  display: inline-block;
  margin-top: auto;
  padding-top: 1.4rem;
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: color 200ms, transform 200ms;
  line-height: 1;
}

.project-card:hover .card-arrow {
  color: var(--accent);
  transform: translateX(5px);
}

/* ---- Experiment grid ---- */
.experiment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.mini-card {
  padding: 1.6rem 1.7rem;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  display: flex;
  flex-direction: column;
}

.mini-card:hover,
.mini-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(201, 140, 66, 0.3);
  box-shadow: var(--shadow), 0 0 24px rgba(201, 140, 66, 0.08);
}

.mini-card a {
  display: inline-block;
  margin-top: auto;
  padding-top: 1.1rem;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.88rem;
  transition: color 140ms, gap 140ms;
}

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

/* ---- Service / feature grids (for other pages) ---- */
.project-list,
.experiment-grid,
.service-grid,
.feature-grid {
  display: grid;
  gap: 1rem;
}

.service-grid,
.feature-grid {
  margin-top: 1rem;
}

.project-list  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.experiment-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.service-grid  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature-grid  { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.service-card,
.feature-card,
.stack-card,
.intro-panel {
  padding: 1.5rem 1.6rem;
}

.intro-panel { margin-top: 1rem; }

.feature-card-wide { grid-column: span 2; }

.detail-list {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-soft);
}

.detail-list li + li { margin-top: 0.55rem; }

/* ---- Link list (open source) ---- */
.link-list {
  padding-left: 1.1rem;
  color: var(--text-soft);
}

.link-list li + li { margin-top: 0.65rem; }

.link-list a {
  color: var(--accent);
  font-weight: 700;
  transition: color 140ms;
}

.link-list a:hover { color: var(--accent-lt); }

/* ---- Contact + apps spotlight sections ---- */
.contact-section {
  padding: 2rem 2.2rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.note-card,
.contact-card {
  padding: 1.2rem 1.4rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.contact-card {
  display: grid;
  gap: 0.75rem;
}

.contact-card > a {
  color: var(--charcoal);
  font-size: 1.05rem;
  font-weight: 700;
  transition: color 140ms;
}

.contact-card > a:hover { color: var(--accent-lt); }

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  padding-top: 0.35rem;
}

.social-row a {
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 140ms;
}

.social-row a:hover { color: var(--accent-lt); }

/* ---- Footer ---- */
.site-footer {
  margin-top: 3.5rem;
  padding: 2rem 0 1.5rem;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-inner p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.83rem;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--text-muted);
  font-size: 0.83rem;
  font-weight: 600;
  transition: color 140ms;
}

.footer-nav a:hover { color: var(--accent); }

/* ---- Scroll reveal ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

[data-reveal="d1"] { transition-delay: 0.06s; }
[data-reveal="d2"] { transition-delay: 0.13s; }
[data-reveal="d3"] { transition-delay: 0.20s; }
[data-reveal="d4"] { transition-delay: 0.27s; }

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .site-header,
  .hero,
  .content-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    border-radius: 22px;
    align-items: flex-start;
  }

  .site-nav { justify-content: flex-start; }

  .project-list,
  .service-grid,
  .feature-grid,
  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .experiment-grid { grid-template-columns: repeat(2, 1fr); }

  .feature-card-wide { grid-column: auto; }

  .section-heading h2 { max-width: none; }
  .hero-copy h1       { max-width: none; }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--content-width));
    padding-top: 0.5rem;
  }

  .site-header,
  .hero,
  .section-heading,
  .prose,
  .project-card,
  .mini-card,
  .contact-section {
    padding: 1.2rem;
  }

  .project-list,
  .experiment-grid,
  .service-grid,
  .feature-grid,
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .brand-text span { display: none; }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-nav   { justify-content: center; }
}

/* ================================================
   Fuel tracker table (keep intact)
   ================================================ */
.fuel-hero  { align-items: start; }
.fuel-stats { margin-top: 1.4rem; }

.fuel-table-panel {
  margin-top: 1.75rem;
  overflow: hidden;
}

.fuel-table-wrap {
  padding: 0 1.6rem 1.6rem;
  overflow-x: auto;
}

.fuel-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.fuel-table th,
.fuel-table td {
  padding: 1rem;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.fuel-table th {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.fuel-table tbody tr:hover {
  background: rgba(255,255,255,.03);
}

.fuel-meta {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-soft);
  font-size: 0.85rem;
}

.change-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
}

.change-up   { background: rgba(170, 55, 42, .15); color: #c25040; }
.change-down { background: rgba(48, 126, 68,  .15); color: #4aaa6a; }
.change-flat { background: rgba(255,205,130,   .07); color: var(--text-soft); }

.fuel-message {
  margin: 0 1.6rem 1.6rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.04);
  color: var(--charcoal);
}

.fuel-message-error {
  color: #c25040;
  background: rgba(170, 55, 42, .12);
}

@media (max-width: 640px) {
  .fuel-table-wrap { padding: 0 1.1rem 1.1rem; }
}
