/* Shared layout primitives — bento + inner pages */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--jb-space-4);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--jb-space-2);
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 0.6rem 0;
  margin-left: calc(-1 * var(--jb-space-4));
  margin-right: calc(-1 * var(--jb-space-4));
  padding-left: var(--jb-space-4);
  padding-right: var(--jb-space-4);
  background: var(--jb-bg);
  box-shadow: 0 1px 0 var(--jb-rule);
}

.logo {
  font-family: var(--jb-font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--jb-text);
  text-decoration: none;
}

.logo:hover {
  color: var(--jb-accent);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.nav-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  order: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--jb-rule);
  border-radius: var(--jb-radius-sm, 4px);
  background: var(--jb-surface);
  color: var(--jb-text);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.nav-mobile-toggle:hover,
.nav-mobile-toggle:focus-visible {
  border-color: var(--jb-accent);
  color: var(--jb-accent);
  outline: none;
}

.nav-mobile-toggle__icon--close {
  display: none;
}

.site-header.nav-open .nav-mobile-toggle__icon--open {
  display: none;
}

.site-header.nav-open .nav-mobile-toggle__icon--close {
  display: block;
}

.nav-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
  order: 0;
}

.theme-toggle {
  order: 1;
}

@media (max-width: 720px) {
  .nav-mobile-toggle {
    display: inline-flex;
  }

  .nav-primary {
    order: 2;
    flex: 0 0 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.22s ease, padding 0.22s ease;
    pointer-events: none;
    padding-top: 0;
    margin-top: 0;
    border-top: 1px solid transparent;
  }

  .site-header.nav-open .nav-primary {
    max-height: 18rem;
    opacity: 1;
    pointer-events: auto;
    padding-top: 0.65rem;
    margin-top: 0.45rem;
    border-top-color: var(--jb-rule);
  }
}

@media (min-width: 721px) {
  .site-header.nav-open .nav-primary {
    max-height: none;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
    padding-top: 0;
    margin-top: 0;
    border-top: none;
  }
}

.nav-primary a {
  color: var(--jb-sub);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
}

.nav-primary a:hover,
.nav-primary a.is-active {
  color: var(--jb-accent);
}

.site-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  font-size: 0.75rem;
  color: var(--jb-sub);
}

.site-footer p {
  margin: 0;
}

main.page-main {
  position: relative;
  z-index: 1;
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(0.65rem, 2vw, 1rem);
}

.tile {
  background: var(--jb-surface);
  border-radius: var(--jb-radius);
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--jb-rule);
  overflow: hidden;
  position: relative;
}

.tile h1,
.tile h2,
.tile h3 {
  font-family: var(--jb-font-display);
  color: var(--jb-text);
}

.tile h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  margin: 0 0 1.1rem;
}

.tile h2 {
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0 0 0.85rem;
}

.tile h2.tile-h-sm {
  font-size: 1.2rem;
  margin: 0 0 1rem;
}

.tile p {
  margin: 0 0 1rem;
  color: var(--jb-sub);
  line-height: 1.65;
}

.tile p.lede {
  max-width: 85ch;
  font-size: 1.1rem;
}

.tile p.lede-wide { max-width: 95ch; }

.tile p.note {
  font-size: 1rem;
  max-width: 85ch;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.tile p.footnote {
  font-size: 0.88rem;
  max-width: 80ch;
  line-height: 1.55;
  margin: 1rem 0 0;
}

.tile .eyebrow {
  display: block;
  font-family: var(--jb-font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--jb-accent);
  margin: 1.5rem 0 0.75rem;
}

.tile ul.brand-list {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--jb-sub);
  line-height: 1.55;
  font-size: 0.93rem;
}

.tile ul.brand-list li {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  padding: 0.95rem 0 0.95rem 1.65rem;
  border-top: 1px solid var(--jb-rule);
  position: relative;
}

.tile ul.brand-list li:first-child {
  border-top: none;
  margin-top: 0.25rem;
}

.tile ul.brand-list li:last-child {
  margin-bottom: 0.25rem;
}

.tile ul.brand-list li::before {
  content: "";
  position: absolute;
  top: 1.58em;
  left: 0;
  transform: translateY(-50%);
  width: 10px;
  height: 1px;
  background: var(--jb-accent);
}

.tile ul.brand-list .brand-list__name {
  display: block;
  font-family: var(--jb-font-display);
  font-weight: 700;
  font-size: clamp(0.88rem, 1.35vw, 1.02rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--jb-text);
  line-height: 1.2;
}

.tile ul.brand-list a.brand-list__name {
  text-decoration: none;
  transition: color 0.2s ease;
}

.tile ul.brand-list a.brand-list__name:hover {
  color: var(--jb-accent);
}

.tile ul.brand-list a.brand-list__name:focus-visible {
  outline: 2px solid var(--jb-accent);
  outline-offset: 2px;
}

.tile ul.brand-list .brand-list__desc {
  display: block;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.58;
  color: var(--jb-sub);
  max-width: 68ch;
}

.tile p:last-child { margin-bottom: 0; }

.work-hero.tile {
  position: relative;
  padding: clamp(1.35rem, 3.5vw, 2.25rem);
  border: 1px solid var(--jb-rule);
  background:
    linear-gradient(145deg, rgba(255, 122, 61, 0.06) 0%, transparent 42%),
    var(--jb-surface);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}
.work-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--jb-accent), transparent 85%);
  border-radius: var(--jb-radius-sm, 2px) 0 0 var(--jb-radius-sm, 2px);
  opacity: 0.85;
}

.prose-bento .article-title {
  font-family: var(--jb-font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0.5rem 0 1rem;
}

.prose-bento .article-meta {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jb-accent);
  margin: 0;
}

.prose-bento .article-lede {
  font-size: 1.05rem;
  color: var(--jb-sub);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.prose-bento .article-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--jb-text);
}

.prose-bento .article-body h2 {
  font-family: var(--jb-font-display);
  font-size: 1.15rem;
  margin: 2rem 0 0.75rem;
}

.prose-bento .article-body p {
  margin: 0 0 1rem;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-year {
  font-family: var(--jb-font-display);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--jb-text);
}

.timeline-year:first-child {
  margin-top: 0;
}

.timeline ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--jb-sub);
  font-size: 1rem;
  line-height: 1.65;
}

.form-grid {
  display: grid;
  gap: 1rem;
  max-width: 36rem;
}

.form-grid label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--jb-sub);
  margin-bottom: 0.35rem;
}

.form-grid label .form-optional {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--jb-sub);
  opacity: 0.85;
}

.form-grid input,
.form-grid textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--jb-radius-sm);
  border: 1px solid rgba(128, 140, 160, 0.25);
  background: var(--jb-surface);
  color: var(--jb-text);
}

.form-grid textarea {
  min-height: 10rem;
  resize: vertical;
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  border: none;
  background: var(--jb-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--jb-radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.flash--ok {
  background: rgba(42, 75, 201, 0.12);
  color: var(--jb-text);
  border: 1px solid rgba(42, 75, 201, 0.25);
}

.flash--err {
  background: rgba(180, 60, 60, 0.1);
  border: 1px solid rgba(180, 60, 60, 0.25);
}

.vcard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.65rem, 2vw, 1rem);
  margin-top: 1.5rem;
}

@media (max-width: 720px) {
  .vcard-grid {
    grid-template-columns: 1fr;
  }
}

.vcard-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--jb-radius-sm);
  background: var(--jb-surface);
  border: 1px solid rgba(128, 140, 160, 0.2);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, border-color 0.2s;
}

.vcard-link:hover {
  transform: translateY(-3px);
  border-color: var(--jb-accent);
}

.vcard-link .title {
  font-family: var(--jb-font-display);
  font-weight: 700;
  font-size: 1rem;
}

.vcard-link .desc {
  font-size: 0.78rem;
  color: var(--jb-sub);
  line-height: 1.4;
}

.vcard-link .action {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--jb-accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─── Enhanced contact form components ─── */

/* Birthday row: month select / day select / year input */
.form-row-bday {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 0.5rem;
}
.form-row-bday select,
.form-row-bday input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: var(--jb-radius-sm);
  border: 1px solid rgba(128, 140, 160, 0.25);
  background: var(--jb-surface);
  color: var(--jb-text);
  font-family: var(--jb-font-body);
  font-size: 0.9rem;
}
@media (max-width: 420px) {
  .form-row-bday {
    grid-template-columns: 1fr 1fr;
  }
  .form-row-bday input[type="number"] {
    grid-column: 1 / -1;
  }
}

/* Two-column name row */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

/* Section divider within a form */
.form-section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--jb-font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--jb-sub);
  margin-top: 0.5rem;
}
.form-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--jb-rule);
}

/* Business section toggle button */
.form-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--jb-radius-sm);
  border: 1px solid var(--jb-rule);
  background: transparent;
  color: var(--jb-sub);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--jb-font-body);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.form-toggle-btn:hover,
.form-toggle-btn.is-active {
  border-color: var(--jb-accent);
  color: var(--jb-accent);
  background: rgba(214, 72, 27, 0.06);
}
.form-toggle-btn .toggle-icon {
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s;
}
.form-toggle-btn[aria-expanded="true"] .toggle-icon {
  transform: rotate(45deg);
}

/* Collapsible business section */
.form-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-left: 2px solid var(--jb-accent);
  margin-top: 0.25rem;
}

/* Social links dynamic rows */
.social-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.social-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 0.5rem;
  align-items: center;
}

@media (max-width: 520px) {
  .social-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .social-row__platform { grid-column: 1; }
  .social-row__url      { grid-column: 1; }
  .social-row__remove   { grid-column: 2; grid-row: 1 / 3; align-self: center; }
}

.social-row input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--jb-radius-sm);
  border: 1px solid rgba(128, 140, 160, 0.25);
  background: var(--jb-surface);
  color: var(--jb-text);
  font-size: 0.875rem;
}

.social-row__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 1px solid var(--jb-rule);
  background: transparent;
  color: var(--jb-sub);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.social-row__remove:hover {
  border-color: rgba(180, 60, 60, 0.4);
  color: rgba(180, 60, 60, 0.8);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--jb-radius-sm);
  border: 1px dashed var(--jb-rule);
  background: transparent;
  color: var(--jb-sub);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--jb-font-body);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--jb-accent);
  color: var(--jb-accent);
}
.btn-ghost:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Photo upload area */
.photo-upload-area {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.photo-upload-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.photo-preview-thumb {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--jb-rule);
  display: block;
}

.photo-clear-btn {
  font-size: 0.72rem;
  color: var(--jb-sub);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.photo-clear-btn:hover { color: var(--jb-accent); }

/* Crop modal overlay */
.crop-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(14, 15, 12, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.crop-modal__inner {
  background: var(--jb-surface);
  border-radius: var(--jb-radius);
  border: 1px solid var(--jb-rule);
  width: 100%;
  max-width: 500px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.crop-modal__title {
  font-family: var(--jb-font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.crop-modal__canvas {
  max-height: 360px;
  overflow: hidden;
}

.crop-modal__canvas img {
  display: block;
  max-width: 100%;
}

.crop-modal__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--jb-rule);
  background: transparent;
  color: var(--jb-text);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.btn-outline:hover { border-color: var(--jb-accent); color: var(--jb-accent); }

/* Prevent scroll behind crop modal */
body.crop-modal-open {
  overflow: hidden;
}

/* Photo chooser modal — Upload vs Take Photo */
.photo-chooser {
  max-width: 420px;
}

.photo-chooser__options {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 480px) {
  .photo-chooser__options {
    grid-template-columns: 1fr 1fr;
  }
}

.photo-chooser__btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border-radius: var(--jb-radius-sm);
  border: 1px solid var(--jb-rule);
  background: transparent;
  color: var(--jb-text);
  font-family: var(--jb-font-body);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s, background 0.2s, color 0.2s;
  position: relative;
  overflow: hidden;
}

.photo-chooser__btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--jb-accent);
  transition: width 0.25s cubic-bezier(0.2, 0.7, 0, 1);
}

.photo-chooser__btn:hover,
.photo-chooser__btn:focus-visible {
  border-color: var(--jb-accent);
  color: var(--jb-accent);
  outline: none;
  transform: translateY(-1px);
}

.photo-chooser__btn:hover::after,
.photo-chooser__btn:focus-visible::after {
  width: 100%;
}

.photo-chooser__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 0.35rem;
  color: var(--jb-accent);
}

.photo-chooser__label {
  font-family: var(--jb-font-display);
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1;
}

.photo-chooser__sub {
  font-family: var(--jb-font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jb-sub);
}

.photo-chooser__btn:hover .photo-chooser__sub,
.photo-chooser__btn:focus-visible .photo-chooser__sub {
  color: var(--jb-accent);
}

/* ─── Contact page: two-column layout ─── */
.contact-layout {
  display: grid;
  gap: clamp(0.65rem, 2vw, 1rem);
  align-items: start;
}

@media (min-width: 960px) {
  .contact-layout {
    grid-template-columns: 1fr 320px;
  }

  /* vCards pushed to right column; HTML source order keeps it above form on mobile */
  .contact-layout #vcards {
    grid-column: 2;
    grid-row: 1;
  }

  /* Form tile occupies the left column */
  .contact-layout .contact-form-tile {
    grid-column: 1;
    grid-row: 1;
  }

  /* Stack vCards as a single column in the narrow sidebar */
  .contact-layout .vcard-grid {
    grid-template-columns: 1fr;
    margin-top: 1rem;
  }

  /* Form fills the column — no artificial max-width needed */
  .contact-form-tile .form-grid {
    max-width: none;
  }
}
