/* Phone layout (loaded last). Colours, type and motion are the desktop ones; only the placement changes.
   Phones: max-width 639px. The journey grid also covers small tablets (up to 899px).
   Spacing scale on phones: 1.25rem side gutter, 3.5rem between sections, 1rem inside groups.
   Small text never goes under 12px (11px for the uppercase labels). */

/* desktop never shows the phone-only parts */
.menu-btn,.drawer-head,.drawer-foot,.nav-ic,.nav-chev,.menu-scrim,.svc-cat-arrow{display:none}

@media (max-width:639px){
  :root{--gutter:1.5rem;--section:4.5rem}
  .shell{padding-inline:var(--gutter)}

  /* ---------- menu: button top left, a drawer sliding in from the left ---------- */
  .hdr{flex-wrap:nowrap;justify-content:flex-start;padding:1.25rem var(--gutter) .5rem}
  .menu-btn{display:grid;gap:.42rem;width:2.5rem;padding:.55rem 0;background:none;border:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
  .menu-btn span{display:block;height:1.5px;width:100%;background:#111}
  .menu-scrim{display:block;position:fixed;inset:0;z-index:110;background:rgba(10,10,10,.45);opacity:0;visibility:hidden;transition:opacity .3s var(--ease-out),visibility 0s .3s}
  .menu-open .menu-scrim{opacity:1;visibility:visible;transition-delay:0s}
  .hdr nav{order:0;position:fixed;top:0;left:0;bottom:0;right:auto;z-index:120;width:min(82vw,21rem);height:100dvh;display:flex;flex-direction:column;padding:1.25rem 1.25rem 1.5rem;overflow:hidden;border:0;border-radius:0 1.5rem 1.5rem 0;background:#fff;box-shadow:1rem 0 3rem rgba(0,0,0,.12);transform:translateX(-100%);visibility:hidden;opacity:1;transition:transform .38s var(--ease-out),visibility 0s .38s}
  .menu-open nav{transform:none;visibility:visible;transition-delay:0s}
  .drawer-head{display:flex;align-items:center;justify-content:flex-start;padding-bottom:1.25rem}
  .drawer-close{display:grid;place-items:center;width:2.25rem;height:2.25rem;border:1px solid var(--line);border-radius:50%;background:#fff;color:#111;cursor:pointer}
  .nav-list{flex-direction:column;gap:.25rem;font-size:1.05rem;font-weight:500}
  .nav-item{display:flex;align-items:center;gap:.9rem;width:100%;padding:.85rem .5rem;border-radius:.9rem;text-align:left;color:#111;-webkit-tap-highlight-color:transparent}
  .nav-item:active{background:var(--surface)}
  .nav-ic{display:grid;place-items:center;color:#111}
  .nav-item .hov{flex:1;opacity:1}
  .nav-chev{display:block;opacity:.4}
  .drawer-foot{display:flex;align-items:center;gap:.8rem;margin-top:auto;padding-top:1.1rem;border-top:1px solid var(--line)}
  .drawer-avatar{width:2.75rem;height:2.75rem;border-radius:50%;object-fit:cover;object-position:center top;background:var(--surface)}
  .drawer-foot b{display:block;font-size:.95rem;font-weight:600}
  .drawer-foot span{display:block;margin-top:.1rem;font-size:max(12px,.75rem);color:var(--muted)}

  /* ---------- hero: headline, rating and buttons on the left, quote and text below, big photo cropped by the right edge ---------- */
  .hero{min-height:0;border-radius:0 0 1.5rem 1.5rem}
  .hero .shell{padding-inline:var(--gutter)}
  .hero-grid{min-height:0;gap:1.1rem;padding-top:4.5rem;padding-bottom:2rem}
  .hero-left{gap:.85rem}
  .h1{max-width:none;font-size:2rem}
  .rating{gap:.5rem;font-size:max(12px,.7rem)}
  .rating .stars{font-size:.8rem}
  .cta-row{gap:.35rem;flex-wrap:nowrap}
  .cta-row .pill{padding:.3rem .5rem;font-size:max(11px,.62rem);white-space:nowrap;gap:.3rem}
  .cta-row .pill-badge{width:1.25rem;height:1.25rem}
  .hero-right{width:46%;gap:.65rem;padding:.6rem .6rem .6rem 0;margin-left:-.1rem;border-radius:.6rem;background:linear-gradient(90deg,rgba(247,246,245,.92) 70%,rgba(247,246,245,0))}
  .hero-roles{font-size:1.2rem}
  .hero-desc{max-width:none;font-size:max(12px,.7rem);line-height:1.5}
  .liquid #heroBase{top:auto;bottom:0;left:auto;right:-70%;width:auto;max-width:none;height:calc(100vw * 1.3)}
  .status{display:none}

  /* ---------- about: label, big title, statement, then links and the button on one row ---------- */
  .about .shell{grid-template-columns:1fr;align-items:start;gap:1.75rem;padding-block:var(--section)}
  .globe-block{min-height:0}
  .about-big-wrap{position:static;margin-top:1.5rem}
  .about-big{font-size:3.3rem}
  .about-right{gap:1.5rem}
  .about-title{font-size:1.05rem;line-height:1.45}
  .about-foot{flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:nowrap;gap:.75rem;padding-top:1.1rem}
  .about-foot .lbl{margin-bottom:.4rem;font-size:max(12px,.7rem)}
  .about-foot .pill{padding:.45rem .8rem;font-size:max(12px,.68rem);white-space:nowrap}
  .about-foot .pill-badge{width:1.4rem;height:1.4rem}
  .about-foot .social{transform:scale(.72);transform-origin:left center;margin-right:-.7rem}

  /* ---------- icon strip: small tiles so many show at once ---------- */
  .marquee{width:100%;max-width:none}
  .mq-track{gap:.55rem;padding-right:.55rem}
  .mq-item{width:2.6rem;height:2.6rem;border-radius:.65rem}
  .mq-ico{width:1.25rem;height:1.25rem}

  /* ---------- projects: compact cards, the description lives on the project page ---------- */
  .works .shell{padding-block:var(--section)}
  .card-grid{margin-top:1.75rem;gap:1rem}
  .card-inner,.card-inner:has(.card-video){min-height:0;padding:1.1rem;border-radius:1.25rem}
  .card-inner:has(.card-video){min-height:12.5rem}
  .card-inner:has(.card-video)::before{background:linear-gradient(0deg,#fff 0%,#fff 38%,rgba(255,255,255,.78) 62%,rgba(255,255,255,.1) 100%)}
  .card-meta{font-size:11px}
  .card-body{left:1.1rem;right:1.1rem;bottom:1.1rem}
  .pc-title{font-size:1.2rem}
  .pc-desc{display:none}
  .card-tags{display:flex;flex-wrap:wrap;margin-top:.5rem;gap:.35rem}
  .card-tags .tag{padding:.25rem .65rem;font-size:max(12px,.68rem)}
  .card-badge{width:2rem;height:2rem}

  /* ---------- journey: only after "More about me" ---------- */
  .journey{display:none}
  .journey.is-open{display:block}

  /* ---------- core skills: collapsed categories, plain rows, coloured icons, no hover ---------- */
  .skills .shell{padding-block:var(--section)}
  .skills h2{margin:1rem 0 1.5rem}
  .svc-group{border-top:1px solid #e6e5e2}
  .svc-group:last-child{border-bottom:1px solid #e6e5e2}
  .svc-cat{display:flex;align-items:center;justify-content:space-between;margin:0;padding:1.1rem 0;font-size:max(12px,.72rem);cursor:pointer;-webkit-tap-highlight-color:transparent}
  .svc-cat-arrow{display:grid;place-items:center;width:2.1rem;height:2.1rem;border-radius:var(--radius-pill);background:#0a0a0a;color:#fff;font-size:.75rem;transition:transform .3s var(--ease-out)}
  .svc-group.open .svc-cat-arrow{transform:rotate(45deg)}
  .svc-group .svc-list{display:none;padding-bottom:.5rem}
  .svc-group.open .svc-list{display:block}
  .svc-row,.svc-row:hover{display:grid;grid-template-columns:1.75rem minmax(0,1fr);gap:.55rem .5rem;padding:.9rem 0;border-radius:0;background:none;box-shadow:none}
  .svc-row .svc-title,.svc-row:hover .svc-title{transform:none}
  .svc-arrow{display:none}
  .svc-idx{font-size:max(12px,.7rem)}
  .svc-title{font-size:1.05rem}
  .svc-icons{grid-column:2;grid-row:2}
  .svc-ic{opacity:1 !important;filter:none !important;transform:none !important;transition:none !important;box-shadow:none !important}
  .svc-list li::before{display:none}
  .svc-list li{border-top:1px solid #efeeec}
  .svc-list li:first-child{border-top:0}

  /* ---------- languages, experience, stats ---------- */
  .languages .shell{padding-block:var(--section) 0}
  .lg-main{gap:1.25rem}
  .experience .shell,.stats .shell{padding-block:var(--section)}
  .experience h2{margin-bottom:1.5rem;font-size:2.1rem}
  .exp-row{position:relative;gap:.2rem;padding:1.1rem 2.25rem 1.1rem 0;cursor:pointer;-webkit-tap-highlight-color:transparent}
  .exp-row::after{content:"+";position:absolute;right:.25rem;top:1.1rem;display:grid;place-items:center;width:1.6rem;height:1.6rem;border-radius:50%;background:#0a0a0a;color:#fff;font-size:1rem;line-height:1;transition:transform .3s var(--ease-out)}
  .exp-row.open::after{transform:rotate(45deg)}
  .exp-dates{font-size:max(12px,.75rem)}
  .exp-main h3{font-size:1.15rem}
  .exp-org{font-size:max(13px,.8rem)}
  .exp-sum{display:none;margin-top:.5rem;font-size:max(14px,.85rem)}
  .exp-row.open .exp-sum{display:block}

  /* ---------- voices: names left, quote right ---------- */
  .voices .shell{padding-bottom:var(--section)}
  .voices-panel{padding:1.75rem 1.25rem;border-radius:1.5rem}
  .voices-panel h2{font-size:1.9rem;max-width:none}
  .vo-grid{grid-template-columns:1fr;gap:1.25rem;margin-top:1.5rem}
  .vo-list{max-height:none;padding-right:0}
  .vo-feature{display:none}
  .vo-grid.picked .vo-feature{display:grid}
  .vo-btn{gap:.75rem;padding:.9rem 0;align-items:center}
  .vo-idx{font-size:11px;letter-spacing:.1em}
  .vo-name{font-size:1rem}
  .vo-role{margin-top:.15rem;font-size:11px;letter-spacing:.08em}
  .vo-rule{display:none}
  .vo-feature{grid-template-columns:1fr;gap:1rem}
  .vo-quote p{font-size:max(13px,.75rem);line-height:1.5}
  .vo-quote footer{margin-top:.9rem;font-size:11px;letter-spacing:.08em}
  .vo-side{align-items:flex-start}
  .vo-side .vo-portrait{align-self:flex-start;width:42%}

  /* ---------- language card ---------- */
  .lg-card{min-height:0}
  .lg-cplace{font-size:max(11px,.62rem)}
  .lg-greet{margin-top:.5rem;font-size:1.9rem}
  .lg-greet.si{font-size:1.7rem}
  .lg-greet.ta{font-size:1.5rem}
  .lg-roman{font-size:max(12px,.7rem)}
  .lg-crow{margin-top:.9rem}
  .lg-cname{font-size:1rem}
  .lg-clevel{font-size:max(11px,.62rem)}
  .lg-cbars{margin-top:.55rem}

  /* ---------- project pages: smaller type, small tech tiles ---------- */
  .case-bar{padding:.9rem var(--gutter)}
  .cs-wrap{padding-inline:var(--gutter)}
  .cs-sec{padding-block:2rem}
  .cs-panel{margin-block:1rem;padding:2rem 1.1rem;border-radius:1.5rem}
  .cs-hero{padding-block:2.5rem 2rem}
  .cs-h1{font-size:2.6rem}
  .cs-h2{margin-top:.75rem;font-size:1.7rem}
  .cs-tag{margin-top:1rem;font-size:1.05rem}
  .cs-desc{font-size:max(14px,.85rem)}
  .cs-meta{margin-top:1.5rem;gap:.9rem;padding-top:1.1rem}
  .cs-meta dt{font-size:11px}
  .cs-meta dd{font-size:.9rem}
  .cs-pull{margin-bottom:1.5rem;font-size:1.5rem}
  .cs-q{font-size:3.5rem}
  .pains{gap:1rem}
  .pains li{font-size:max(14px,.85rem)}
  .prod-sum{font-size:1.05rem}
  .chip{gap:.5rem;padding:.35rem .85rem .35rem .35rem;font-size:max(13px,.78rem)}
  .chip-ic{width:1.75rem;height:1.75rem}
  .chip-ic .ico{width:.9rem;height:.9rem}
  .bgrp{padding:1rem}
  .bgrp-t{margin-bottom:.75rem;font-size:11px}
  .bgrp-l{grid-template-columns:repeat(3,1fr);gap:.5rem}
  .bt{gap:.4rem;padding:.6rem;border-radius:.75rem}
  .bt-ic{width:1.9rem;height:1.9rem;border-radius:.5rem}
  .bt-ic img{width:1.1rem;height:1.1rem}
  .bt{min-width:0}
  .bt-n{font-size:max(12px,.68rem);line-height:1.25;overflow-wrap:anywhere}
  .log-i h3{font-size:1.05rem}
  .log-i p{font-size:max(14px,.85rem)}
  .doc{padding:1.1rem}
  .doc h3{font-size:1.05rem}

  /* ---------- footer: short and tidy ---------- */
  .footer{border-radius:1.5rem 1.5rem 0 0}
  .footer .inner{padding-top:2.5rem;padding-bottom:1.25rem}
  .footer-cta{gap:1.25rem;padding-bottom:1.75rem}
  .footer-cta h2{font-size:1.7rem;max-width:none}
  .footer-cols{grid-template-columns:1fr 1fr;gap:1.5rem 1rem;padding-block:1.75rem}
  .f-brand{grid-column:1/-1}
  .f-tag{margin-top:.5rem;font-size:max(13px,.8rem)}
  .footer-cols>div:nth-child(3){display:none}
  .f-title{font-size:11px}
  .f-links{margin-top:.7rem;gap:.55rem;font-size:max(13px,.8rem)}
  .legal{gap:.5rem;padding-top:1.1rem;font-size:12px}
  .footer-wm{display:none}
}

/* ---------- journey: centre cards full width, small cards two to a row ---------- */
@media (max-width:899px){
  .j-frame{max-width:none;padding-inline:var(--gutter,1.5rem)}
  /* the scroll line runs down the middle like the desktop one: it fills and the diamond follows as you scroll.
     Text blocks get the page gradient behind them so the line never strikes through words. */
  .j-rail{display:block;left:50%;z-index:0}
  .j-mark{width:12px;height:12px}
  .j-layer{z-index:2}
  .j-centre .j-copy-in,.j-row:nth-child(10) .j-copy-in{padding:.35rem .5rem;background:linear-gradient(to right,#fff,#ece9e6) fixed}
  .j-rows{display:grid;grid-template-columns:1fr 1fr;gap:2.5rem 1rem;padding:1.5rem 0 3rem}
  .j-row{height:auto;display:flex;flex-direction:column;opacity:1 !important}
  .j-layer,.j-centre .j-layer,.j-left .j-layer,.j-right .j-layer{position:relative;top:auto !important;left:auto;right:auto;margin:0;width:100%;height:auto;aspect-ratio:710/462}
  .j-copy,.j-centre .j-copy,.j-left .j-copy,.j-right .j-copy,.j-note,.j-right .j-note{position:relative;z-index:2;top:auto !important;left:auto;right:auto;width:auto;height:auto;display:block;text-align:left;pointer-events:auto}
  .j-copy-in{transform:none;overflow-wrap:normal}
  .j-text{text-align:justify;line-height:1.55;font-size:max(13px,.78rem);font-weight:400;color:rgba(17,17,17,.7)}
  .j-year{font-size:2rem}
  .j-contain{left:10%;width:80%}

  /* centre rows span the grid: picture, then year and text */
  .j-centre{grid-column:1/-1;align-items:center}
  .j-centre .j-layer,.j-row:nth-child(10) .j-layer{width:58%}
  .j-centre .j-copy,.j-row:nth-child(10) .j-copy{width:100%;margin-top:1rem}
  .j-centre .j-year,.j-row:nth-child(10) .j-year{display:block;text-align:center}

  /* small rows: logo beside its caption, no year */
  .j-small{flex-direction:row;align-items:center;gap:.6rem}
  .j-small .j-year{display:none}
  .j-small .j-layer{flex:none;width:34%;aspect-ratio:1.2}
  .j-small .j-contain{left:12%;width:76%}
  .j-small .j-copy,.j-small .j-note{flex:1;min-width:0}
  .j-text.j-note-text{font-size:max(12px,.68rem);line-height:1.4;text-align:left;hyphens:none;-webkit-hyphens:none}

  /* order and placement from the design: the diploma sits beside the two certificates, the SLIM and freelance cards pair up */
  .j-row:nth-child(2){display:none}
  .j-row:nth-child(3){order:2}
  .j-row:nth-child(4){order:3;grid-row:span 2;align-self:center}
  .j-row:nth-child(6){order:4}
  .j-row:nth-child(8){order:5}
  .j-row:nth-child(9){order:6}
  .j-row:nth-child(5){order:7}
  .j-row:nth-child(7){order:8}
  .j-row:nth-child(10){order:9;grid-column:1/-1;align-items:center}
  .j-row:nth-child(11){order:10}
  /* SLIM and freelance cards share a row, so each one stacks logo over caption */
  .j-row:nth-child(5),.j-row:nth-child(7){flex-direction:column;align-items:stretch;gap:.5rem}
  .j-row:nth-child(5) .j-layer,.j-row:nth-child(7) .j-layer{width:70%;align-self:center;aspect-ratio:1.9}
  .j-row:nth-child(5) .j-note-text,.j-row:nth-child(7) .j-note-text{text-align:center}
}
