/* Phone-specific rules. Desktop styles and scene rendering stay in their original files. */
.phone-desktop { display: none; }
@media (max-width: 767px), (max-width: 1024px) and (max-height: 600px) and (pointer: coarse) {
  body { -webkit-text-size-adjust: 100%; }
  header .logo img { max-height: 34px; }
  section { padding: 48px 18px; }
  .section-title { margin-bottom: 26px; }
  .section-title h2 { font-size: 25px; margin-bottom: 10px; }
  .hero { min-height: min(720px, 100svh); padding: 92px 20px 190px !important; }
  .hero .avatar { width: 88px; height: 88px; margin-bottom: 22px; }
  .hero h1 { font-size: clamp(24px, 6.6vw, 30px); margin-bottom: 14px; }
  .hero .subtitle { font-size: 15px; margin-bottom: 18px; }
  .hero .description { max-width: 330px; font-size: 14px; line-height: 1.85; margin-bottom: 24px; }
  .hero .btn { display: inline-flex; width: auto; min-height: 42px; align-items: center; justify-content: center; padding: 9px 23px; font-size: 14px; margin: 0 5px; }
  .hero .fall-stage { z-index: 2; height: 160px; inset: auto 10px 12px; width: auto; display: block; padding: 0; pointer-events: none; }
  .hero .fall-item { position: absolute; width: var(--size); height: var(--size); pointer-events: auto; touch-action: none; }
  .hero .fall-item img { width: 100%; height: 100%; object-fit: contain; }
  .about-text h3 { white-space: nowrap; font-size: clamp(11px, 3.6vw, 16px) !important; letter-spacing: -.02em; }
  .about-content { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .about-image { width: 100%; order: -1; display: flex; justify-content: center; }
  .about-image .image-placeholder { width: min(62vw, 218px); height: auto; margin: 0; border-radius: 16px; }
  .about-image .image-placeholder img { display: block; width: 100%; height: auto; border-radius: 16px; }
  .about-image .image-placeholder .resume-hint { left: 0; right: 0; bottom: 0; width: 100%; min-height: 40px; padding: 9px 10px; border-radius: 0 0 16px 16px; font-size: 13px; opacity: 1; pointer-events: auto; }
  .about-text h3 { font-size: 20px; line-height: 1.55; margin-bottom: 16px; }
  .about-text p { font-size: 14px; line-height: 1.9; margin-bottom: 14px; }
  .about-stats { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; margin-top: 22px; }
  .stat-item { padding: 14px 4px; border-radius: 12px; }
  .stat-item .number { font-size: 24px; }
  .stat-item .label { font-size: 12px; }
  .skills-scroll-wrap { width: 100%; overflow-x: auto; overflow-y: hidden; mask-image: none !important; -webkit-mask-image: none !important; cursor: grab; scroll-snap-type: x mandatory; touch-action: pan-x pan-y; }
  .skills-grid { display: flex; gap: 8px; width: max-content; padding: 8px 0 12px; }
  .skill-card { width: var(--phone-card-width, calc((100vw - 52px) / 3)); min-width: 0; flex: 0 0 var(--phone-card-width, calc((100vw - 52px) / 3)); padding: 13px 5px; border-radius: 13px; box-shadow: 0 4px 16px rgba(31,41,55,.055); }
  .skill-card:nth-child(3n + 1) { scroll-snap-align: start; }
  .phone-skills-nav { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 12px; }
  .phone-skills-nav button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #64c9b9; border-radius: 50%; background: #fff; color: #278c7a; }
  .phone-skills-nav button:disabled { opacity: .3; }
  .phone-skills-nav svg { width: 16px; height: 16px; }
  .phone-skills-nav span { font-size: 12px; color: #687d76; min-width: 32px; text-align: center; }
  .skill-card .skill-tilt { height: auto; }
  .skill-card.clone { display: none; }
  .skill-card .skill-icon { width: 36px; height: 36px; padding: 5px; border-radius: 10px; margin-bottom: 8px; }
  .skill-card[data-skill="genai"] .skill-icon, .skill-card[data-skill="ai-agent"] .skill-icon { padding: 5px; }
  .skill-card h3 { font-size: 13px; margin-bottom: 8px; }
  .skill-tags { display: block; font-size: 11px; line-height: 1.85; }
  .skill-tag { display: inline-block; white-space: nowrap; font-size: 11px; line-height: 1.8; padding: 0; margin: 0 2px; border-radius: 0; background: transparent; }
  .skill-card .skill-hint { display: none; }
  .skill-modal-title { font-size: 17px; }
  .skill-modal-icon { width: 32px; height: 32px; flex: 0 0 32px; }
  .floating-logo { width: 40px !important; height: 40px !important; border-radius: 13px; }
  .floating-logo img { width: 38px; height: 38px; }
  #contact.cloud-story { height: auto; min-height: 0; padding: 50px 0 0; }
  #contact .section-title { position: relative; inset: auto; margin: 0 0 24px; }
  #contact .stage { position: relative; top: auto; height: auto; min-height: min(640px, 88svh); padding: 40px 16px 58px; display: flex; align-items: center; justify-content: center; background: linear-gradient(150deg,#eff8ee,#f9e7d9); }
  #contact .stage.has-seam { mask-image: none; -webkit-mask-image: none; }
  #contact .scene, #contact #island-ui, #contact #clouds { display: none !important; }
  .phone-desktop { position: relative; display: block; width: min(100%, 440px); z-index: 2; }
  .phone-monitor { overflow: hidden; border: 7px solid #293438; border-radius: 20px; background: #ffd7b8; box-shadow: 0 16px 38px #29443b26; }
  .phone-monitor-screen { position: relative; min-height: 360px; padding: 19px 12px 58px; background: radial-gradient(ellipse at 90% 100%,#8fd8c6,transparent 70%),linear-gradient(135deg,#ffd7b8,#f6b694); }
  .phone-window { border-radius: 12px; overflow: hidden; background: #fffaf3; box-shadow: 0 5px 20px #6139231a; }
  .phone-titlebar { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 10px 12px; color: white; background: #df7954; }
  .phone-titlebar b { font-size: 14px; font-weight: 600; }
  .phone-window-dots { flex-shrink: 0; display: flex; gap: 4px; }
  .phone-window-dots i { width: 7px; height: 7px; border-radius: 50%; background: #ffcc68; }
  .phone-window-dots i:first-child { background: #ff9582; }
  .phone-window-dots i:last-child { background: #9bd19a; }
  .phone-contact-list { display: grid; gap: 8px; padding: 13px 10px; }
  .phone-contact-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; border-radius: 9px; padding: 10px; background: #fceee3; }
  .phone-contact-row span { display: block; color: #8b7465; font-size: 12px; }
  .phone-contact-row strong { display: block; color: #3b2b24; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
  .phone-contact-row button, .phone-contact-row a, .phone-resume-download { min-height: 38px; border: 0; border-radius: 20px; padding: 8px 12px; font: inherit; font-size: 12px; text-decoration: none; color: white; background: #df7954; cursor: pointer; }
  .phone-screen-switch { display: flex; justify-content: flex-end; padding: 0 12px 12px; }
  .phone-screen-switch button { min-height: 38px; border: 0; border-radius: 20px; padding: 8px 13px; font: inherit; font-size: 12px; color: white; background: #329d85; cursor: pointer; }
  .phone-resume { text-align: center; padding: 25px 12px 18px; }
  .phone-file-icon { display: grid; place-items: center; width: 66px; height: 80px; border-radius: 10px; background: #e0f1e9; color: #25836e; font-weight: 700; font-size: 21px; margin: 0 auto 15px; }
  .phone-resume h3 { font-size: 15px; margin-bottom: 8px; color: #2d3a36; }
  .phone-resume p { font-size: 12px; color: #7f918b; margin-bottom: 20px; }
  .phone-resume-download { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; background: #329d85; font-size: 14px; }
  .phone-taskbar { display: flex; align-items: center; gap: 7px; position: absolute; inset: auto 0 0; padding: 9px; background: #ffffffd9; min-height: 42px; }
  .phone-start { display: grid; grid-template-columns: repeat(2,6px); gap: 2px; margin: 0 4px; }
  .phone-start i { width: 6px; height: 6px; background: #319ce1; }
  .phone-taskbar img { display: block; width: 18px; height: 18px; object-fit: contain; }
  .phone-taskbar time { margin-left: auto; font-size: 11px; color: #52625c; }
  .phone-monitor-stand { margin: 0 auto; width: 70px; height: 17px; background: #354145; clip-path: polygon(32% 0,68% 0,75% 75%,100% 90%,100% 100%,0 100%,0 90%,25% 75%); }
  .phone-desktop-status { min-height: 23px; margin: 15px 0 0; color: #46635b; text-align: center; font-size: 12px; }
  .phone-cloud-curtain { position: absolute; inset: -10px -35px -5px; z-index: 8; display: grid; grid-template-columns: 1fr 1fr; pointer-events: none; overflow: hidden; }
  .phone-cloud-curtain::before, .phone-cloud-curtain::after { content: ''; background: radial-gradient(ellipse at 30% 15%,#fff 0 27%,transparent 28%),radial-gradient(ellipse at 65% 48%,#f5f8f1 0 39%,transparent 40%),radial-gradient(ellipse at 20% 85%,#fff 0 46%,transparent 47%),#f0f6ec; filter: blur(9px); transition: transform 1.3s cubic-bezier(.22,.7,.2,1),opacity 1.3s; }
  .phone-cloud-curtain::after { transform: scaleX(-1); }
  .phone-desktop.is-open .phone-cloud-curtain::before { transform: translateX(-112%); opacity: 0; }
  .phone-desktop.is-open .phone-cloud-curtain::after { transform: translateX(112%) scaleX(-1); opacity: 0; }
  .phone-desktop button:focus-visible, .phone-desktop a:focus-visible { outline: 2px solid #226c5c; outline-offset: 3px; }
  @media (prefers-reduced-motion: reduce) { .phone-cloud-curtain::before,.phone-cloud-curtain::after { transition: none; } }
}

@media (max-width: 767px), (max-width: 1024px) and (max-height: 600px) and (pointer: coarse) {
  .phone-monitor { border-width: 6px; border-radius: 13px; }
  .phone-monitor-screen { min-height: 0; aspect-ratio: 4 / 3; padding: 8px 8px 30px; }
  .phone-window { height: 100%; display: flex; flex-direction: column; border-radius: 7px; }
  .phone-window[hidden] { display: none; }
  .phone-titlebar { min-height: 27px; padding: 5px 8px; gap: 6px; flex-shrink: 0; }
  .phone-titlebar b { font-size: 12px; }
  .phone-window-dots { gap: 3px; }
  .phone-window-dots i { width: 5px; height: 5px; }
  .phone-contact-list { flex: 1; gap: 4px; padding: 6px; }
  .phone-contact-row { gap: 4px; padding: 4px 6px; border-radius: 5px; }
  .phone-contact-row > div { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .phone-contact-row span { font-size: 10px; flex-shrink: 0; }
  .phone-contact-row strong { font-size: 12px; }
  .phone-contact-row button, .phone-contact-row a { min-height: 28px; padding: 4px 8px; font-size: 11px; }
  .phone-screen-switch { padding: 0 7px 6px; flex-shrink: 0; }
  .phone-screen-switch button { min-height: 27px; padding: 4px 9px; font-size: 11px; }
  .phone-taskbar { min-height: 24px; padding: 5px 7px; gap: 6px; }
  .phone-taskbar img { width: 14px; height: 14px; }
  .phone-taskbar time { font-size: 10px; }
  .phone-resume { flex: 1; padding: 8px; display: grid; grid-template-columns: 40px 1fr; align-content: center; align-items: center; gap: 5px 10px; }
  .phone-file-icon { grid-row: span 2; width: 36px; height: 45px; font-size: 13px; margin: 0; }
  .phone-resume h3 { font-size: 12px; margin: 0; text-align: left; }
  .phone-resume p { font-size: 10px; margin: 0; text-align: left; }
  .phone-resume-download { grid-column: 1 / -1; justify-self: center; min-height: 30px; padding: 5px 15px; font-size: 12px; }
}
