/* itsguideai.com — shared stylesheet
   Tone: clean, professional, modern personal site. */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,300;8..60,400;8..60,500;8..60,600;8..60,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* iOS × Anthropic blend — warm Anthropic ink/paper with iOS-system
     spatial language: clearer hierarchy, soft elevation, premium feel.
     Accent: Anthropic clay. Ink: warm near-black. Paper: soft cream. */
  --ink: #1a1612;
  --ink-2: #3a342c;
  --ink-3: #6b6357;
  --ink-4: #a39988;
  --paper: #f7f3ec;
  --paper-2: #efe9df;
  --line: rgba(26, 22, 18, 0.10);
  --line-soft: rgba(26, 22, 18, 0.05);
  --accent: #c15f3c;
  --accent-soft: rgba(193, 95, 60, 0.10);

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --measure: 68ch;
  --col: 1180px;
  --gutter: 32px;
  --rhythm: 1;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* iOS-style soft elevation */
  --shadow-sm: 0 0.5px 1px rgba(26,22,18,0.06), 0 2px 6px rgba(26,22,18,0.04);
  --shadow-md: 0 1px 2px rgba(26,22,18,0.05), 0 8px 24px rgba(26,22,18,0.06), 0 2px 6px rgba(26,22,18,0.04);
  --shadow-lg: 0 2px 4px rgba(26,22,18,0.06), 0 24px 60px rgba(26,22,18,0.10), 0 4px 12px rgba(26,22,18,0.04);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* optical sizing for display faces */
h1, h2, h3, h4, .lede, .prose, .brand-name, .page-title {
  font-optical-sizing: auto;
}

a { color: inherit; text-decoration: none; }
a.lnk {
  border-bottom: 1px solid var(--line);
  transition: border-color .15s, color .15s;
}
a.lnk:hover { border-bottom-color: var(--accent); color: var(--accent); }

::selection { background: var(--accent); color: #fff; }

button, input, textarea, select { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { max-width: var(--col); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }

/* ── header / nav ─────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 236, 0.78);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.brand {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.012em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  line-height: 1;
  color: var(--ink);
}
.brand .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  flex: 0 0 auto;
}
.brand .brand-name { color: var(--ink); }
.brand .domain {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 400;
  letter-spacing: 0;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  align-self: center;
}
.nav {
  display: flex;
  gap: 4px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}
.nav a {
  padding: 8px 14px;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }

/* ── footer ────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 96px;
  padding: 40px 0 56px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-3);
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.site-footer .left { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.site-footer .right { display: flex; gap: 24px; }
.site-footer .right a:hover { color: var(--accent); }

/* ── typography ───────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  font-weight: 500;
}
h1.page-title {
  font-family: var(--serif);
  font-size: clamp(34px, 4.5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.022em;
  font-weight: 500;
  margin: 0 0 16px;
  color: var(--ink);
  text-wrap: balance;
}
h1.page-title em { color: var(--accent); font-style: italic; font-weight: 400; }
h2 {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 500;
  margin: 0 0 12px;
  color: var(--ink);
}
h3 {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 500;
  margin: 0 0 8px;
  color: var(--ink);
}
p { margin: 0 0 1.1em; }
.lede {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-2);
  font-weight: 400;
  text-wrap: pretty;
}

/* ── tags / pills ────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 4px 11px;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.pill {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  color: var(--ink-2);
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  letter-spacing: -0.005em;
}
.pill .blob {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ── buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .15s, box-shadow .2s;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.005em;
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.btn:active { transform: scale(0.98); }
.btn-ghost {
  background: rgba(255,255,255,0.55);
  color: var(--ink);
  border-color: var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: none;
}
.btn-ghost:hover {
  background: #fff;
  color: var(--ink);
  border-color: var(--ink-4);
  box-shadow: var(--shadow-sm);
}
.btn .arr {
  width: 14px; height: 14px;
  display: inline-block;
  transition: transform .15s;
}
.btn:hover .arr { transform: translateX(3px); }

/* ── project grid (used by /projects index) ──────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
@media (max-width: 760px) { .project-grid { grid-template-columns: 1fr; } }
.project-card {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform .3s cubic-bezier(.2,.7,.3,1), box-shadow .3s, border-color .25s, background .25s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line);
  background: #fff;
}
.project-card .thumb {
  aspect-ratio: 16/10;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}
.project-card .thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgba(14,23,38,0.025) 14px 15px);
  pointer-events: none;
}
.project-card .body { padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.project-card .meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.project-card .meta .sep { color: var(--ink-4); }
.project-card h3 {
  font-size: 21px;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.01em;
  transition: color .15s;
}
.project-card:hover h3 { color: var(--accent); }
.project-card p {
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}
.project-card .foot {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.project-card .foot .arr { transition: transform .2s, color .15s; }
.project-card:hover .foot .arr { transform: translateX(4px); color: var(--accent); }

/* ── post list ────────────────────────────────────────────── */
.post-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 32px;
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
  align-items: baseline;
  text-decoration: none;
  color: inherit;
  transition: padding-left .2s;
}
.post-row:hover { padding-left: 8px; }
.post-row:hover h3 { color: var(--accent); }
.post-row:last-child { border-bottom: 1px solid var(--line-soft); }
.post-row .date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}
.post-row h3 {
  font-size: 19px;
  margin: 0 0 6px;
  font-weight: 500;
  letter-spacing: -0.008em;
  transition: color .15s;
}
.post-row p {
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.55;
  max-width: 60ch;
}
.post-row .read {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.kind-badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-right: 10px;
  vertical-align: 2px;
}
.kind-essay { background: var(--ink); color: #fff; }
.kind-note { background: var(--accent-soft); color: var(--accent); }

/* ── prose ────────────────────────────────────────────────── */
.prose {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.7;
  max-width: var(--measure);
  color: var(--ink-2);
}
.prose h2 { margin-top: 1.8em; color: var(--ink); }
.prose h3 { margin-top: 1.5em; color: var(--ink); }
.prose blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.6em 0;
  padding: 0.4em 0 0.4em 1.4em;
  font-style: italic;
  color: var(--ink-2);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--paper-2);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.prose ul { padding-left: 1.2em; }
.prose li { margin: 0.4em 0; }

/* ── divider ──────────────────────────────────────────────── */
.rule { border: 0; border-top: 1px solid var(--line); margin: 64px 0; }
.rule-soft { border: 0; border-top: 1px solid var(--line-soft); margin: 24px 0; }

/* ── outcomes ─────────────────────────────────────────────── */
.outcomes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (max-width: 720px) { .outcomes { grid-template-columns: 1fr; } }
.outcome {
  padding: 28px;
  border-right: 1px solid var(--line);
}
.outcome:last-child { border-right: 0; }
@media (max-width: 720px) {
  .outcome { border-right: 0; border-bottom: 1px solid var(--line); }
  .outcome:last-child { border-bottom: 0; }
}
.outcome .metric {
  font-family: var(--serif);
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}
.outcome .lab {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.4;
}

/* ── contact card (dark) ─────────────────────────────────── */
.contact-card {
  background: var(--ink);
  color: #fff;
  padding: 48px;
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.contact-card::before {
  content: "";
  position: absolute;
  top: -50%; right: -20%;
  width: 60%; height: 200%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 60%);
  opacity: 0.4;
  pointer-events: none;
}
@media (max-width: 760px) {
  .contact-card { grid-template-columns: 1fr; padding: 32px 24px; gap: 32px; }
}
.contact-card h2 {
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 12px;
  font-weight: 500;
  text-wrap: balance;
}
.contact-card p {
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  position: relative;
}
.contact-card .links {
  display: flex;
  flex-direction: column;
  gap: 0;
  font-family: var(--sans);
  font-size: 14px;
  position: relative;
}
.contact-card .links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  transition: padding-left .15s, color .15s;
}
.contact-card .links a:hover { padding-left: 8px; color: var(--accent); }
.contact-card .links a:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.contact-card .links a .arr { color: rgba(255,255,255,0.5); transition: color .15s; }
.contact-card .links a:hover .arr { color: var(--accent); }

/* dark card icon badge overrides */
.contact-card .icon-badge {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.15);
}
.contact-card .icon-badge svg { fill: rgba(255,255,255,0.70); }
.contact-card .links a:hover .icon-badge { box-shadow: 0 4px 12px rgba(0,0,0,0.25); }
.contact-card .links a:hover .icon-badge.icon-email   { background: var(--accent); border-color: var(--accent); }
.contact-card .links a:hover .icon-badge.icon-phone   { background: var(--accent); border-color: var(--accent); }
.contact-card .links a:hover .icon-badge.icon-linkedin { background: #0A66C2; border-color: #0A66C2; }
.contact-card .links a:hover .icon-badge svg { fill: #fff; }

/* ── social icon badges ──────────────────────────────────── */
.icon-badge {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper-2);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .22s, border-color .22s, transform .22s cubic-bezier(.2,.7,.3,1), box-shadow .22s;
}
.icon-badge svg { fill: var(--ink-2); transition: fill .18s; }
/* standalone anchor badge (footer) */
a.icon-badge:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}
a.icon-badge.icon-linkedin:hover { background: #0A66C2; border-color: #0A66C2; }
a.icon-badge.icon-github:hover   { background: var(--ink); border-color: var(--ink); }
a.icon-badge:hover svg { fill: #fff; }
/* badge nested inside a row anchor */
a:hover .icon-badge {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}
a:hover .icon-badge.icon-linkedin { background: #0A66C2; border-color: #0A66C2; }
a:hover .icon-badge.icon-github   { background: var(--ink); border-color: var(--ink); }
a:hover .icon-badge.icon-email    { background: var(--accent); border-color: var(--accent); }
a:hover .icon-badge.icon-message  { background: var(--accent); border-color: var(--accent); }
a:hover .icon-badge.icon-phone    { background: var(--accent); border-color: var(--accent); }
a:hover .icon-badge svg { fill: #fff; }

/* footer social text links with leading icon */
.footer-social { display: inline-flex; align-items: center; gap: 5px; }
.footer-social svg { flex-shrink: 0; fill: currentColor; }

/* ── density modifier ────────────────────────────────────── */
body.density-cozy { --rhythm: 0.85; }
body.density-airy { --rhythm: 1.2; }

/* ── reveal ──────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .65s cubic-bezier(.2,.7,.3,1), transform .65s cubic-bezier(.2,.7,.3,1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* ── hero entrance animation ────────────────────────────── */
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.hero-anim {
  animation: hero-rise .75s cubic-bezier(.2,.7,.3,1) both;
}

/* ── mobile nav ──────────────────────────────────────────── */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: none; background: none; cursor: pointer;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  padding: 8px; border-radius: 8px;
  color: var(--ink);
  transition: background .15s;
  flex-shrink: 0;
}
.nav-toggle:hover { background: var(--paper-2); }
.nav-toggle span {
  display: block; width: 18px; height: 1.5px;
  background: currentColor;
  transition: transform .25s cubic-bezier(.2,.7,.3,1), opacity .2s;
  transform-origin: center;
  border-radius: 1px;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@keyframes menu-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 680px) {
  .nav { display: none; }
  .nav.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 63px; left: 0; right: 0;
    background: rgba(247, 243, 236, 0.97);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
    padding: 10px 16px 20px;
    gap: 2px;
    z-index: 49;
    animation: menu-drop .2s cubic-bezier(.2,.7,.3,1) both;
  }
  .nav.mobile-open a {
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 16px;
  }
  .nav-toggle { display: flex; }
}

/* ── mobile typography & spacing ────────────────────────── */
@media (max-width: 680px) {
  :root {
    --gutter: 20px;
  }
  .hero { padding: 52px 0 48px; }
}

@media (max-width: 680px) {
  .section { padding: 56px 0 16px; }
  .section-head { margin-bottom: 24px; }
  .section-head h2 { font-size: 26px; }
  .connect-card { padding: 28px 20px !important; }
}

/* mobile post rows — collapse 3-col grid to single column */
@media (max-width: 640px) {
  .post-line {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }
  .post-line .read { display: none; }
  .post-row {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  .post-row .read { display: none; }
  .post-row .date { margin-bottom: 2px; }
}

/* mobile project grid — already 1-col at 760px, fine-tune card padding */
@media (max-width: 640px) {
  .clean-card .body,
  .project-card .body { padding: 18px; }
}
