/* ==========================================================================
   Eric Zassenhaus — Portfolio
   Design system: "Editorial Bold"
   Mobile-first. Base styles target narrow viewports; enhanced at 700px / 1000px.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg:        #0d0e12;
  --surface:   #16181f;
  --border:    #262a35;
  --icon-bg:   #1f2330;
  --text:      #f2f2f2;
  --muted:     #aaaaaa;
  --muted-2:   #999999;
  --accent:    #ff5a3c;
  --accent-hi: #ff6d53;
  --accent-ink:#0d0e12;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --maxw: 1080px;
  --gap: 20px;
  --radius: 12px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; margin: 0; }
p { margin: 0 0 1.1em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--border); }

.kicker {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.section-title { font-size: clamp(26px, 6.5vw, 38px); margin: 0 0 12px; }
.subtitle { color: var(--muted); max-width: 62ch; margin: 0 0 30px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hi); text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.textlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  color: var(--accent);
}
.textlink:hover { text-decoration: underline; }

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.utilitybar {
  font-size: 12.5px;
  color: var(--muted-2);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.utilitybar .wrap {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.utilitybar a { color: var(--muted-2); }
.utilitybar a:hover { color: var(--accent); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13,14,18,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--icon-bg);
  border: 1px solid var(--border);
  flex: none;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; display: block; }

.nav-links { display: none; list-style: none; margin: 0; padding: 0; }
.nav-links li { margin: 0; }
.nav-links a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 6px;
  color: var(--text);
  font-weight: 500;
  font-size: 15.5px;
}
.nav-links a:not(.btn):hover { color: var(--accent); text-decoration: none; }
.nav-links a.active { color: var(--accent); }

/* Mobile: expanded menu (toggled by JS) */
.nav-links.open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 0 16px;
  width: 100%;
}
.nav-links.open .btn { margin-top: 8px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero .wrap {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding-top: 48px;
  padding-bottom: 48px;
}
.hero-title {
  font-size: clamp(30px, 8.5vw, 54px);
  font-weight: 900;
  line-height: 1.06;
  margin: 12px 0 20px;
}
.hero-body { color: var(--muted); font-size: 18px; max-width: 54ch; margin: 0 0 26px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

.hero-photo {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

.photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2);
  font-size: 14px;
  text-align: center;
  padding: 16px;
}

/* ==========================================================================
   Cards grid
   ========================================================================== */
.grid { display: grid; grid-template-columns: 1fr; gap: var(--gap); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .15s ease, transform .12s ease;
}
a.card { color: inherit; display: block; }
a.card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }

.card h3 { font-size: 21px; margin: 0 0 8px; }
.card p { color: var(--muted); margin: 0; font-size: 15.5px; }

/* Capability card icon box */
.cap-icon {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-bg);
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  margin-bottom: 16px;
}
.cap-icon svg { width: 20px; height: 20px; display: block; }

/* Case study card (homepage) — coral left border accent */
.work-card { border-left: 3px solid var(--accent); }
.work-card h3 { font-size: 20px; }
.work-card .card-summary { color: var(--muted); font-size: 15px; margin-top: 8px; }
.work-card .more { color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 14px; display: inline-block; }

/* Screenshot offset treatment — HOMEPAGE work cards only */
.thumb-offset { position: relative; padding: 6px; margin-bottom: 16px; width: 100%; aspect-ratio: 16 / 9; }
.thumb-offset::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-radius: 10px;
  transform: rotate(-2deg);
  z-index: 0;
  opacity: 0.85;
}
.thumb-offset .thumb-inner {
  position: relative;
  z-index: 1;
  background: #f4f4f4;
  border-radius: 8px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.thumb-offset .thumb-inner img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top;
  filter: sepia(0.85) saturate(0.7) brightness(0.92) contrast(1.02);
  transition: filter .25s ease;
}
/* Full color returns on card hover */
.work-card:hover .thumb-offset .thumb-inner img { filter: none; }
.thumb-placeholder { color: #888; font-size: 13px; font-weight: 500; }

/* Plain work cards (work index) */
.work-index-card { border-left: 3px solid var(--accent); }

/* ==========================================================================
   Philosophy teaser
   ========================================================================== */
.philosophy .lede {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(21px, 4.6vw, 30px);
  line-height: 1.3;
  margin: 0 0 22px;
  max-width: 24ch;
}
.philosophy .lede.wide { max-width: none; }
.philosophy p.support { color: var(--muted); max-width: 60ch; }

/* ==========================================================================
   Testimonials
   ========================================================================== */
.quotes { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
.quote {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
}
.quote p { font-size: 16px; color: var(--text); margin: 0 0 14px; }
.quote cite { font-style: normal; color: var(--muted); font-size: 14px; font-weight: 600; }

/* ==========================================================================
   Bottom CTA banner
   ========================================================================== */
.cta-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 28px;
  text-align: center;
}
.cta-banner h2 { font-size: clamp(24px, 6vw, 34px); margin: 0 0 12px; }
.cta-banner p { color: var(--muted); max-width: 50ch; margin: 0 auto 22px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  color: var(--muted);
  font-size: 14.5px;
}
.site-footer .foot-line { margin: 0 0 8px; }
.site-footer .foot-links a { color: var(--muted); }
.site-footer .foot-links a:hover { color: var(--accent); }
.site-footer .sep { color: var(--border); margin: 0 8px; }

/* ==========================================================================
   Content pages (About, Case studies)
   ========================================================================== */
.page-head { padding-top: 48px; padding-bottom: 8px; }
.page-title { font-size: clamp(30px, 8vw, 48px); font-weight: 900; margin: 8px 0 14px; }
.meta-line { color: var(--muted); font-size: 14.5px; margin: 0; }
.meta-line strong { color: var(--text); font-weight: 600; }

.prose { max-width: 68ch; }
.prose h2 { font-size: clamp(22px, 5vw, 30px); margin: 42px 0 14px; padding-top: 6px; }
.prose h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
  margin: 26px 0 8px;
}
.prose p { color: #d8d8d8; }
.prose ul { color: #d8d8d8; padding-left: 1.2em; margin: 0 0 1.1em; }
.prose ul li { margin-bottom: 8px; }

.about-photo {
  width: 120px; height: 120px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  margin: 0 0 20px;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }

/* Case study screenshot — plain, full size (NO offset) */
.cs-shot {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  margin: 24px 0;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cs-shot img { width: 100%; height: auto; }
.cs-shot.has-img { aspect-ratio: auto; display: block; margin: 0; }
.cs-figure { margin: 24px 0; }
.cs-figure figcaption { color: var(--muted-2); font-size: 13px; margin-top: 8px; }

/* Small multi-image gallery within a case study */
.cs-gallery { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 24px 0 8px; align-items: start; }
.cs-gallery figure { margin: 0; }
.cs-gallery img {
  width: 100%; height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}
.cs-gallery figcaption { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin-top: 8px; }
.cs-gallery-note { color: var(--muted-2); font-size: 13px; margin: 4px 0 24px; }
@media (min-width: 700px) {
  .cs-gallery { grid-template-columns: repeat(3, 1fr); }
  .cs-gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
}

/* Results stat list */
.results-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.results-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: #d8d8d8;
  font-size: 15.5px;
}

/* Key insight callout */
.key-insight {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 12px 12px 0;
  padding: 20px 22px;
  margin: 24px 0;
}
.key-insight h2 { margin-top: 0; }
.key-insight p { color: #d8d8d8; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.tags li {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--icon-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
}

.back-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; margin-top: 8px; }

/* TODO placeholder block (Fire Tracker) */
.todo-block {
  border: 1px dashed var(--accent);
  border-radius: 12px;
  padding: 22px;
  background: rgba(255,90,60,0.05);
  color: var(--muted);
  margin: 24px 0;
}
.todo-block strong { color: var(--accent); }

/* ==========================================================================
   Breakpoints
   ========================================================================== */
@media (min-width: 700px) {
  body { font-size: 18px; }

  .nav-toggle { display: none; }
  .nav-links {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: auto;
    padding: 0;
  }
  .nav-links a:not(.btn) { padding: 4px 12px; }
  .nav-links.open .btn { margin-top: 0; }

  .section { padding: 72px 0; }

  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .quotes { grid-template-columns: repeat(3, 1fr); }
  .results-list { grid-template-columns: repeat(2, 1fr); }

  .hero .wrap {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    padding-top: 72px;
    padding-bottom: 72px;
  }
  .hero-text { flex: 1 1 0; }
  .hero-photo { flex: none; max-width: 320px; }

  .about-photo { width: 140px; height: 140px; }
}

@media (min-width: 1000px) {
  .hero-title { font-size: clamp(44px, 5vw, 58px); }
  .hero-photo { max-width: 360px; }
}

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