/* responsive.css — Tablet + phone breakpoints */

/* ── Responsive: tablet + phone ── */
@media (max-width: 820px) {
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .page {
    margin: 0 auto 0;
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  /* taller hero so name + role breathe on tall phones */
  .hero {
    aspect-ratio: auto;
    min-height: min(58vh, 420px);
    max-height: 520px;
    height: min(58vh, 420px);
  }
  .hero-inner {
    padding: 18px 18px 22px;
    padding-top: max(18px, env(safe-area-inset-top, 0px));
  }
  .hero-caption {
    max-width: none;
    text-align: left;
    font-size: 0.56rem;
    letter-spacing: 0.1em;
    line-height: 1.45;
  }
  .hero-bottom h1 {
    font-size: clamp(2.35rem, 11vw, 3.1rem);
    margin-bottom: 10px;
  }
  .hero-role {
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    line-height: 1.45;
    max-width: 100%;
  }
  .hero-social { margin-top: 14px; gap: 10px; }
  .hero-social a { width: 40px; height: 40px; }

  .inner, .summary-block, .section, .contact-bar, .footer, .honesty {
    padding-left: 16px;
    padding-right: 16px;
  }
  .honesty { padding-top: 10px; padding-bottom: 10px; }
  .summary-block { padding-top: 28px; padding-bottom: 28px; }
  .summary-lead {
    font-size: 1.12rem;
    line-height: 1.5;
  }
  .summary-sub {
    font-size: 0.88rem;
    line-height: 1.6;
  }
  .section { padding-top: 28px; padding-bottom: 28px; }
  .section-head { grid-template-columns: 1fr; gap: 12px; }
  .section-label { padding-top: 0; position: static; }

  .featured, .featured.reverse { grid-template-columns: 1fr; gap: 16px; margin-bottom: 36px; }
  .featured.reverse .featured-visual { order: 0; }
  .featured-copy h3 { font-size: 1.28rem; }
  .featured-copy p { font-size: 0.9rem; line-height: 1.65; }
  /* keep photo grids compact — less endless vertical scroll */
  .featured-gallery-2x2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .featured-gallery-3 { grid-template-columns: 1fr 1fr 1fr; }
  .featured-gallery-3 .cell-label,
  .featured-gallery-2x2 .cell-label,
  .featured-grid-3 .cell-label {
    font-size: 0.5rem;
    left: 6px;
    bottom: 6px;
    padding: 3px 6px;
    max-width: calc(100% - 12px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* stats: clean 2-col with full borders; odd last spans full */
  .stats { grid-template-columns: 1fr 1fr; }
  .stat {
    padding: 16px 14px;
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
  }
  .stat:nth-child(2n) { border-right: none; }
  .stat:last-child { border-bottom: none; }
  .stat:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    border-right: none;
  }
  .stat-num { font-size: 1.28rem; }
  .stat-label {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    line-height: 1.35;
  }
  .stat-context { font-size: 0.78rem; margin-top: 6px; }

  .cadence { padding: 16px 12px 20px; }
  .cadence img { max-height: 120px; }

  .skill-row strong { display: block; margin-bottom: 2px; min-width: 0; }
  .thesis-visual__row { grid-template-columns: 1fr 1fr; }
  .thesis-compare { max-width: min(100%, 340px); }
  .thesis-compare__hint { font-size: 0.52rem; }
  .thesis-chips { gap: 6px; justify-content: flex-start; }
  .thesis-chip { padding: 8px 12px; /* larger tap targets */ }

  /* contact → labeled chips */
  .contact-bar {
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .contact-bar .sep { display: none; }
  .contact-bar .contact-val { display: none; }
  .contact-bar .contact-key {
    margin-right: 0;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }
  .contact-bar .contact-key::after { display: none; }
  .contact-bar .contact-icon {
    width: 14px;
    height: 14px;
    margin-right: 0.35em;
  }
  .contact-bar a {
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--rule));
    padding: 7px 12px 7px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    align-items: center;
  }
  .contact-bar a:hover {
    background: var(--accent-mid);
    color: var(--accent);
  }
  .contact-meta {
    display: block;
    width: 100%;
    margin-top: 4px;
    font-size: 0.68rem;
    line-height: 1.45;
  }

  /* jump-nav: edge fade + hidden scrollbar */
  .section-nav {
    padding: 0 0 0 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 28px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 28px), transparent 100%);
  }
  .section-nav::-webkit-scrollbar { display: none; }
  .section-nav a {
    padding: 11px 13px;
    white-space: nowrap;
    border-left: none !important;
    border-right: none;
    flex: 0 0 auto;
  }
  .section-nav a + a { border-left: 1px solid var(--rule); }

  .project-grid { grid-template-columns: 1fr; gap: 12px; }
  .project-item:hover { transform: none; } /* no hover lift on touch */
  .project-item:active { border-color: rgba(155, 65, 35, 0.45); }
  .project-body { padding: 14px 16px 16px; }
  .project-item p { font-size: 0.84rem; }

  .entry { padding-left: 12px; }
  .entry-title { font-size: 1rem; }
  .entry-period { white-space: normal; font-size: 0.68rem; }
  .entry li { font-size: 0.86rem; }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 18px;
    padding-bottom: 22px;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
    bottom: max(14px, env(safe-area-inset-bottom));
    right: max(14px, env(safe-area-inset-right));
  }

  .lightbox { padding: 12px 12px 48px; }
}

/* ── Narrow phones (≤400px) ── */
@media (max-width: 400px) {
  .hero {
    min-height: min(62vh, 400px);
    height: min(62vh, 400px);
  }
  .hero-bottom h1 {
    font-size: clamp(2.1rem, 12vw, 2.6rem);
  }
  .hero-role {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
  }
  /* keep triptych grids compact — hide long cell labels if they overflow */
  .featured-gallery-3 .cell-label {
    display: none;
  }
  .featured-grid-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .featured-grid-3 > .cell:first-child {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .stat { padding: 14px 12px; }
  .stat-num { font-size: 1.18rem; }
  .contact-bar a { padding: 6px 10px; font-size: 0.66rem; }
  .summary-lead { font-size: 1.05rem; }
}

/* very small / landscape phones */
@media (max-width: 820px) and (max-height: 480px) {
  .hero {
    min-height: 220px;
    height: 240px;
    max-height: 260px;
  }
  .hero-bottom h1 { font-size: 1.9rem; }
}

@media (max-width: 900px) {
  .spine-grid { grid-template-columns: 1fr; }
  .spine-card p { min-height: 0; }
  .spine-deck { padding-left: 16px; padding-right: 16px; }
}

/* print: kill motion / sticky artifacts + force light */
@media print {
  html, html[data-theme="dark"] {
    color-scheme: light !important;
    --paper: #fff !important;
    --ink: #000 !important;
    --muted: #555 !important;
  }
  .section-nav { position: static !important; backdrop-filter: none !important; }
  .section-label { position: static !important; }
  .page::before { display: none; }
  .theme-toggle { display: none !important; }
  .spine-card.is-dim { opacity: 1 !important; }
  body[data-spine-focus] .spine-target { opacity: 1 !important; filter: none !important; }
  .project-item:hover,
  .featured-visual:hover,
  .entry:hover { transform: none; box-shadow: none; }
}
