/* ═══════════════════════════════════════════════════════════════════
   Tim Baron — site.css
   Warm-minimal aesthetic: parchment tones, serif headlines, precise spacing
   ═══════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────────────── */
:root {
  --bg:        #f4ebe0;
  --bg-alt:    #ece3d5;
  --bg-card:   #e8dece;
  --ink:       #1c1810;
  --ink-2:     #3a3228;
  --ink-light: #b3a99f;
  --muted:     #7d6e5c;
  --accent:    #8c4a2f;
  --border:    rgba(90,70,50,0.12);
  --border-md: rgba(90,70,50,0.2);
  --serif: 'Lora', Georgia, serif;
  --sans:  'Karla', system-ui, sans-serif;
  --max: 1040px;
  --gutter: 48px;
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ── Nav ────────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--gutter);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
}
.nav-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.nav-links a {
  color: var(--muted);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links .cta a  { color: var(--accent); }
.nav-links .cta a:hover { color: var(--ink); }

/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
  padding: 72px var(--gutter) 64px;
  border-bottom: 1px solid var(--border-md);
}
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 48px;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-photo-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.hero-photo-frame {
  position: relative;
  width: clamp(180px, 22vw, 260px);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--border-md);
  box-shadow: 4px 8px 24px rgba(60, 40, 20, 0.14);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 500;
  margin-bottom: 22px;
}
.hero-headline {
  font-family: var(--serif);
  font-size: clamp(40px, 5.5vw, 68px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 24px;
  max-width: 760px;
}
.hero-headline em {
  font-style: italic;
  color: var(--accent);
}
.hero-sub {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 520px;
  font-weight: 300;
  margin-bottom: 52px;
}

/* ── Hero Stats ─────────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border-md);
  border-left: 1px solid var(--border-md);
  max-width: 640px;
}
.stat {
  padding: 20px 20px 16px;
  border-right: 1px solid var(--border-md);
  border-bottom: 1px solid var(--border-md);
}
.stat-value {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  display: block;
  line-height: 1;
  margin-bottom: 7px;
}
.stat-label {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  font-weight: 400;
}

/* ── Stats Grid (section variant — matches hero stats treatment) ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border-md);
  border-left: 1px solid var(--border-md);
  max-width: 640px;
}
.stats-grid .stat {
  padding: 20px 20px 16px;
  border-right: 1px solid var(--border-md);
  border-bottom: 1px solid var(--border-md);
}

/* ── Page Section Layout ────────────────────────────────────────── */
.page-section {
  padding: 64px var(--gutter);
  border-bottom: 1px solid var(--border);
}
.page-section:nth-child(even) { background: var(--bg-alt); }

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 28px;
}

.section-label-col { padding-top: 4px; }
.section-label-text {
  font-size: 0.69rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  font-family: var(--sans);
}

.section-body {}
.section-heading {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 24px;
  line-height: 1.15;
}

/* ── Section Prose (text content area) ─────────────────────────── */
.section-prose {
  font-size: 15px;
  line-height: 1.78;
  color: var(--ink-2);
  font-weight: 300;
  max-width: 42rem;
}
.section-prose p + p      { margin-top: 14px; }
.section-prose h3         { font-family: var(--serif); font-size: 18px; font-weight: 500; color: var(--ink); margin: 20px 0 10px; }
.section-prose ul,
.section-prose ol         { padding-left: 20px; margin: 10px 0; }
.section-prose li         { margin-bottom: 5px; }
.section-prose a          { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(140,74,47,0.4); }
.section-prose a:hover    { text-decoration-color: var(--accent); }
.section-prose strong     { font-weight: 500; color: var(--ink); }
.section-prose em         { font-style: italic; }

/* ── About / Bio Photo Layout ───────────────────────────────────── */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 40px;
  align-items: start;
}

/* bio-photo: targets real <img> element */
img.bio-photo {
  width: 200px;
  height: 240px;
  object-fit: cover;
  border: 1px solid var(--border-md);
  flex-shrink: 0;
  display: block;
}

/* ── Experience Entries ─────────────────────────────────────────── */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.exp-entry {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.exp-entry:first-child { padding-top: 0; }
.exp-entry:last-child  { border-bottom: none; padding-bottom: 0; }

.exp-dates {
  font-size: .8rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-family: var(--sans);
  padding-top: 3px;
  line-height: 1.5;
  font-weight: 500;
}

.exp-role {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 3px;
  line-height: 1.2;
}
.exp-company {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 10px;
}
.exp-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  font-weight: 300;
}
.exp-desc p { max-width: 38rem; }
.exp-desc p + p { margin-top: 8px; }
.exp-desc ul {
  padding-left: 16px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ── Skills Grid ────────────────────────────────────────────────── */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-tag {
  padding: 7px 14px;
  border: 1px solid var(--border-md);
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 400;
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
  cursor: default;
  line-height: 1.4;
}
.skill-tag:hover {
  border-color: var(--accent);
  background: var(--bg-alt);
}
.skill-tag.featured {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.skill-tag.featured:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
}

/* ── Personal Placeholder ───────────────────────────────────────── */
.personal-placeholder {
  background: var(--bg-card);
  border: 1px dashed var(--border-md);
  padding: 32px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

/* ── Section photo gallery ─────────────────────────────────── */
.section-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1.5rem;
}

.gallery-thumb-btn {
  padding: 0;
  background: none;
  border: 2px solid transparent;
  cursor: pointer;
  display: block;
  transition: border-color 0.15s;
}

.gallery-thumb-btn:hover,
.gallery-thumb-btn:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.gallery-thumb {
  display: block;
  width: 100px;
  height: 100px;
  object-fit: cover;
}

/* Lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(20, 14, 8, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox[hidden] { display: none; }

.lightbox-img-wrap {
  max-width: min(90vw, 900px);
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: none;
  border: none;
  color: #f4ebe0;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  padding: 12px;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; }

.lightbox-close { top: 16px; right: 20px; font-size: 2.4rem; }
.lightbox-prev  { left: 16px;  top: 50%; transform: translateY(-50%); font-size: 3rem; }
.lightbox-next  { right: 16px; top: 50%; transform: translateY(-50%); font-size: 3rem; }

.lightbox-caption {
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: rgba(244, 235, 224, 0.6);
  letter-spacing: 0.04em;
  text-align: center;
  min-height: 1.2em;
}

/* ── Contact CTA ────────────────────────────────────────────────── */
.contact-cta {
  padding: 72px var(--gutter);
  background: var(--ink);
}
.contact-cta-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}
.cta-headline {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  color: var(--bg);
  line-height: 1.2;
  margin-bottom: 10px;
}
.cta-headline em { font-style: italic; color: #d4a06a; }
.cta-sub {
  font-size: 14px;
  color: rgba(244,235,224,0.55);
  font-weight: 300;
}
.cta-button {
  display: inline-block;
  padding: 16px 36px;
  background: var(--bg);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  font-family: var(--sans);
}
.cta-button:hover { background: var(--accent); color: var(--bg); }

/* ── Footer ─────────────────────────────────────────────────────── */
footer {
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 24px var(--gutter);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-name {
  font-family: var(--serif);
  font-size: 14px;
  color: rgba(244,235,224,0.5);
}
.footer-links {
  display: flex;
  gap: 24px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244,235,224,0.35);
}
.footer-links a { transition: color 0.15s; }
.footer-links a:hover { color: rgba(244,235,224,0.7); }
.footer-copy {
  font-size: 11px;
  color: rgba(244,235,224,0.25);
}

/* ── Hero Fade-in Animation ─────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-inner > * {
  animation: fadeUp 0.6s ease both;
}
.eyebrow       { animation-delay: 0s; }
.hero-headline { animation-delay: 0.08s; }
.hero-sub      { animation-delay: 0.16s; }
.stats         { animation-delay: 0.24s; }

/* ── Contact Form ───────────────────────────────────────────────── */

/* Contact section wrapper — uses page-section layout */
.page-section--contact {}

/* Field group: label + input stacked */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

/* Labels */
.field-label {
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--sans);
}

/* Shared input/textarea/select appearance */
.field-input,
.field-textarea,
.field-select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-md);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 300;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}
.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(140,74,47,0.10);
}
.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}
.field-input:disabled,
.field-textarea:disabled,
.field-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Textarea specific */
.field-textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.65;
}

/* Select: custom arrow */
.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237d6e5c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.field-select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238c4a2f'/%3E%3C/svg%3E");
}

/* Submit button */
.form-submit {
  display: inline-block;
  padding: 14px 36px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.form-submit:hover    { background: var(--accent); color: var(--bg); }
.form-submit:focus    { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.form-submit:disabled:hover { background: var(--ink); color: var(--bg); }

/* Optional section expander toggle link */
[data-optional-toggle] {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--sans);
  font-weight: 500;
  margin-bottom: 16px;
  display: inline-block;
  transition: color 0.15s;
}
[data-optional-toggle]:hover { color: var(--ink); }

/* Optional panel: hidden by default, shown by site.js */
[data-optional-panel] {
  display: none;
  padding-top: 4px;
}
[data-optional-panel][data-open="1"] { display: block; }

/* Form feedback messages */
.form-message {
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
  margin-bottom: 20px;
  border-left: 3px solid var(--border-md);
  background: var(--bg-card);
  color: var(--ink-2);
}
.form-message--error {
  border-left-color: #c0392b;
  background: rgba(192,57,43,0.06);
  color: #7a1f15;
}
.form-message--ok {
  border-left-color: #2e7d32;
  background: rgba(46,125,50,0.06);
  color: #1a4d1d;
}

/* ── Contact Page ─────────────────────────────────────────────── */

/* Page wrapper: constrained width, vertical stack */
.page-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px var(--gutter) 72px;
}
.page-stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Tile: the card unit */
.tile {
  background: var(--bg-alt);
  border: 1px solid var(--border-md);
  padding: 36px 40px;
}
.tile h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.15;
}
.tile-h-sm {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 18px;
  line-height: 1.2;
}
.lede {
  font-size: 16px;
  line-height: 1.72;
  color: var(--muted);
  font-weight: 300;
  max-width: 560px;
}
.note {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 18px;
}
.note i, .note em { font-style: italic; }

/* Two-tile layout */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 24px;
  align-items: start;
}

/* Flash messages */
.flash {
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.55;
  border-left: 3px solid var(--border-md);
  background: var(--bg-card);
  color: var(--ink-2);
}
.flash--ok {
  border-left-color: #2e7d32;
  background: rgba(46,125,50,0.06);
  color: #1a4d1d;
}
.flash--err {
  border-left-color: #c0392b;
  background: rgba(192,57,43,0.06);
  color: #7a1f15;
}

/* vCard download grid */
.vcard-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.vcard-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px 14px;
  background: var(--bg);
  border: 1px solid var(--border-md);
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none;
}
.vcard-link:hover {
  border-color: var(--accent);
  background: var(--bg-card);
}
.vcard-link .title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
}
.vcard-link .desc {
  font-size: 12px;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.5;
}
.vcard-link .action {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-top: 6px;
}

/* Contact form grid */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.form-grid label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--sans);
  margin-bottom: 6px;
}
.form-grid input[type="text"],
.form-grid input[type="email"],
.form-grid input[type="tel"],
.form-grid input[type="url"],
.form-grid input[type="number"],
.form-grid textarea,
.form-grid select {
  display: block;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-md);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 300;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}
.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(140,74,47,0.10);
}
.form-grid input::placeholder,
.form-grid textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}
.form-grid textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.65;
}
.form-grid select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237d6e5c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Two-column form row */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Birthday row */
.form-row-bday {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.form-row-bday select {
  flex: 0 0 auto;
  width: auto;
  min-width: 110px;
  display: inline-block;
}
.form-row-bday input[type="number"] {
  flex: 1;
  min-width: 110px;
}

/* Section label and optional text */
.form-section-label {
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--sans);
}
.form-optional {
  font-weight: 300;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.75;
  font-size: 0.9em;
}

/* Social link rows */
.social-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.social-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.social-row__platform { flex: 0 0 140px; }
.social-row__url      { flex: 1; }
.social-row__remove {
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--border-md);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 0 10px;
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color 0.15s, color 0.15s;
}
.social-row__remove:hover { border-color: var(--accent); color: var(--accent); }

/* Expand/collapse toggle */
.form-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border-md);
  color: var(--ink-2);
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 400;
  padding: 9px 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}
.form-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.form-toggle-btn[aria-expanded="true"] { border-color: var(--ink-2); color: var(--ink); }
.toggle-icon { font-size: 16px; line-height: 1; font-weight: 300; }

/* Revealed panel */
.form-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-top: 12px;
}

/* Button variants */
.btn-primary {
  display: inline-block;
  padding: 13px 32px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.4;
}
.btn-primary:hover { background: var(--accent); color: var(--bg); }
.btn-primary:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-ghost {
  display: inline-block;
  padding: 9px 16px;
  background: none;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  border: 1px solid var(--border-md);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.4;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-outline {
  display: inline-block;
  padding: 10px 20px;
  background: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  border: 1px solid var(--border-md);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.4;
}
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }

/* Photo upload */
.photo-upload-area {
  border: 1px dashed var(--border-md);
  padding: 20px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}
.photo-upload-trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.photo-preview-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid var(--border-md);
  flex-shrink: 0;
}
.photo-clear-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: var(--sans);
  transition: color 0.15s;
}
.photo-clear-btn:hover { color: var(--accent); }

/* Modals: crop and photo-chooser */
body.crop-modal-open { overflow: hidden; }
.crop-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.crop-modal[hidden] { display: none; }
.crop-modal__inner {
  background: var(--bg);
  border: 1px solid var(--border-md);
  padding: 28px 32px;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.crop-modal__title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}
.crop-modal__canvas {
  max-height: 400px;
  overflow: hidden;
  background: var(--bg-card);
}
.crop-modal__canvas img {
  max-height: 400px;
  display: block;
  width: 100%;
}
.crop-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Photo chooser buttons */
.photo-chooser__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.photo-chooser__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
}
.photo-chooser__btn:hover {
  border-color: var(--accent);
  background: var(--bg-card);
}
.photo-chooser__btn--accent {
  background: var(--ink);
  border-color: var(--ink);
}
.photo-chooser__btn--accent:hover { background: var(--accent); border-color: var(--accent); }
.photo-chooser__btn--accent .photo-chooser__icon,
.photo-chooser__btn--accent .photo-chooser__label,
.photo-chooser__btn--accent .photo-chooser__sub { color: var(--bg); }
.photo-chooser__icon {
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-chooser__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  font-family: var(--sans);
}
.photo-chooser__sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 300;
}

/* ── Responsive — ≤768px ────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Gutter tightened */
  :root {
    --gutter: 20px;
  }

  /* Nav: hide links on mobile, show just the name */
  .nav-links {
    display: none;
  }
  .nav-inner {
    justify-content: flex-start;
  }

  /* Hero */
  .hero {
    padding: 48px var(--gutter) 40px;
  }
  .hero-sub {
    margin-bottom: 36px;
  }
  .hero-inner--has-photo {
    flex-direction: column-reverse;
    gap: 28px;
    align-items: flex-start;
  }
  .hero-photo-frame {
    width: clamp(120px, 36vw, 180px);
  }

  /* Stats: 4-column → 2×2 grid */
  .stats,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
  }

  /* Page sections */
  .page-section {
    padding: 44px var(--gutter);
  }

  /* Section inner: 2-column → single column */
  .section-inner {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .section-label-col {
    padding-top: 0;
  }

  /* Section heading smaller */
  .section-heading {
    font-size: 24px;
    margin-bottom: 18px;
  }

  /* Section prose: full width on mobile */
  .section-prose {
    max-width: 100%;
  }

  /* About layout: side-by-side → stacked (bio photo below text) */
  .about-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  img.bio-photo {
    width: 160px;
    height: 192px;
  }

  /* Experience: 2-column → single column */
  .exp-entry {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .exp-dates {
    padding-top: 0;
  }

  /* Contact CTA: 2-column → stacked */
  .contact-cta {
    padding: 48px var(--gutter);
  }
  .contact-cta-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .cta-headline {
    font-size: 26px;
  }
  .cta-button {
    align-self: flex-start;
    width: 100%;
    text-align: center;
  }

  /* Footer: row → column */
  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  .footer-links {
    gap: 16px;
  }

  /* Form adjustments */
  .form-submit {
    width: 100%;
    text-align: center;
  }

  /* Contact page */
  .page-main {
    padding: 32px var(--gutter) 48px;
  }
  .tile {
    padding: 24px 20px;
  }
  .contact-layout {
    grid-template-columns: 1fr;
  }
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  .form-row-bday {
    flex-direction: column;
  }
  .form-row-bday select,
  .form-row-bday input[type="number"] {
    width: 100%;
    min-width: 0;
  }
  .photo-chooser__options {
    grid-template-columns: 1fr;
  }
  .crop-modal__inner {
    padding: 20px 16px;
  }
  .btn-primary,
  .btn-ghost,
  .btn-outline {
    width: 100%;
    text-align: center;
  }
  .photo-upload-trigger { flex-direction: column; align-items: flex-start; }
}
