/* Shared mobile hardening for ollywest.uk */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { max-width: 100%; overflow-x: hidden; }
img, picture, video, canvas, svg, iframe { max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea, summary { font: inherit; }
a, button, select, summary, [tabindex] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(72, 155, 255, 0.24);
}
:focus-visible { outline: 3px solid #7db8ff; outline-offset: 3px; }

@media (max-width: 900px) {
  :root {
    --nav-h: 88px;
    --page-gutter: clamp(14px, 4vw, 22px);
    --section-space: clamp(32px, 9vw, 52px);
  }
  header.navbar { height: var(--nav-h); padding-inline: 10px; }
  .nav-inner {
    width: 100%;
    min-width: 0;
    min-height: 70px;
    padding-inline: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    background: rgba(59, 47, 47, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }
  .nav-inner::before { display: none; }
  .nav-logo img { width: 70px; height: 70px; }
  .nav-toggle, .contact-btn, .pill, .project-select, .cv-open,
  .back, .social-tabs a, .project-cta, .form-submit, .theme-toggle, footer a { min-height: 44px; }
  .nav-toggle { flex: 0 0 44px; margin-left: 0; }
  .contact-btn {
    min-width: 44px;
    padding: 10px 12px;
    font-size: clamp(.68rem, 2.6vw, .88rem);
    white-space: nowrap;
  }
  .contact-arrow { margin-right: 6px; }
  .nav-links {
    top: calc(50% + 43px);
    left: 10px;
    right: 10px;
    max-height: calc(100dvh - var(--nav-h) - 16px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 8px;
  }
  .grid, .edu, .project-grid, .metric-grid, .drawing-grid, .workflow-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .left, .prose, .edu-list, .edu-detail, .project-content,
  .project-sidebar, .card, section, article { min-width: 0; }
  .tabs { width: 100%; }
  .social-tabs { width: auto; }
  .social-tabs a {
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .pill { padding: 10px 14px; }
  .project-select { min-height: 44px; font-size: 16px; }
  .edu-item { min-height: 72px; }
  .project-card details > summary { min-height: 44px; padding-block: 10px; }
  .project-cta { display: inline-flex; align-items: center; padding-block: 10px; }
  footer a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; }
  .theme-toggle { min-width: 44px; }
  .form-card .link { display: inline-flex; align-items: center; min-height: 44px; }
  .cv-embed { height: min(70dvh, 620px); }
  .project-tags { gap: 8px; }
  .project-tag { overflow-wrap: anywhere; }
  .hero, .edu-hero, .project-card { max-width: 100%; }
  p, li, h1, h2, h3, a { overflow-wrap: anywhere; }
}

@media (max-width: 520px) {
  :root { --nav-h: 78px; }
  header.navbar { height: var(--nav-h); padding-inline: 6px; }
  .nav-inner { min-height: 62px; padding-inline: 8px; }
  .nav-logo img { width: 58px; height: 58px; }
  .contact-btn { padding-inline: 9px; }
  .contact-arrow { display: none; }
  .name, .project-content h1 { font-size: clamp(2rem, 11vw, 2.75rem); }
  .now-seeking { font-size: .75rem; line-height: 1.45; }
  .edu-item, .card, .project-section, .requirementsBox, .contributionBox { padding: 14px; }
  .cv-summary { gap: 12px; }
  .cv-summary-actions { gap: 8px; }
}

@media (max-width: 340px) {
  .contact-btn { width: 44px; font-size: 0; }
  .contact-btn::before { content: "@"; font-size: 1rem; }
}

@media (hover: none) and (pointer: coarse) {
  a:hover, button:hover { transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
