/* ---------- Tokens ---------- */
:root {
  --bg: #faf7f2;
  --bg-soft: #f3eee5;
  --ink: #1a1715;
  --ink-2: #3a342e;
  --muted: #7a7068;
  --rule: #e4ddd1;
  --accent: #8a5a3a;
  --accent-soft: #c9b9a3;
  --radius: 4px;
  --shadow-sm: 0 1px 2px rgba(26,23,21,.04);
  --shadow-lg: 0 24px 60px -20px rgba(26,23,21,.25), 0 8px 20px -10px rgba(26,23,21,.15);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1180px;
  --gutter: clamp(20px, 4vw, 56px);
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); transition: border-color .15s ease, color .15s ease; }
a:hover, a:focus-visible { color: var(--ink); border-bottom-color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg);
  padding: 10px 14px; border: 0;
  z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- Bio ---------- */
.bio {
  padding: clamp(48px, 9vw, 112px) var(--gutter) clamp(40px, 7vw, 80px);
  border-bottom: 1px solid var(--rule);
}
.bio-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}
.bio-photo {
  width: 200px;
  height: 240px;
  object-fit: cover;
  border-radius: var(--radius);
  filter: saturate(.92);
  box-shadow: var(--shadow-sm);
}
.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 14px;
}
.bio h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.08;
  letter-spacing: -.005em;
  margin: 0 0 22px;
  color: var(--ink);
}
.bio-blurb {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 0;
}
@media (min-width: 720px) {
  .bio-inner {
    grid-template-columns: auto 1fr;
  }
  .bio-photo { width: 220px; height: 264px; }
}
@media (min-width: 1024px) {
  .bio-photo { width: 260px; height: 312px; }
}

/* ---------- Section head ---------- */
.projects { padding: clamp(56px, 8vw, 96px) var(--gutter) clamp(56px, 8vw, 112px); }
.section-head {
  max-width: var(--maxw);
  margin: 0 auto clamp(36px, 5vw, 56px);
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.1;
  margin: 0 0 10px;
}
.section-sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 56ch;
}

/* ---------- Grid ---------- */
.grid {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: var(--maxw);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 40px) clamp(20px, 3vw, 32px);
}
@media (min-width: 640px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Tile ---------- */
.tile {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: inherit;
  transition: transform .25s ease;
}
.tile:hover .tile-img,
.tile:focus-visible .tile-img { transform: scale(1.02); }
.tile:hover .tile-name { color: var(--accent); }

.tile-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--rule);
}
.tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.tile-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
  transition: color .15s ease;
}
.tile-tag {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
}
.tile-pill {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(138,90,58,.08);
  border: 1px solid rgba(138,90,58,.2);
  padding: 3px 8px;
  border-radius: 999px;
  margin-top: 6px;
  font-weight: 500;
}

/* Sales Automation: persistent privacy callout on tile */
.tile-privacy {
  margin-top: 4px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--bg-soft);
  border-left: 2px solid var(--accent);
  border-radius: 2px;
}

/* ---------- Modal ---------- */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: stretch;
  animation: fade .18s ease both;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(26,23,21,.55);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  margin: auto;
  background: var(--bg);
  width: min(960px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  animation: rise .22s ease both;
  outline: none;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-close {
  position: sticky;
  top: 12px;
  margin-left: auto;
  margin-right: 12px;
  margin-top: 12px;
  margin-bottom: -36px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--rule);
  cursor: pointer;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, color .15s ease;
  float: right;
}
.modal-close:hover { background: var(--ink); color: var(--bg); }

.modal-body {
  padding: clamp(28px, 4.5vw, 56px);
  padding-top: clamp(20px, 3vw, 36px);
}
.modal-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11.5px;
  color: var(--muted);
  margin: 0 0 14px;
}
.modal-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4a8a4a;
  display: inline-block;
}
.modal-eyebrow .dot.internal { background: var(--accent); }
.modal h3.modal-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 4.4vw, 42px);
  line-height: 1.1;
  margin: 0 0 12px;
}
.modal-tag {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(18px, 2vw, 22px);
  color: var(--ink-2);
  margin: 0 0 24px;
}
.modal-desc {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0 0 28px;
  max-width: 70ch;
}
.modal-link {
  display: inline-block;
  margin-bottom: 28px;
  font-weight: 500;
  font-size: 15px;
}
.modal-link::after { content: " ↗"; }
.modal-privacy {
  margin: 0 0 28px;
  padding: 14px 18px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
  max-width: 70ch;
}
.modal-section-label {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11.5px;
  color: var(--muted);
  margin: 0 0 12px;
}
.tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 0;
  margin: 0 0 32px;
  list-style: none;
}
.tech li {
  font-size: 12.5px;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--bg-soft);
}
.gallery {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gallery li { margin: 0; }
.gallery figure { margin: 0; }
.gallery img,
.gallery .svg-wrap {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: #fff;
}
.gallery .svg-wrap {
  padding: 16px;
  display: block;
}
.gallery figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* Lock background scroll while modal is open */
body.modal-open { overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 32px var(--gutter);
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

.noscript-note {
  max-width: var(--maxw);
  margin: 24px auto 0;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  color: var(--ink-2);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .tile-img { transition: none !important; }
}
