/* Mobile UI (<= 760px). Desktop layout lives in style.css. */

@media (max-width: 760px) {
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
    font-size: 15px;
  }
  [id] { scroll-margin-top: 70px; }
  .wrap { padding: 0 18px; }
  .page-back { margin-bottom: 14px; }
  .project-topbar { gap: 10px 12px; margin-bottom: 14px; }
  .project-demo { min-height: 44px; }
  .back-home { min-height: 44px; padding: 10px 16px; }

  /* ---------- mobile chrome ---------- */
  .site-nav { display: none; }
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: env(safe-area-inset-top) 18px 0;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }
  .mobile-brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    color: var(--navy);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
  }
  .mobile-brand span {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .mobile-contact-pill {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--navy);
    font-size: 12px;
    font-weight: 600;
  }
  .mobile-contact-pill svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
  }
  .mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: 4px 0;
    color: #7a8694;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
  }
  .mobile-tab svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-tab.active { color: var(--navy); }
  .mobile-tab.kitchen { color: #9a6a52; }
  .mobile-tab.kitchen.active { color: var(--warm); }

  body.kitchen-page .mobile-topbar,
  body.kitchen-page .mobile-tabbar {
    background: rgba(251, 244, 234, 0.97);
    border-color: var(--warm-line);
  }
  body.kitchen-page .mobile-brand { color: var(--warm-deep); }
  body.kitchen-page .mobile-contact-pill {
    border-color: var(--warm-line);
    background: #fffaf3;
    color: var(--warm-deep);
  }

  /* ---------- hero + contact ---------- */
  .hero {
    padding: 26px 0 34px;
    background: linear-gradient(180deg, #fff 0%, #f4f8fd 100%);
  }
  .hero .wrap {
    display: flex;
    flex-direction: column;
    gap: 22px;
  }
  .hero-top { display: contents; }
  .hero-id { order: 1; }
  .eyebrow {
    margin-bottom: 8px;
    font-size: 11px;
    letter-spacing: 0.14em;
  }
  .hero h1 {
    font-size: 46px;
    line-height: 1.04;
    letter-spacing: -0.025em;
  }
  .hero-role { margin-top: 10px; font-size: 16px; }
  .hero-index {
    order: 3;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
  .hero-index-item {
    grid-template-columns: 24px minmax(0, 1fr) 18px;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(18, 35, 59, 0.04);
  }
  .hero-index-body b { font-size: 15px; white-space: normal; }
  .hero-index-body small { font-size: 11px; white-space: normal; }
  .hero-contact {
    order: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0;
    border: 0;
  }
  .hero-contact-label {
    grid-column: 1 / -1;
    margin: 0 0 2px;
    font-size: 11px;
  }
  .hero-contact-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font-size: 12px;
  }
  .hero-contact-row:last-of-type { border-bottom: 1px solid var(--line); }
  .hero-contact-row span:first-child {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 10.5px;
    letter-spacing: 0.06em;
  }
  .hero-contact-row a,
  .hero-contact-value {
    text-align: left;
    font-size: 12.5px;
    line-height: 1.4;
    word-break: break-all;
  }
  .hero-contact-note {
    grid-column: 1 / -1;
    margin: 4px 0 0;
    font-size: 11px;
  }

  /* ---------- work cards ---------- */
  .work-intro { padding: 38px 0 2px; }
  .work-intro-inner { display: block; }
  .work-intro h2 { font-size: 32px; }
  .work-intro-copy .section-note {
    margin: 8px 0 8px;
    font-size: 14px;
    line-height: 1.7;
  }
  .page-hero { padding: 32px 0 6px; }
  .page-hero-inner { display: block; }
  .page-hero h1 { font-size: 40px; }
  .page-hero .lede {
    margin-top: 10px;
    font-size: 14.5px;
    line-height: 1.7;
  }
  .work-list { padding-bottom: 8px; }
  .work-feature {
    margin: 0 18px 16px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(18, 35, 59, 0.06);
  }
  .work-feature-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: none;
    padding: 0;
  }
  .work-feature-media {
    order: 0;
    aspect-ratio: 16 / 10;
    border: 0;
    border-radius: 0;
    background: #eef2f6;
  }
  .work-feature.reverse .work-feature-media { order: 0; }
  .work-feature.reverse .work-feature-body { order: 1; }
  .work-feature-body { order: 1; padding: 20px 18px 18px; }
  .work-feature-kicker { margin-bottom: 6px; font-size: 11px; }
  .work-feature h2 {
    margin-bottom: 10px;
    font-size: 28px;
    letter-spacing: -0.01em;
  }
  .work-feature-summary {
    margin-bottom: 14px;
    font-size: 14.5px;
    line-height: 1.7;
  }
  .work-feature-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 14px;
    padding: 12px 0;
  }
  .work-feature-facts span {
    padding: 0 8px;
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
  }
  .work-feature-facts span:first-child { padding-left: 0; }
  .work-feature-facts span:last-child { padding-right: 0; }
  .work-feature-meta { margin-bottom: 12px; font-size: 12px; }
  .work-feature .tags {
    flex-wrap: nowrap;
    margin: 0 -18px 16px;
    padding: 0 18px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .work-feature .tags::-webkit-scrollbar { display: none; }
  .work-feature .tag { flex: 0 0 auto; }
  .work-feature-link {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--navy);
    border-radius: 10px;
    background: var(--navy);
    color: #fff;
    font-size: 14px;
  }
  .work-feature-link:hover {
    border-color: var(--navy-soft);
    background: var(--navy-soft);
    color: #fff;
  }

  /* ---------- resume teaser ---------- */
  .resume-teaser {
    padding: 22px 18px;
    background: #eaf2fc;
  }
  .resume-teaser-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 26px 20px;
    border-radius: 20px;
    background: var(--navy);
    color: #fff;
    box-shadow: 0 18px 40px rgba(18, 35, 59, 0.18);
  }
  .resume-teaser .eyebrow { color: #8fc0ff; }
  .resume-teaser h2 { color: #fff; font-size: 32px; }
  .resume-teaser-headline {
    margin: 10px 0 6px;
    color: #fff;
    font-size: 18px;
  }
  .resume-teaser-text {
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
  }
  .resume-teaser-actions { margin-bottom: 18px; }
  .resume-teaser-actions .btn-primary {
    width: 100%;
    min-height: 44px;
    border-color: #fff;
    border-radius: 10px;
    background: #fff;
    color: var(--navy);
  }
  .resume-teaser-side { border-top: 1px solid rgba(255, 255, 255, 0.18); }
  .resume-fact {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 0;
    border-bottom-color: rgba(255, 255, 255, 0.16);
  }
  .resume-fact-label { color: #8fc0ff; }
  .resume-fact-body b { color: #fff; font-size: 13.5px; }
  .resume-fact-body span { color: rgba(255, 255, 255, 0.68); font-size: 12px; }

  /* ---------- kitchen carousel ---------- */
  .kitchen-teaser { padding: 40px 0 30px; }
  .kitchen-teaser .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 18px;
  }
  .kitchen-teaser .section-head h2 { font-size: 30px; }
  .swipe-hint {
    display: block;
    margin: -8px 0 8px;
    color: #a07a62;
    font-size: 11px;
    letter-spacing: 0.04em;
  }
  .dish-strip {
    display: flex;
    gap: 14px;
    margin: 0 -18px;
    padding: 2px 18px 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .dish-strip::-webkit-scrollbar { display: none; }
  .dish-strip .dish-card {
    flex: 0 0 79%;
    scroll-snap-align: start;
  }

  /* ---------- project detail ---------- */
  .project { padding: 18px 0 28px; }
  .project .wrap.narrow { padding: 0 18px; }
  .back-link { margin-bottom: 16px; }
  .project-hero h1 { font-size: 34px; }
  .project-hero .lede { font-size: 15px; line-height: 1.7; }
  .project-meta { font-size: 12px; }
  .project-cover {
    margin: 20px -18px 24px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }
  .project-cover img { max-height: none; }
  .prose { font-size: 16px; line-height: 1.85; }
  .prose h2 { margin-top: 34px; font-size: 22px; }
  .prose h3 { font-size: 18px; }
  .prose .table-wrap,
  .report-body .table-wrap {
    margin-right: -18px;
    margin-left: -18px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-grid b { font-size: 24px; }
  .actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .actions .btn { width: 100%; }

  /* ---------- resume page ---------- */
  .resume {
    max-width: none;
    padding: 18px 18px 28px;
  }
  .resume-header {
    margin-bottom: 14px;
    padding: 24px 20px;
    border: 0;
    border-radius: 20px;
    background: var(--navy);
  }
  .resume-header h1 { color: #fff; font-size: 34px; }
  .resume-headline { margin-top: 6px; color: #cfe2fb; font-size: 15px; }
  .resume-contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
  }
  .resume-contact > span,
  .resume-contact > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    font-size: 12px;
    word-break: break-all;
  }
  .resume-contact > a[href^="mailto:"] {
    order: 1;
    grid-column: 1 / -1;
  }
  .resume-contact > a[href^="tel:"] { order: 2; }
  .resume-contact > span:first-child { order: 3; }
  .resume-contact > span:last-child {
    order: 4;
    grid-column: 1 / -1;
  }
  .resume-contact a { color: #fff; font-weight: 600; }
  .copy-btn {
    border-color: rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #cfe2fb;
  }
  .resume-availability {
    display: inline-flex;
    margin-top: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(180, 95, 60, 0.24);
    color: #ffd9c7;
    font-size: 12px;
  }
  .resume-section {
    margin-top: 12px;
    padding: 18px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
  }
  .resume-section h2 {
    margin-bottom: 14px;
    padding: 0;
    border: 0;
    font-size: 11px;
    letter-spacing: 0.16em;
  }
  .resume-item {
    margin-bottom: 16px;
    padding-left: 14px;
    border-left: 2px solid #dbe7f5;
  }
  .resume-item:last-child { margin-bottom: 0; }
  .resume-item-head { flex-direction: column; gap: 1px; }
  .resume-item h3 { font-size: 15.5px; }
  .resume-item .period { white-space: normal; font-size: 12px; }
  .resume-item .role { font-size: 13px; }
  .resume-item ul { padding-left: 18px; }
  .resume-item li { font-size: 14px; }
  .resume-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    list-style: none;
  }
  .resume-list li {
    margin: 0;
    padding: 6px 10px;
    border: 1px solid #dbe7f5;
    border-radius: 999px;
    background: #f3f8fe;
    font-size: 14px;
  }

  /* ---------- report pages ---------- */
  .report-header { padding: 26px 0 20px; }
  .report-header h1 { font-size: 30px; }
  .report-header .subtitle { margin-top: 10px; font-size: 15px; }
  .report-header .byline { font-size: 12px; }
  .report-header .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 18px;
  }
  .report-header .actions .btn { width: 100%; }
  .report-header .actions .btn:last-child { grid-column: 1 / -1; }
  .report-note { font-size: 11.5px; line-height: 1.6; }
  .report-layout { padding: 16px 18px 30px; }
  .toc-mobile { margin-bottom: 18px; }
  .report-body { font-size: 16px; line-height: 1.9; }
  .report-body p { text-align: left; }
  .report-body h1 { margin-top: 40px; font-size: 24px; }
  .report-body h1:first-of-type { margin-top: 8px; }
  .report-body h2 { margin-top: 30px; font-size: 20px; }
  .report-body h3 { font-size: 17px; }
  .report-body table { font-size: 11.5px; }
  .report-body th,
  .report-body td { padding: 6px 7px; }
  .report-body figure.fig { margin: 20px 0; }
  .report-body figure.fig img { width: 100%; }

  /* ---------- kitchen pages ---------- */
  .kitchen-hero { padding: 34px 0 24px; }
  .kitchen-hero h1 { font-size: 44px; }
  .kitchen-lede { margin-top: 12px; font-size: 15px; line-height: 1.7; }
  .kitchen-grid-wrap { padding: 18px 0 30px; }
  .kitchen-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .kitchen-grid .dish-card { border-radius: 18px; }
  .dish-detail { padding: 22px 18px 30px; }
  .dish-detail h1 { font-size: 38px; }
  .dish-photo {
    margin: 0 -18px 20px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }
  .dish-lede { font-size: 15.5px; }
  .warm-prose { font-size: 15.5px; }

  /* ---------- footer + 404 ---------- */
  .site-footer { padding: 22px 0 10px; font-size: 12px; }
  .footer-inner { flex-direction: column; gap: 4px; }
  .notfound { padding: 60px 0 40px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 43px; }
  .hero-contact-row { padding: 10px 11px; }
  .work-feature-facts span { padding: 0 6px; font-size: 11.5px; }
  .resume-fact { grid-template-columns: 42px minmax(0, 1fr); gap: 10px; }
  .dish-strip .dish-card { flex-basis: 84%; }
  .page-hero h1 { font-size: 36px; }
  .kitchen-hero h1 { font-size: 40px; }
}

@media (max-width: 360px) {
  .hero-contact-row:first-of-type,
  .hero-contact-row:last-of-type { grid-column: 1 / -1; }
}
