/* =============================================================
   theme.css — Fooly-Cooly site-wide design tokens & overrides
   Load this AFTER Bootstrap in every page <head>
   ============================================================= */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ── Design Tokens ── */
:root {
  /* Brand palette */
  --fc-green:              #4ade80;
  --fc-green-dim:          #22c55e;
  --fc-green-deep:         #16a34a;
  --fc-green-glow:         rgba(74, 222, 128, 0.12);
  --fc-green-border:       rgba(74, 222, 128, 0.18);
  --fc-green-border-hover: rgba(74, 222, 128, 0.45);

  /* Backgrounds */
  --fc-bg:        #0d0f0e;
  --fc-surface:   #141714;
  --fc-surface-2: #1a1d1a;
  --fc-surface-3: #1f231f;

  /* Text */
  --fc-text:       #d4e8d4;
  --fc-text-muted: #6b7f6b;
  --fc-text-faint: #3d4d3d;

  /* Typography */
  --fc-font-mono: 'Share Tech Mono', monospace;
  --fc-font-sans: 'DM Sans', system-ui, sans-serif;

  /* Layout */
  --fc-container-max: 820px;
  --fc-radius-sm:     6px;
  --fc-radius-md:     8px;
  --fc-radius-lg:     12px;

  /* Transitions */
  --fc-transition: 0.2s ease;
}

/* ── Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--fc-bg);
  color: var(--fc-text);
  font-family: var(--fc-font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--fc-font-sans);
  font-weight: 500;
  color: var(--fc-text);
  line-height: 1.2;
}

.fc-mono  { font-family: var(--fc-font-mono); }
.fc-muted { color: var(--fc-text-muted); }

/* ── Links ── */
a {
  color: var(--fc-green-dim);
  text-decoration: none;
  transition: color var(--fc-transition);
}

a:hover {
  color: var(--fc-green);
}

/* ── Layout ── */
.fc-container {
  width: 100%;
  max-width: var(--fc-container-max);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ── Dividers ── */
.fc-rule {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--fc-green-dim), transparent);
  opacity: 0.5;
  margin: 0;
}

.fc-rule-solid {
  border: none;
  height: 1px;
  background: var(--fc-green-border);
  margin: 0;
}

/* ── Header (shared across all pages) ── */
.fc-header {
  padding: 48px 0 32px;
  text-align: center;
}

.fc-wordmark {
  font-family: var(--fc-font-mono);
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--fc-green);
  letter-spacing: 0.04em;
  line-height: 1;
}

.fc-wordmark-punct {
  color: var(--fc-text-muted);
  font-size: 0.5em;
}

.fc-tagline {
  font-family: var(--fc-font-mono);
  font-size: 0.78rem;
  color: var(--fc-text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 10px;
}

/* ── Back navigation (subpages) ── */
.fc-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--fc-font-mono);
  font-size: 0.78rem;
  color: var(--fc-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 32px;
  transition: color var(--fc-transition);
}

.fc-nav-back::before {
  content: '\2190'; /* ← */
}

.fc-nav-back:hover {
  color: var(--fc-green);
}

/* ── Section rows (accordion) ── */
.fc-section-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fc-section-row {
  border-bottom: 1px solid var(--fc-green-border);
}

.fc-section-row:first-child {
  border-top: 1px solid var(--fc-green-border);
}

.fc-section-trigger {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  cursor: pointer;
  user-select: none;
  width: 100%;
  background: none;
  border: none;
  color: inherit;
  text-align: left;
}

.fc-section-num {
  font-family: var(--fc-font-mono);
  font-size: 0.72rem;
  color: var(--fc-text-muted);
  min-width: 28px;
}

.fc-section-label {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--fc-text);
  transition: color var(--fc-transition);
  flex: 1;
}

.fc-section-trigger:hover .fc-section-label,
.fc-section-row.open .fc-section-label {
  color: var(--fc-green);
}

.fc-section-desc {
  font-size: 0.82rem;
  color: var(--fc-text-muted);
  font-family: var(--fc-font-mono);
}

.fc-section-chevron {
  width: 18px;
  height: 18px;
  color: var(--fc-green-dim);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.fc-section-row.open .fc-section-chevron {
  transform: rotate(90deg);
}

.fc-section-panel {
  display: none;
  padding: 0 0 28px 44px;
  animation: fc-slide-down 0.22s ease;
}

.fc-section-row.open .fc-section-panel {
  display: block;
}

@keyframes fc-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Project cards ── */
.fc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.fc-card {
  background: var(--fc-surface-2);
  border: 1px solid var(--fc-green-border);
  border-radius: var(--fc-radius-md);
  padding: 16px;
  cursor: pointer;
  transition:
    border-color var(--fc-transition),
    background   var(--fc-transition);
  text-decoration: none;
  color: inherit;
  display: block;
}

.fc-card:hover {
  border-color: var(--fc-green-dim);
  background: var(--fc-green-glow);
  color: inherit;
  text-decoration: none;
}

.fc-card-tag {
  font-family: var(--fc-font-mono);
  font-size: 0.68rem;
  color: var(--fc-green-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.fc-card-title {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--fc-text);
  margin-bottom: 4px;
}

.fc-card-sub {
  font-size: 0.78rem;
  color: var(--fc-text-muted);
  line-height: 1.4;
}

.fc-card--placeholder {
  border-style: dashed;
  opacity: 0.5;
  cursor: default;
}

.fc-card--placeholder:hover {
  border-color: var(--fc-green-border) !important;
  background: var(--fc-surface-2) !important;
}

/* View-all card — dashed border, arrow, used at end of preview grids */
.fc-card--view-all {
  border-style: dashed;
  border-color: var(--fc-green-border-hover);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
}

.fc-card--view-all .fc-card-title {
  color: var(--fc-green-dim);
}

.fc-card--view-all:hover {
  border-color: var(--fc-green);
  background: var(--fc-green-glow);
}

.fc-card--view-all:hover .fc-card-title {
  color: var(--fc-green);
}

/* ── Social links ── */
.fc-social-intro {
  font-size: 0.82rem;
  color: var(--fc-text-muted);
  font-family: var(--fc-font-mono);
  margin-bottom: 16px;
}

.fc-social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.fc-social-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--fc-surface-2);
  border: 1px solid var(--fc-green-border);
  border-radius: var(--fc-radius-sm);
  text-decoration: none;
  color: var(--fc-text);
  font-size: 0.85rem;
  transition:
    border-color var(--fc-transition),
    background   var(--fc-transition),
    color        var(--fc-transition);
}

.fc-social-link:hover {
  border-color: var(--fc-green-dim);
  background: var(--fc-green-glow);
  color: var(--fc-green);
  text-decoration: none;
}

.fc-social-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--fc-transition);
}

.fc-social-link:hover svg {
  opacity: 1;
}

.fc-social-link--highlight {
  border-color: var(--fc-green-border-hover);
  background: rgba(74, 222, 128, 0.06);
}

.fc-social-link--highlight:hover {
  border-color: var(--fc-green);
}

/* ── Social link tooltip (NSFW confirmation, wired by site.js) ── */
.fc-social-tooltip {
  position: fixed;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--fc-surface-2);
  border: 1px solid var(--fc-green-border-hover);
  border-radius: var(--fc-radius-sm);
  white-space: nowrap;
  font-family: var(--fc-font-mono);
  font-size: 0.78rem;
  pointer-events: auto;
}

.fc-social-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
}

/* Arrow points down when tooltip is above the anchor */
.fc-social-tooltip:not(.fc-social-tooltip--below)::after {
  top: 100%;
  border-top-color: var(--fc-green-border-hover);
}

/* Arrow points up when tooltip is below the anchor */
.fc-social-tooltip--below::after {
  bottom: 100%;
  border-bottom-color: var(--fc-green-border-hover);
}

.fc-social-tooltip-msg {
  color: var(--fc-text-muted);
}

.fc-social-tooltip-yes {
  background: var(--fc-green-glow);
  border: 1px solid var(--fc-green-border-hover);
  border-radius: var(--fc-radius-sm);
  color: var(--fc-green);
  font-family: var(--fc-font-mono);
  font-size: 0.78rem;
  padding: 2px 8px;
  cursor: pointer;
  transition: background var(--fc-transition), border-color var(--fc-transition);
}

.fc-social-tooltip-yes:hover {
  background: rgba(74, 222, 128, 0.22);
  border-color: var(--fc-green);
}

.fc-social-tooltip-no {
  background: none;
  border: none;
  color: var(--fc-text-muted);
  font-family: var(--fc-font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: color var(--fc-transition);
  padding: 2px 4px;
}

.fc-social-tooltip-no:hover {
  color: var(--fc-text);
}

/* ── Footer ── */
.fc-footer {
  padding: 32px 0 24px;
  text-align: center;
  border-top: 1px solid var(--fc-green-border);
  margin-top: 24px;
  font-family: var(--fc-font-mono);
  font-size: 0.72rem;
  color: var(--fc-text-muted);
  letter-spacing: 0.08em;
}

.fc-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--fc-green);
  vertical-align: text-bottom;
  animation: fc-blink 1.1s step-end infinite;
  margin-left: 2px;
}

@keyframes fc-blink {
  50% { opacity: 0; }
}

/* ── Page titles (subpages) ── */
.fc-page-title {
  font-family: var(--fc-font-mono);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--fc-green);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.fc-page-subtitle {
  font-family: var(--fc-font-mono);
  font-size: 0.78rem;
  color: var(--fc-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Prose (guides/markdown viewer) ── */
.fc-prose {
  color: var(--fc-text);
  line-height: 1.75;
  max-width: 68ch;
}

.fc-prose h1,
.fc-prose h2,
.fc-prose h3,
.fc-prose h4 {
  color: var(--fc-green);
  font-family: var(--fc-font-mono);
  margin-top: 2em;
  margin-bottom: 0.5em;
}

.fc-prose h1 { font-size: 1.5rem; }
.fc-prose h2 { font-size: 1.2rem; }
.fc-prose h3 { font-size: 1rem; }

.fc-prose p  { margin-bottom: 1em; }

.fc-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--fc-radius-md);
  display: block;
}

.fc-prose a {
  color: var(--fc-green-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fc-prose a:hover { color: var(--fc-green); }

.fc-prose code {
  font-family: var(--fc-font-mono);
  font-size: 0.88em;
  background: var(--fc-surface-2);
  border: 1px solid var(--fc-green-border);
  border-radius: var(--fc-radius-sm);
  padding: 0.15em 0.4em;
  color: var(--fc-green-dim);
}

.fc-prose pre {
  background: var(--fc-surface-2);
  border: 1px solid var(--fc-green-border);
  border-radius: var(--fc-radius-md);
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 1.25em;
}

.fc-prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--fc-text);
}

.fc-prose blockquote {
  border-left: 3px solid var(--fc-green-border-hover);
  margin-left: 0;
  padding-left: 16px;
  color: var(--fc-text-muted);
  font-style: italic;
}

.fc-prose ul,
.fc-prose ol {
  padding-left: 1.5em;
  margin-bottom: 1em;
}

.fc-prose li { margin-bottom: 0.25em; }

.fc-prose hr {
  border: none;
  height: 1px;
  background: var(--fc-green-border);
  margin: 2em 0;
}

.fc-prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25em;
  font-size: 0.9em;
}

.fc-prose th {
  font-family: var(--fc-font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fc-green-dim);
  border-bottom: 1px solid var(--fc-green-border-hover);
  padding: 8px 12px;
  text-align: left;
}

.fc-prose td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--fc-green-border);
}

.fc-prose tr:last-child td { border-bottom: none; }

/* ── Gallery ── */
.fc-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.fc-gallery-card {
  background: var(--fc-surface-2);
  border: 1px solid var(--fc-green-border);
  border-radius: var(--fc-radius-md);
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color var(--fc-transition),
    transform    var(--fc-transition);
  text-decoration: none;
  color: inherit;
  display: block;
}

.fc-gallery-card:hover {
  border-color: var(--fc-green-dim);
  transform: translateY(-2px);
  color: inherit;
  text-decoration: none;
}

.fc-gallery-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  filter: saturate(0.85);
  transition: filter var(--fc-transition);
}

.fc-gallery-card:hover img { filter: saturate(1); }

.fc-gallery-card-info { padding: 10px 12px 12px; }

.fc-gallery-card-cat {
  font-size: 0.68rem;
  font-family: var(--fc-font-mono);
  color: var(--fc-green-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.fc-gallery-card-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fc-text);
  margin-bottom: 2px;
}

.fc-gallery-card-desc {
  font-size: 0.75rem;
  color: var(--fc-text-muted);
  font-family: var(--fc-font-mono);
}

/* ── Utility button ── */
.btn-fc {
  background: transparent;
  border: 1px solid var(--fc-green-border-hover);
  color: var(--fc-green);
  font-family: var(--fc-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 6px 16px;
  border-radius: var(--fc-radius-sm);
  cursor: pointer;
  transition:
    background     var(--fc-transition),
    border-color   var(--fc-transition);
}

.btn-fc:hover {
  background: var(--fc-green-glow);
  border-color: var(--fc-green);
  color: var(--fc-green);
}

/* ── Misc utility ── */
.fc-label {
  font-family: var(--fc-font-mono);
  font-size: 0.72rem;
  color: var(--fc-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Responsive ── */
@media (max-width: 576px) {
  .fc-section-desc  { display: none; }
  .fc-section-panel { padding-left: 28px; }
  .fc-card-grid     { grid-template-columns: 1fr; }

  .fc-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ── Back to top (shared, wired by site.js) ── */
.fc-back-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--fc-surface-2);
  border: 1px solid var(--fc-green-border-hover);
  border-radius: var(--fc-radius-sm);
  color: var(--fc-green-dim);
  font-family: var(--fc-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity       var(--fc-transition),
    color         var(--fc-transition),
    border-color  var(--fc-transition);
  z-index: 50;
}

.fc-back-top.visible {
  opacity: 1;
  pointer-events: all;
}

.fc-back-top:hover {
  color: var(--fc-green);
  border-color: var(--fc-green);
}
