/* ================================================================
   PORTFOLIO HUB — styles.css
   Design Skill OS applied: §3 Typography, §4 Color, §5.2 Grid,
   §6.5 Brand voice, §9 Web/Digital, §10.4 Icons, §14 Motion
   ================================================================ */

/* ── Brand voice (§6.5) ─────────────────────────────────────────
   Brand:   Daily Sites
   Tone:    Focused, disciplined, honest. No filler. No excuses.
   Voice:   Direct. Verbs over nouns. Tight copy.
   Palette: Warm craft — parchment, terracotta, deep teal.
   ─────────────────────────────────────────────────────────────── */

/* ── Design tokens ───────────────────────────────────────────── */
:root {
  /* Type scale — golden ratio (×1.618) with legibility floor */
  --text-xs:      max(0.8125rem, 0.618rem);  /* 13px floor  */
  --text-sm:      max(0.9375rem, 0.764rem);  /* 15px floor  */
  --text-base:    1rem;                       /* 16px        */
  --text-md:      1.236rem;                  /* ~20px       */
  --text-lg:      1.618rem;                  /* ~26px       */
  --text-xl:      2.058rem;                  /* ~33px       */
  --text-2xl:     2.618rem;                  /* ~42px       */
  --text-3xl:     4.236rem;                  /* ~68px       */

  /* Line heights */
  --leading-tight:  1.1;
  --leading-snug:   1.25;
  --leading-normal: 1.5;
  --leading-loose:  1.75;

  /* Fibonacci spacing — base 8px */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 104px;
  --space-7: 144px;

  /* Motion tokens (§14.1) */
  --duration-fast:   150ms;
  --duration-base:   250ms;
  --duration-slow:   400ms;
  --ease-default:    cubic-bezier(.4, 0, .2, 1);
  --ease-bounce:     cubic-bezier(.34, 1.56, .64, 1);
  --transition-fast: var(--duration-fast) var(--ease-default);
  --transition-base: var(--duration-base) var(--ease-default);

  /* Palette */
  --bg:            #f4ede0;
  --bg-deep:       #ebe1cf;
  --surface:       rgba(255, 251, 244, 0.82);
  --surface-solid: #fffaf3;
  --ink:           #1d1c1a;
  --ink-muted:     #625c52;
  --accent:        #ba4a2f;
  --accent-2:      #0f5d66;
  --accent-bg:     rgba(186, 74, 47, 0.08);
  --border:        rgba(29, 28, 26, 0.12);
  --shadow-sm:     0 2px 8px rgba(28, 23, 15, 0.08);
  --shadow:        0 8px 32px rgba(28, 23, 15, 0.12);
  --shadow-lg:     0 20px 64px rgba(28, 23, 15, 0.16);

  /* Radii */
  --radius-sm: 8px;
  --radius:    16px;
  --radius-lg: 24px;
  --radius-xl: 34px;

  /* Layout */
  --max-w: 1200px;

  /* Fonts */
  --font-body: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --font-head: "Syne", "Helvetica Neue", Arial, sans-serif;

  /* Icon tokens (§10.4) */
  --icon-sm:     16px;
  --icon-md:     20px;
  --icon-lg:     24px;
  --icon-xl:     32px;
  --icon-stroke: 1.75;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, rgba(186, 74, 47, 0.18), transparent 22%),
    radial-gradient(circle at 85% 10%, rgba(15, 93, 102, 0.15), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  min-height: 100svh;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

/* ── Skip nav (§9.5) ────────────────────────────────────────── */
.skip-nav {
  position: absolute;
  top: -100%;
  left: var(--space-2);
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  z-index: 9999;
  transition: top var(--transition-fast);
}
.skip-nav:focus { top: var(--space-2); }

/* ── Focus styles (§9.7) ────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* ── Background noise texture ───────────────────────────────── */
.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.055;
  background-image:
    linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* ── Page shell ─────────────────────────────────────────────── */
.page-wrap {
  position: relative;
  z-index: 1;
  width: min(calc(100% - var(--space-3)), var(--max-w));
  margin: 0 auto;
  padding-bottom: var(--space-5);
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: var(--space-2);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 16px var(--space-3);
  margin-top: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.brand {
  font-family: var(--font-head);
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.topnav {
  display: flex;
  gap: 4px;
}

.topnav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.topnav a:hover {
  color: var(--ink);
  background: var(--accent-bg);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  display: block;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

/* ── Main layout ────────────────────────────────────────────── */
main {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

/* ── Shared glass-card surface ──────────────────────────────── */
.hero,
.projects-section,
.system-section {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

/* ── Eyebrow label ──────────────────────────────────────────── */
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 6px;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.75fr;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  align-items: end;
  min-height: 54vh;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: var(--space-2);
}

.hero h1 {
  font-size: clamp(var(--text-xl), 6vw, var(--text-3xl));
  line-height: var(--leading-tight);
  margin: 6px 0 var(--space-3);
  max-width: 12ch;
}

/* §3.6 Type as image */
.hero-accent {
  font-style: italic;
  color: var(--accent);
  display: block;
}

.lede {
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  color: var(--ink-muted);
  max-width: 52ch;
  margin-bottom: var(--space-3);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-3);
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform var(--transition-base),
    background var(--transition-base),
    box-shadow var(--transition-base);
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.97); box-shadow: none; }

.btn-dark { background: #1d1c1a; color: #fffaf0; }
.btn-dark:hover { background: #12110f; }

.btn-light {
  background: rgba(255,255,255,.5);
  border-color: var(--border);
  color: var(--ink);
}
.btn-light:hover { background: rgba(255,255,255,.75); }

.btn-accent { background: #ba4a2f; color: #1a120d; font-weight: 700; }
.btn-accent:hover { background: #ce5b3f; color: #120b08; }

/* ── Hero rules panel ───────────────────────────────────────── */
.hero-panel {
  align-self: end;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255,250,240,.9) 0%, rgba(255,250,240,.98) 100%),
    linear-gradient(135deg, rgba(186,74,47,.18), rgba(15,93,102,.12));
  border: 1px solid var(--border);
}

.panel-title {
  font-family: var(--font-head);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
}

.rules-list {
  list-style: none;
  display: grid;
  gap: var(--space-1);
  counter-reset: rules;
}

.rules-list li {
  counter-increment: rules;
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--ink-muted);
}

.rules-list li::before {
  content: counter(rules, decimal-leading-zero);
  font-family: var(--font-head);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Stats row ──────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-2);
}

.stat-value {
  font-family: var(--font-head);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  margin: var(--space-1) 0 6px;
}

.stat-copy {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  line-height: var(--leading-normal);
  max-width: 28ch;
}

/* ── Section structure ──────────────────────────────────────── */
.projects-section,
.system-section {
  border-radius: var(--radius-xl);
  padding: var(--space-4);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.section-head h2 {
  font-size: clamp(var(--text-lg), 3.2vw, var(--text-2xl));
  line-height: var(--leading-snug);
  margin-top: 6px;
}

/* ── Filter buttons ─────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.filter-btn {
  min-height: 44px;
  padding: 0 var(--space-2);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.5);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.filter-btn:hover {
  background: rgba(255,255,255,.75);
  color: var(--ink);
  transform: translateY(-1px);
}
.filter-btn:active { transform: translateY(0); }
.filter-btn.is-active {
  background: #1d1c1a;
  color: #fffaf0;
  border-color: transparent;
}

/* ── Project grid ───────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.proj-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.proj-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.proj-card--planned { opacity: 0.72; }

.proj-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
}

.proj-day {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.proj-status {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.proj-status.is-complete { background: rgba(15,93,102,.1);  color: var(--accent-2); }
.proj-status.is-planned  { background: rgba(186,74,47,.1);  color: var(--accent); }
.proj-status.is-wip      { background: rgba(186,74,47,.15); color: var(--accent); }

.proj-title {
  font-size: var(--text-md);
  line-height: var(--leading-snug);
}

.proj-summary {
  font-size: var(--text-base);
  color: var(--ink-muted);
  line-height: var(--leading-normal);
  max-width: 52ch;
  flex: 1;
}

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.65);
  border: 1px solid var(--border);
  color: var(--ink-muted);
}

.proj-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: auto;
  padding-top: 4px;
}

.proj-link {
  font-size: var(--text-xs);
  font-weight: 600;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.proj-link:hover { background: var(--ink); color: #fffaf0; }
.proj-link--pending { opacity: 0.45; cursor: default; }

/* ── System section ─────────────────────────────────────────── */
.system-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.system-card {
  padding: var(--space-3);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.system-icon {
  font-size: var(--text-lg);
  color: var(--accent);
  margin-bottom: var(--space-2);
  display: block;
}

.system-card h3 {
  font-size: var(--text-md);
  margin-bottom: var(--space-1);
}

.system-card p {
  font-size: var(--text-base);
  color: var(--ink-muted);
  line-height: var(--leading-normal);
  max-width: 38ch;
}

/* ── CTA section ────────────────────────────────────────────── */
.cta-section {
  background: #1d1c1a; /* hardcoded — var(--ink) flips in dark mode */
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.cta-section .eyebrow { color: rgba(255,255,255,.5); }

.cta-section h2 {
  font-size: clamp(var(--text-lg), 3.2vw, var(--text-2xl));
  line-height: var(--leading-snug);
  color: #fffaf0;
  margin-top: 6px;
  max-width: 28ch;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  padding: var(--space-4) 0 var(--space-3);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.footer-brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--text-sm);
}

.footer-copy {
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: auto; gap: var(--space-3); }
  .hero-panel { max-width: 480px; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .system-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-section { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .page-wrap { width: calc(100% - var(--space-2)); }
  .topbar { padding: 14px var(--space-2); }
  .topnav {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    flex-direction: column;
    padding: var(--space-2);
    gap: 4px;
    box-shadow: var(--shadow);
    z-index: 30;
  }
  .topnav.is-open { display: flex; }
  .topnav a { padding: 10px var(--space-2); width: 100%; }
  .nav-toggle { display: inline-flex; }
  .stats-row { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .system-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .cta-section { padding: var(--space-4) var(--space-3); }
}

/* ── Dark mode (§9.3 / §14.3) ───────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #131210;
    --bg-deep:       #0e0d0b;
    --surface:       rgba(28, 26, 22, 0.85);
    --surface-solid: #1e1c19;
    --ink:           #f0e8d8;
    --ink-muted:     #8a8278;
    --accent:        #d45a38;
    --accent-2:      #22909f;
    --accent-bg:     rgba(212, 90, 56, 0.12);
    --border:        rgba(240, 232, 216, 0.1);
    --shadow-sm:     0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow:        0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg:     0 20px 64px rgba(0, 0, 0, 0.55);
  }

  body {
    background:
      radial-gradient(circle at 15% 20%, rgba(212, 90, 56, 0.1), transparent 22%),
      radial-gradient(circle at 85% 10%, rgba(26, 128, 144, 0.08), transparent 24%),
      linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  }

  .topbar { background: rgba(19, 18, 16, 0.92); }

  .btn-light {
    background: rgba(255,255,255,.08);
    border-color: var(--border);
  }
  .btn-light:hover { background: rgba(255,255,255,.14); }

  .btn-dark {
    background: #f0e8d8;
    color: #14110f;
  }
  .btn-dark:hover {
    background: #fff4e3;
  }

  .btn-accent {
    background: #d45a38;
    color: #1a120d;
  }
  .btn-accent:hover {
    background: #e36b4a;
    color: #120b08;
  }

  .tag { background: rgba(255,255,255,.06); }

  .proj-link { background: rgba(255,255,255,.06); }
  .proj-link:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

  .filter-btn {
    background: rgba(255,255,255,.08);
    color: #f0e8d8;
    border-color: rgba(255,255,255,.24);
  }
  .filter-btn:hover {
    background: rgba(255,255,255,.16);
    color: #fff4e3;
  }
  .filter-btn.is-active {
    background: #f0e8d8;
    color: #14110f;
    border-color: transparent;
  }

  .hero-panel {
    background:
      linear-gradient(160deg, rgba(30,28,24,.9) 0%, rgba(30,28,24,.98) 100%),
      linear-gradient(135deg, rgba(212,90,56,.15), rgba(26,128,144,.1));
  }
}

/* ── Reduced motion (§9.7) ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
