/* Responsive composition and contact affordances. Palette lives in home.css. */
.hero { grid-template-columns: 1.35fr .75fr; gap: 72px; padding-block: 68px 54px; }
.hero-copy h1 { font-size: 1.1rem; letter-spacing: -.02em; margin: 22px 0; }
.hero-copy h1 .hero-statement { font-size: clamp(3.1rem, 5.4vw, 4.8rem); letter-spacing: -.055em; line-height: 1.05; margin-top: 16px; }
.hero-kicker { margin-top: 24px; font-size: .68rem; }
.hero-text { max-width: 530px; }
.hero-portrait { max-width: 370px; width: 100%; justify-self: end; }
.portrait-frame { box-shadow: 14px 14px 0 #192a56; }
.portrait-card { margin-right: 0; }
.projects-intro { color: var(--muted); max-width: 640px; font-size: 1.05rem; line-height: 1.75; margin: 0 0 30px; }
.project-grid-featured { gap: 24px; }
.project-grid-featured .project-card-hero { grid-template-columns: 1.15fr 1fr; gap: 36px; padding: 32px; align-items: center; }
.project-featured-media { min-width: 0; display: grid; gap: 14px; }
.project-featured-media img { aspect-ratio: auto; height: auto; max-height: none; border: 1px solid #52658b; border-radius: 8px; box-shadow: 0 16px 32px #0002; }
.project-featured-media > span { font-size: .7rem; color: #d5dff2; letter-spacing: .05em; }
.project-hero-main { gap: 16px; }
.project-hero-main h3 { font-size: clamp(2rem, 3vw, 3rem); }
.project-card-hero .project-hero-side { border-left: 0; border-top: 1px solid #415077; padding: 20px 0 0; margin-top: 8px; }
.project-highlights { line-height: 1.65; }
.project-card { grid-auto-rows: min-content; }
.project-grid-featured .project-card-primary { display: flex; flex-direction: column; gap: 18px; }
.project-grid-featured .project-card-primary .project-actions { margin-top: auto; }
.project-image-pair { gap: 8px; margin: 0 0 6px; background: #edf0f5; border-radius: 8px; padding: 8px; }
.project-image-pair img { aspect-ratio: auto; height: auto; align-self: center; }
.project-card p, .panel p { text-wrap: pretty; }
.project-grid-secondary .project-card { display: flex; flex-direction: column; }
.project-grid-secondary .project-card img { order: -1; }
.contact-grid { grid-template-columns: 1.4fr .8fr; }
.contact-panel { padding: 36px; }
.contact-panel h3 { max-width: 600px; font-size: clamp(2rem, 3.8vw, 3.3rem); letter-spacing: -.05em; }
.contact-panel.accent h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.contact-email { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; overflow-wrap: anywhere; font-weight: 600; color: var(--text) !important; }
.copy-email { cursor: pointer; color: var(--accent); background: #edf3ff; border: 1px solid #bdcfee; padding: 10px 14px; border-radius: 7px; font: inherit; font-size: .8rem; min-height: 44px; }
.copy-email:hover { background: #dce8ff; }
.copy-status { margin: 0; font-size: .85rem !important; }
.copy-status:empty { display: none; }
.mobile-contact-bar { display: none; }
.nav-links a, .filter-button, .project-actions a, .contact-links a { min-height: 44px; display: inline-flex; align-items: center; }
.nav-links a { position: relative; }
.nav-links a::after { content: ''; position: absolute; bottom: 4px; left: 0; width: 0; height: 2px; background: var(--accent); transition: width .2s; }
.nav-links a:hover::after, .nav-links a:focus-visible::after { width: 100%; }
@media (min-width: 821px) and (max-width: 1100px) {
  .hero { grid-template-columns: 1.3fr .8fr; gap: 36px; }
  .hero-copy h1 { font-size: 1.1rem; }
  .hero-copy h1 .hero-statement { font-size: clamp(3rem, 5.8vw, 4rem); }
  .project-grid-featured .project-card-hero { grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-block: 40px; }
  .hero-copy h1 { font-size: 1rem; }
  .hero-copy h1 .hero-statement { font-size: clamp(2.8rem, 8vw, 4rem); }
  .hero-portrait { justify-self: center; max-width: 320px; }
  .site-nav { flex-wrap: wrap; }
  .site-header { padding-block: 10px 6px; }
  .nav-links { padding-top: 4px; }
  .nav-links a { padding-inline: 5px; }
  .project-grid-featured .project-card-hero { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
  .project-featured-media { order: 0; }
  .project-featured-media img { max-height: 460px; object-fit: contain; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-panel { padding: 26px; }
}
@media (max-width: 600px) {
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .section-shell, .site-footer { width: calc(100% - 40px); }
  .hero { position: relative; padding-top: 32px; }
  .hero-copy .eyebrow { max-width: calc(100% - 84px); }
  .eyebrow-pill { font-size: .67rem; line-height: 1.5; border-radius: 8px; }
  .eyebrow-pill::before { flex-shrink: 0; }
  .hero-kicker { margin-top: 22px; max-width: calc(100% - 84px); font-size: .6rem; line-height: 1.6; }
  .hero-copy h1 { margin-top: 24px; }
  .hero-copy h1 .hero-statement { font-size: clamp(2.5rem, 9.8vw, 3.5rem); }
  .hero-portrait { position: absolute; right: 6px; top: 32px; width: 64px; padding: 0; }
  .portrait-frame { width: 64px; height: 76px; aspect-ratio: auto; border-radius: 12px; box-shadow: 5px 5px 0 #192a56; }
  .portrait-frame img { border-radius: 12px; object-position: center 15%; }
  .portrait-chip, .portrait-card { display: none; }
  .hero-text { margin-bottom: 22px; font-size: .98rem; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero-actions .button { padding: 14px 10px; font-size: .8rem; }
  .hero-actions .button span { margin-left: 4px; }
  .hero-meta { gap: 10px; }
  .hero-meta span { font-size: .7rem; }
  .stats-strip { border-radius: 10px; }
  .stat-card { padding: 18px 14px; }
  .stat-card strong { font-size: .86rem; }
  .stat-card span { font-size: .72rem; }
  .section-heading h2 { font-size: 2.2rem; }
  .filter-bar { gap: 6px; }
  .filter-button { padding: 8px 12px; font-size: .76rem; }
  .projects-intro { font-size: .95rem; }
  .project-grid-featured .project-card-hero { padding: 20px; gap: 22px; }
  .project-topline { font-size: .62rem; line-height: 1.6; }
  .project-card p { font-size: .92rem; }
  .project-actions { gap: 8px; }
  .project-status { line-height: 1.5; }
  .project-image-pair { grid-template-columns: 1fr; }
  .project-grid-featured .project-card-primary { padding: 20px; }
  .other-projects-toggle { padding-inline: 18px; }
  .other-projects-hint { padding-inline: 18px; }
  .contact-panel { padding: 24px; }
  .contact-email { font-size: .9rem !important; }
  .contact-links { gap: 8px; }
  .contact-links a { padding: 12px; font-size: .85rem; }
  .mobile-contact-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); background: #f7f8faf5; backdrop-filter: blur(14px); border-top: 1px solid #d5dce7; }
  .mobile-contact-bar a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 46px; padding: 12px 16px; background: #2563eb; color: #fff; border-radius: 8px; text-decoration: none; font-size: .8rem; font-weight: 700; }
  .mobile-contact-bar a + a { color: #192a56; background: #e8edf6; }
  .site-footer { margin-bottom: 24px; }
  .timeline { padding-left: 12px; }
  .timeline-content { margin-left: 18px; padding: 20px; }
  .timeline-content h3 { overflow-wrap: anywhere; }
}
@media (hover: none) { .project-card:hover { transform: none; } }

/* Native scrolling keeps touch, trackpad and no-script browsing available. */
.carousel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.carousel-hint { margin: 0; font-size: .82rem; color: var(--muted); }
.carousel-controls { display: flex; align-items: center; gap: 12px; }
.carousel-arrow { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; color: var(--text); font-size: 1.25rem; cursor: pointer; }
.carousel-arrow:hover:not(:disabled) { background: #edf3ff; border-color: var(--accent); color: var(--accent); }
.carousel-arrow:disabled { opacity: .35; cursor: default; }
.carousel-position { min-width: 64px; text-align: center; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.project-grid-secondary.carousel-track { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc((100% - 48px) / 2.25); gap: 24px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 5px 2px 18px; scrollbar-width: thin; scrollbar-color: #a4b4d0 #e8edf6; }
.carousel-track > .project-card { scroll-snap-align: start; min-width: 0; }
.carousel-track:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 12px; }
@media (max-width: 820px) {
  .project-grid-secondary.carousel-track { grid-auto-columns: 70%; gap: 18px; }
}
@media (max-width: 600px) {
  .project-grid-secondary.carousel-track { grid-auto-columns: 88%; gap: 14px; }
  .carousel-toolbar { align-items: start; }
  .carousel-hint { max-width: 100px; line-height: 1.6; }
  .carousel-controls { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .carousel-track { scroll-behavior: auto; }
}

/* GitHub API data: readable loading, cached and unavailable states. */
.github-data-note, .github-data-status { margin: 0; color: var(--muted); font-size: .78rem !important; line-height: 1.65 !important; }
.github-data-status { min-height: 2.6em; }
.github-recent-list { display: grid; gap: 0; padding: 0; margin: 0; list-style: none; }
.github-recent-list li { padding: 18px 0; border-top: 1px solid var(--line); }
.github-recent-list a { color: var(--accent); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; line-height: 1.6; }
.github-recent-list a:hover { text-decoration: underline; }
.github-recent-list p { margin: 8px 0 0; font-size: .88rem; line-height: 1.65; color: var(--muted); }
.github-repo-language { display: inline-block; margin: 6px 0 0 10px; color: var(--muted); font-size: .72rem; }
.stats-mini strong { color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 820px) { .stats-panel .stats-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Native disclosure keeps case studies readable without adding page clutter. */
.project-case { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 6px; min-width: 0; }
.project-card-hero > .project-case { grid-column: 1 / -1; margin-top: 0; }
.project-case summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; cursor: pointer; font-size: .92rem; font-weight: 700; color: var(--text); list-style: none; }
.project-case summary::-webkit-details-marker { display: none; }
.project-case summary span { transition: transform .2s ease; }
.project-case[open] summary span { transform: rotate(90deg); }
.project-case summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.project-case-content { max-width: 760px; padding: 4px 0 10px; }
.project-case-content h4 { margin: 20px 0 6px; color: var(--text); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.project-case-content p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.8; }
.project-case-content a { display: inline-flex; align-items: center; min-height: 44px; margin-top: 18px; color: var(--accent); font-size: .85rem; font-weight: 600; text-underline-offset: 4px; }
.project-card-hero .project-case-content a { color: #d5dff2; }
.project-card-hero .project-case summary:focus-visible { outline-color: #b7cdff; }
@media (prefers-reduced-motion: reduce) { .project-case summary span { transition: none; } }

/* Explicit flips: touch and keyboard controls, automatic height, readable no-script fallback. */
.project-grid-featured .project-card.project-flippable { display: block; position: relative; perspective: 1600px; }
.project-flip-front, .project-flip-back { min-width: 0; width: 100%; backface-visibility: hidden; transition: transform .48s ease, opacity .24s ease; transform-origin: center; }
.project-flip-front { display: flex; flex-direction: column; gap: 18px; transform: rotateY(0); }
.project-card-hero .project-flip-front { display: grid; grid-template-columns: 1.15fr 1fr; gap: 32px; align-items: center; }
.project-flip-back { position: absolute; inset: 0; visibility: hidden; opacity: 0; transform: rotateY(-180deg); }
.project-flippable.is-flipped .project-flip-front { position: absolute; inset: 0; visibility: hidden; opacity: 0; transform: rotateY(180deg); }
.project-flippable.is-flipped .project-flip-back { position: relative; visibility: visible; opacity: 1; transform: rotateY(0); }
.project-flip-back h3 { margin: 24px 0 8px; font-size: clamp(1.35rem, 3vw, 2rem); }
.project-flip-back .project-case-content { max-width: none; }
.project-flip-control { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; width: 100%; padding: 14px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; text-align: left; }
.project-card-hero .project-flip-control { grid-column: 1 / -1; }
.project-flip-control span { font-size: 1.4rem; }
.project-flip-control:hover { text-decoration: underline; text-underline-offset: 5px; }
.project-flip-control:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.project-card-hero .project-flip-control:focus-visible { outline-color: #b7cdff; }
@media (max-width: 820px) { .project-card-hero .project-flip-front { grid-template-columns: 1fr; gap: 24px; } }
@media (prefers-reduced-motion: reduce) { .project-flip-front, .project-flip-back { transition: none; transform: none !important; } }

/* Current product imagery first, design history available on request. */
.project-current-preview { margin: 0 0 18px; order: -1; min-width: 0; }
.project-current-preview a { display: block; border-radius: 8px; }
.project-current-preview img { display: block; width: 100%; height: auto; max-height: none; aspect-ratio: 1348 / 926; object-fit: contain; border-radius: 8px; }
.project-current-preview figcaption, .project-design-history figcaption { color: var(--muted); font-size: .72rem; line-height: 1.7; margin-top: 8px; }
.project-design-history { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
.project-design-history summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; color: var(--text); font-size: .82rem; font-weight: 600; list-style: none; }
.project-design-history summary::-webkit-details-marker { display: none; }
.project-design-history figure { margin: 12px 0 0; }
.project-design-history img { width: 100%; height: auto; max-height: none; object-fit: contain; }
.project-design-history summary:focus-visible, .project-current-preview a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.project-grid-secondary.carousel-track { align-items: start; }

/* Real app screenshots: consistent previews without cropping out the interface. */
.project-card .project-card-preview { order: -1; grid-column: 1 / -1; min-width: 0; width: 100%; margin: 0 0 10px; }
.project-card-preview > a { display: block; aspect-ratio: 3 / 2; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #f1f3f7; }
.project-card .project-card-preview img { display: block; width: 100%; height: 100%; aspect-ratio: auto; max-height: none; margin: 0; border: 0; border-radius: 0; object-fit: contain; }
.project-card-preview--compact img { transform: scale(1.65); }
.project-card-preview figcaption { margin-top: 8px; color: var(--muted); font-size: .68rem; line-height: 1.6; }
.project-card-preview > a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
@media (hover: hover) { .project-card-preview > a:hover { border-color: var(--accent); } }
