/* eduardtalberg.de - light neumorphism, design "Home page one-page redesign" v2 */

/* ---------- Tokens ---------- */
:root {
  --bg: #e7e9ef;
  --hi: #ffffff;
  --lo: #c3c7d1;
  --ac: #7652d1;
  --hl: #e0564e;
  --tx: #2a2d38;
  --mu: #5c6170;
  --ok: #25875c;
  --r: 22px;
  --o: 7px 7px 16px var(--lo), -7px -7px 16px var(--hi);
  --os: 3px 3px 7px var(--lo), -3px -3px 7px var(--hi);
  --in: inset 4px 4px 9px var(--lo), inset -4px -4px 9px var(--hi);
  --ins: inset 2px 2px 5px var(--lo), inset -2px -2px 5px var(--hi);
  --e: cubic-bezier(.2, .75, .2, 1);
}

/* ---------- Base ---------- */
*, *:before, *:after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--tx);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--ac); text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 3px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 22px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 8px 16px; border-radius: 999px; background: var(--bg); box-shadow: var(--os); }
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(231, 233, 239, .82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: box-shadow .4s var(--e);
}
header.sc { box-shadow: 0 6px 18px rgba(170, 175, 190, .35); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  header { background: #e7e9ef; }
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; position: relative; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--tx); font-weight: 600; letter-spacing: .2px; }
.logo i {
  position: relative;
  font-style: normal;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .75rem;
  color: var(--ac);
  box-shadow: var(--os);
  transition: box-shadow .3s var(--e), transform .3s var(--e);
}
.logo i:before { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px dashed rgba(118, 82, 209, .28); animation: spin 40s linear infinite; }
.logo i:after { content: ""; position: absolute; top: 1px; right: 1px; width: 7px; height: 7px; border-radius: 50%; background: var(--hl); }
.logo:hover i { box-shadow: var(--ins); transform: rotate(-8deg); }
.menu { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.menu a { display: block; color: var(--mu); padding: 8px 15px; border-radius: 999px; font-size: .92rem; transition: color .3s, box-shadow .35s var(--e); }
.menu a:hover { color: var(--tx); }
.menu a.on { color: var(--ac); box-shadow: var(--ins); }
.burger {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--bg);
  box-shadow: var(--os);
  color: var(--tx);
  font-size: 1.05rem;
  cursor: pointer;
  transition: box-shadow .25s var(--e);
}
.burger:active, .burger[aria-expanded="true"] { box-shadow: var(--ins); }
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tx);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 500;
  box-shadow: var(--os);
  transition: box-shadow .3s var(--e), color .3s, transform .3s var(--e);
}
.back span { display: inline-block; transition: transform .3s var(--e); }
.back:hover { color: var(--ac); transform: translateY(-1px); }
.back:hover span { transform: translateX(-3px); }
.back:active { box-shadow: var(--ins); transform: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 110px 0 100px; overflow: hidden; }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center; }
.shape { position: absolute; border-radius: 50%; box-shadow: var(--o); pointer-events: none; animation: float 9s ease-in-out infinite; }
.shape.s1 { width: 90px; height: 90px; left: 4%; top: 14%; }
.shape.s2 { width: 46px; height: 46px; right: 8%; top: 10%; box-shadow: var(--in); animation-duration: 11s; animation-delay: -3s; }
.shape.s3 { width: 64px; height: 64px; left: 44%; bottom: 8%; box-shadow: var(--os); animation-duration: 13s; animation-delay: -6s; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--mu); font-size: .78rem; letter-spacing: 3px; text-transform: uppercase; }
.eyebrow:before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hl); animation: pulse-hl 2.4s ease-out infinite; }
h1 { font-size: clamp(2.3rem, 5.4vw, 3.7rem); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; margin: 14px 0 12px; }
.rot { font-size: clamp(1.05rem, 2.2vw, 1.35rem); color: var(--mu); font-weight: 300; }
.rot b { display: inline-block; color: var(--ac); font-weight: 500; transition: opacity .35s var(--e), transform .35s var(--e); }
.btns { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 34px; }
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  color: var(--tx);
  font-weight: 500;
  font-size: .95rem;
  box-shadow: var(--o);
  transition: transform .3s var(--e), box-shadow .3s var(--e), color .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: none; box-shadow: var(--in); }
.btn.p { color: var(--ac); }
.photo {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 330px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 16px 16px 36px var(--lo), -16px -16px 36px var(--hi);
  animation: float 7s ease-in-out infinite;
}
.photo:before { content: ""; position: absolute; inset: 9%; border-radius: 50%; box-shadow: var(--in); z-index: 1; pointer-events: none; }
.photo:after { content: ""; position: absolute; inset: 4%; border-radius: 50%; border: 1px dashed rgba(118, 82, 209, .3); animation: spin 50s linear infinite; }
.photo img { position: absolute; inset: 9%; width: 82%; height: 82%; border-radius: 50%; object-fit: cover; background: var(--bg); }

/* ---------- Sections ---------- */
section { padding: 96px 0; scroll-margin-top: 68px; }
.st { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }
.st h2 { font-size: 1.7rem; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.st h2:after { content: "."; color: var(--hl); }
.st p { margin: 0; color: var(--mu); font-size: .95rem; }
h3.sub { margin: 64px 0 22px; font-size: .75rem; font-weight: 500; color: var(--mu); text-transform: uppercase; letter-spacing: 3px; }

/* ---------- Grids and cards ---------- */
.grid { display: grid; gap: 24px; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g6 { grid-template-columns: repeat(6, 1fr); }
.span2 { grid-column: span 2; }
.card { background: var(--bg); border-radius: var(--r); padding: 28px; box-shadow: var(--o); transition: transform .45s var(--e), box-shadow .45s var(--e); }
.card:hover { transform: translateY(-3px); }
.card h3, .card h4 { margin: 0 0 8px; font-weight: 600; }
.card h4 { font-size: 1rem; }
.card p { margin: 0; color: var(--mu); font-size: .95rem; }
.card p + p { margin-top: 12px; }
.ic {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  box-shadow: var(--ins);
  color: var(--ac);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  margin-bottom: 18px;
  flex: none;
  transition: transform .5s var(--e);
}
.card:hover .ic { transform: rotate(-12deg) scale(1.06); }
.info { list-style: none; padding: 0; margin: 0; }
.info li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; font-size: .95rem; }
.info li + li { box-shadow: 0 -1px 0 var(--hi), 0 -2px 0 var(--lo); }
.info span:first-child { color: var(--mu); }
.layout .card ul.info { margin: 0; padding: 0; color: inherit; }
.todo { background: #fde7e5; color: #a3322b; border-radius: 6px; padding: 1px 6px; font-weight: 600; }
.ok { color: var(--ok); font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.ok:before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 2.4s ease-out infinite; }
.client { display: grid; place-items: center; height: 76px; padding: 14px 18px; cursor: default; transition: box-shadow .4s var(--e), transform .4s var(--e); }
.client img { max-height: 40px; width: auto; filter: grayscale(1) brightness(0); opacity: .5; transition: opacity .4s, transform .4s var(--e); }
.client:hover { transform: none; box-shadow: var(--in); }
.client:hover img { opacity: .8; transform: scale(.96); }
.cert { padding: 22px 24px; }
.cert b { display: block; font-weight: 600; }
.cert span { color: var(--ac); font-size: .9rem; }

/* ---------- Tabs and timeline ---------- */
.tabs { position: relative; display: inline-flex; padding: 6px; border-radius: 999px; box-shadow: var(--in); margin-bottom: 36px; max-width: 100%; }
.tab { position: relative; z-index: 1; background: none; border: 0; color: var(--mu); padding: 9px 22px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .92rem; transition: color .35s; }
.tab:hover { color: var(--tx); }
.tab.on { color: var(--ac); }
.ind { position: absolute; top: 6px; bottom: 6px; left: 6px; width: 0; border-radius: 999px; background: var(--bg); box-shadow: var(--os); transition: left .5s var(--e), width .5s var(--e); }
.js .pane { display: none; }
.js .pane.on { display: block; animation: fadeUp .6s var(--e) both; }
.pane + .pane { margin-top: 48px; }
.js .pane + .pane { margin-top: 0; }
.tl { position: relative; padding-left: 38px; max-width: 700px; }
.tl:before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 22px; width: 5px; border-radius: 5px; box-shadow: var(--ins); }
.tl:after { content: ""; position: absolute; left: 10px; top: 8px; bottom: 22px; width: 1px; background: repeating-linear-gradient(to bottom, rgba(118, 82, 209, .35) 0 6px, transparent 6px 12px); background-size: 1px 24px; animation: dash-y 4s linear infinite; }
.ev { position: relative; padding-bottom: 32px; }
.ev:before { content: ""; position: absolute; left: -37px; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle, var(--ac) 0 3.5px, var(--bg) 4.5px); box-shadow: var(--os); z-index: 1; }
.ev small { color: var(--ac); font-size: .8rem; letter-spacing: .5px; }
.ev h4 { margin: 2px 0 0; font-weight: 600; }
.ev em { color: var(--mu); font-style: normal; font-size: .92rem; }
.ev p { margin: 6px 0 0; color: var(--mu); font-size: .95rem; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.tags span { padding: 6px 14px; border-radius: 999px; font-size: .85rem; color: var(--mu); box-shadow: var(--os); transition: box-shadow .3s var(--e), color .3s; }
.tags span:hover { box-shadow: var(--ins); color: var(--ac); }

/* ---------- Portfolio ---------- */
.embed {
  position: relative;
  aspect-ratio: 16 / 7;
  border-radius: var(--r);
  box-shadow: var(--in);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  color: var(--mu);
  font-size: .9rem;
  margin-bottom: 44px;
  text-align: center;
  padding: 16px;
  overflow: hidden;
}
.embed iframe { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); border: 0; border-radius: 16px; }
.play {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  box-shadow: var(--o);
  display: grid;
  place-items: center;
  color: var(--ac);
  font-size: 1.3rem;
  margin: 0 auto;
  padding-left: 4px;
  animation: breathe 3.2s ease-in-out infinite;
  transition: transform .4s var(--e);
}
.embed a[data-embed], .video a[data-embed] { display: grid; justify-items: center; gap: 16px; color: var(--mu); }
.pn { margin: 0; max-width: 46ch; font-size: .8rem; color: var(--mu); }
.pn a { color: var(--ac); }
.embed a:hover .play { transform: scale(1.06); }
.chips { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.chip { background: var(--bg); border: 0; color: var(--mu); border-radius: 999px; padding: 7px 15px; cursor: pointer; font: inherit; font-size: .85rem; box-shadow: var(--os); transition: box-shadow .3s var(--e), color .3s; }
.chip:hover { color: var(--tx); }
.chip.on { box-shadow: var(--ins); color: var(--ac); }
.count { color: var(--mu); font-size: .85rem; margin: 0 0 22px; letter-spacing: .5px; min-height: 1.4em; }
.proj { display: block; color: var(--tx); border-radius: var(--r); padding: 12px; box-shadow: var(--o); transition: transform .45s var(--e), box-shadow .45s var(--e); }
.proj:hover { transform: translateY(-4px); }
.proj:active { box-shadow: var(--in); transform: none; }
.proj[hidden] { display: none; }
.th { aspect-ratio: 16 / 10; border-radius: 14px; box-shadow: var(--ins); position: relative; overflow: hidden; background: linear-gradient(135deg, rgba(118, 82, 209, .12), rgba(231, 233, 239, 0) 70%); }
.th img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--e); }
.th:after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); transform: translateX(-100%); transition: transform .9s var(--e); }
.proj:hover .th:after { transform: translateX(100%); }
.proj:hover .th img { transform: scale(1.04); }
.proj .b { padding: 14px 6px 6px; }
.proj h4 { margin: 0 0 4px; font-size: .95rem; font-weight: 600; line-height: 1.35; }
.proj small { color: var(--mu); font-size: .8rem; }
.proj.pop { animation: pop .55s var(--e) both; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: stretch; }
.cl { list-style: none; padding: 0; margin: 22px 0 0; }
.cl li { display: flex; gap: 14px; align-items: center; padding: 8px 0; font-size: .95rem; }
.cl .ic { margin: 0; width: 40px; height: 40px; font-size: 1rem; }
.cimg { position: relative; border-radius: var(--r); box-shadow: var(--in); min-height: 240px; display: grid; place-items: center; padding: 20px; overflow: hidden; }
.cimg img { max-height: 320px; width: auto; object-fit: contain; position: relative; }
.cimg svg { position: absolute; width: 150px; height: auto; opacity: .7; }
.cimg line { stroke: var(--lo); stroke-width: 2; stroke-dasharray: 6 6; animation: dash 6s linear infinite; }
.cimg circle { fill: var(--ac); transform-box: fill-box; transform-origin: center; animation: node 3s ease-in-out infinite; }
.cimg circle:nth-of-type(2) { animation-delay: 1s; }
.cimg circle:nth-of-type(3) { animation-delay: 2s; }

/* ---------- Footer ---------- */
footer { padding: 40px 0 48px; color: var(--mu); font-size: .85rem; text-align: center; }

/* ---------- Project detail pages ---------- */
.head { padding-top: 80px; padding-bottom: 48px; text-align: center; }
.crumb { display: inline-block; color: var(--ac); font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; margin-bottom: 22px; box-shadow: var(--ins); }
.kicker { color: var(--mu); font-size: .95rem; margin: 0 0 6px; }
.kicker span { margin: 0 8px; color: var(--lo); }
.head h1 { max-width: 22ch; margin: 8px auto 0; }
.head h1:after { content: "."; color: var(--hl); }
.media { padding: 16px; border-radius: 30px; box-shadow: var(--o); margin-bottom: 56px; }
.mtabs { display: flex; width: max-content; max-width: 100%; margin: 4px auto 16px; gap: 4px; padding: 5px; border-radius: 999px; box-shadow: var(--in); }
.mt { background: none; border: 0; color: var(--mu); border-radius: 999px; padding: 8px 22px; cursor: pointer; font: inherit; font-size: .88rem; transition: box-shadow .35s var(--e), color .3s; }
.mt:hover { color: var(--tx); }
.mt.on { color: var(--ac); box-shadow: var(--os); }
.frame { border-radius: 22px; padding: 12px; box-shadow: var(--in); }
.slider { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; background: var(--bg); }
.track { display: flex; height: 100%; transition: transform .6s var(--e); }
.slide { min-width: 100%; height: 100%; display: grid; place-items: center; }
.slide img { width: 100%; height: 100%; object-fit: contain; }
.sbtn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  border: 0;
  background: var(--bg);
  color: var(--tx);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  box-shadow: var(--os);
  transition: box-shadow .3s var(--e), color .25s, transform .3s var(--e);
}
.sbtn:hover { color: var(--ac); transform: translateY(-50%) scale(1.08); }
.sbtn:active { box-shadow: var(--ins); transform: translateY(-50%) scale(.96); }
.sbtn.l { left: 14px; }
.sbtn.r { right: 14px; }
.dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; gap: 8px; padding: 8px 12px; border-radius: 999px; background: var(--bg); box-shadow: var(--os); }
.dot { width: 8px; height: 8px; border-radius: 999px; border: 0; padding: 0; cursor: pointer; background: var(--lo); transition: width .4s var(--e), background .35s; }
.dot.on { width: 22px; background: var(--ac); }
.single .sbtn, .single .dots { display: none; }
.video { display: none; aspect-ratio: 16 / 9; border-radius: 14px; place-items: center; text-align: center; padding: 20px; color: var(--mu); position: relative; overflow: hidden; }
.video.on { display: grid; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video a:hover .play { transform: scale(1.06); }
.slider.off { display: none; }
/* Without JS: stack all images and show the video link below them. */
html:not(.js) .mtabs, html:not(.js) .sbtn, html:not(.js) .dots { display: none; }
html:not(.js) .slider { aspect-ratio: auto; }
html:not(.js) .track { flex-direction: column; gap: 12px; }
html:not(.js) .video { display: grid; margin-top: 12px; box-shadow: var(--ins); }
.layout { display: grid; grid-template-columns: 3fr 2fr; gap: 28px; padding-bottom: 72px; align-items: start; }
.layout .card { padding: 34px 36px; }
.layout .card h3 { margin: 0 0 18px; font-size: .74rem; color: var(--mu); text-transform: uppercase; letter-spacing: .16em; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.layout .card h3:before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ac); }
.layout .card p { font-size: 1rem; }
.layout .card p + p { margin-top: 14px; }
.layout .card ul { margin: 12px 0 0; padding-left: 20px; color: var(--mu); }
.layout .card li + li { margin-top: 4px; }
.layout .card ul + p { margin-top: 14px; }
.layout .card h3 + * { margin-top: 0; }
.layout .card * + h3 { margin-top: 28px; }
.layout .tags { margin-top: 0; }
.facts { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; border-radius: 14px; font-size: .9rem; box-shadow: var(--ins); }
.facts b { font-weight: 600; }
.facts em { font-style: normal; color: var(--mu); text-align: right; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding-bottom: 80px; }
.pn a { display: block; padding: 24px 28px; border-radius: var(--r); color: var(--tx); font-weight: 600; line-height: 1.35; box-shadow: var(--o); transition: transform .45s var(--e), box-shadow .45s var(--e), color .3s; }
.pn a:hover { transform: translateY(-4px); color: var(--ac); }
.pn a:active { transform: none; box-shadow: var(--in); }
.pn small { display: block; color: var(--ac); font-weight: 600; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 6px; }
.pn .nx { text-align: right; }

/* ---------- Reveal on scroll ---------- */
/* Only hidden while not yet revealed, so hover lifts keep working afterwards. */
.js .rv { transition: opacity .9s var(--e), transform .9s var(--e); transition-delay: calc(var(--d, 0) * 90ms); }
.js .rv:not(.vis) { opacity: 0; transform: translateY(22px); }
.js .card.rv.vis, .js .proj.rv.vis, .js .pn a.rv.vis {
  transition: opacity .9s var(--e), transform .45s var(--e), box-shadow .45s var(--e);
  transition-delay: calc(var(--d, 0) * 90ms), 0s, 0s;
}
/* Hero content fades up on load instead of on scroll. */
.js .ld { animation: fadeUp .9s var(--e) both; animation-delay: calc(var(--d, 0) * 110ms); }
html:not(.js) .tabs { display: none; }

/* ---------- Keyframes ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes breathe { 0%, 100% { box-shadow: var(--o); } 50% { box-shadow: 3px 3px 8px var(--lo), -3px -3px 8px var(--hi); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 135, 92, .45); } 70%, 100% { box-shadow: 0 0 0 8px rgba(37, 135, 92, 0); } }
@keyframes pulse-hl { 0% { box-shadow: 0 0 0 0 rgba(224, 86, 78, .45); } 70%, 100% { box-shadow: 0 0 0 8px rgba(224, 86, 78, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dash { to { stroke-dashoffset: -48; } }
@keyframes dash-y { to { background-position: 0 24px; } }
@keyframes node { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.35); opacity: 1; } }

/* ---------- Breakpoints ---------- */
@media (max-width: 900px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g6 { grid-template-columns: repeat(3, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
  .hero .wrap, .contact, .layout { grid-template-columns: 1fr; }
  .photo { max-width: 240px; margin: 0; }
  .hero { padding: 72px 0; }
}
@media (max-width: 640px) {
  .burger { display: block; }
  .menu {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    background: var(--bg);
    padding: 14px;
    border-radius: var(--r);
    box-shadow: var(--o);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .35s var(--e), transform .35s var(--e), visibility .35s;
  }
  .menu.open { opacity: 1; visibility: visible; transform: none; }
  html:not(.js) .menu { position: static; opacity: 1; visibility: visible; transform: none; flex-direction: row; flex-wrap: wrap; box-shadow: none; padding: 0; }
  html:not(.js) .burger { display: none; }
  html:not(.js) .nav { height: auto; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; gap: 8px; }
  .menu a { padding: 11px 16px; }
  .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .g6 { grid-template-columns: repeat(2, 1fr); }
  section { padding: 64px 0; }
  .hero { padding: 56px 0 64px; }
  .photo { max-width: 200px; margin: 0 auto; }
  .card { padding: 22px; }
  .card, .proj, .pn a, .media { box-shadow: var(--os); }
  .tab { padding: 8px 14px; }
  .embed { aspect-ratio: 4 / 3; }
  .shape.s1 { width: 54px; height: 54px; }
  .head { padding-top: 52px; padding-bottom: 32px; }
  .media { padding: 10px; border-radius: 24px; margin-bottom: 40px; }
  .frame { padding: 8px; border-radius: 18px; }
  .sbtn { width: 38px; height: 38px; font-size: 1.15rem; }
  .sbtn.l { left: 8px; }
  .sbtn.r { right: 8px; }
  .dots { bottom: 8px; }
  .layout .card { padding: 24px 22px; }
  .pn { grid-template-columns: 1fr; gap: 20px; padding-bottom: 64px; }
  .pn .nx { text-align: left; }
  .back { padding: 8px 14px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *:before, *:after { animation: none !important; transition: none !important; }
  .js .rv:not(.vis) { opacity: 1; transform: none; }
}
