@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Oswald:wght@500;600;700&display=swap');

:root {
  --cursor-color: #ff671c;
  --bg: #070808;
  --bg-soft: #0c0d0d;
  --card: rgba(15, 16, 16, .82);
  --card-solid: #101111;
  --line: rgba(238, 224, 207, .14);
  --line-hot: rgba(255, 103, 28, .46);
  --text: #eee3d5;
  --muted: #9f9b95;
  --orange: #ff671c;
  --orange-2: #ff914d;
  --display: 'Oswald', Impact, sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;
  --max: 1460px;
  --page-gutter: 64px;
  --section-title-size: 4rem;
  --hero-name-size: 4.5rem;
  --project-title-size: 3.5rem;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
html.story-scrolling { scroll-behavior: auto; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: var(--body); overflow-x: hidden; }
body.menu-open, body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--orange); color: #080808; }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 78% 26%, rgba(255, 88, 15, .1), transparent 24%), linear-gradient(115deg, transparent 58%, rgba(255, 92, 17, .035));
  z-index: -2;
}

.noise { position: fixed; inset: 0; opacity: .035; pointer-events: none; z-index: 20; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E"); }
.cursor-glow { position: fixed; width: 400px; height: 400px; margin: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 103, 28, .07), transparent 68%); pointer-events: none; z-index: -1; }
.scroll-character-track { position: fixed; z-index: 2; inset: 0; pointer-events: none; }
.scroll-character { position: relative; z-index: 1; display: block; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .55s ease; filter: drop-shadow(0 24px 44px rgba(0,0,0,.38)); }
.scroll-character.is-ready { opacity: 1; }
.character-aura { position: absolute; z-index: 0; left: 0; top: 0; opacity: 0; pointer-events: none; transform-origin: center; transition: opacity .28s ease; will-change: transform, width, height; }
.character-aura.is-visible { opacity: var(--aura-opacity, .55); }
.character-aura[data-scene="sobre"] { z-index: 2; }
.aura-ring { position: absolute; inset: 0; border-radius: 50%; filter: drop-shadow(0 0 7px rgba(255,103,28,.72)); }
.aura-ring-wide { inset: 3% 0; border: 1px solid rgba(255,103,28,.48); transform: rotate(var(--aura-phase, 0deg)); animation: aura-turn 15s linear infinite; }
.aura-ring-core { inset: 12% 9%; border: 1px solid transparent; border-top-color: rgba(255,145,77,.95); border-right-color: rgba(255,103,28,.28); border-bottom-color: rgba(255,103,28,.62); animation: aura-turn-reverse 9s linear infinite; }
.aura-ring-dash { inset: 22% 17%; border: 1px dashed rgba(255,184,135,.68); animation: aura-turn 22s linear infinite; }
.aura-ring-wide::before, .aura-ring-core::after { content: ''; position: absolute; border-radius: 50%; background: var(--orange); box-shadow: 0 0 6px var(--orange), 0 0 18px rgba(255,103,28,.85); }
.aura-ring-wide::before { width: 7px; height: 7px; left: 7%; top: 24%; }
.aura-ring-core::after { width: 5px; height: 5px; right: 9%; bottom: 20%; }
.aura-spark { position: absolute; width: 8px; height: 8px; border: 1px solid var(--orange); background: rgba(7,8,8,.8); transform: rotate(45deg); box-shadow: 0 0 12px rgba(255,103,28,.65); }
.aura-spark-one { left: 3%; top: 52%; animation: aura-pulse 2.8s ease-in-out infinite; }
.aura-spark-two { right: 8%; top: 17%; animation: aura-pulse 3.7s .8s ease-in-out infinite; }
.aura-equator { position: absolute; z-index: 3; left: -5%; right: -5%; top: 52%; height: 19%; border: 2px solid transparent; border-top-color: rgba(255,145,77,.95); border-bottom-color: rgba(255,103,28,.72); border-radius: 50%; opacity: 0; visibility: hidden; clip-path: inset(0 50%); filter: drop-shadow(0 0 0 rgba(255,103,28,0)); transform: rotate(-3deg); transition: opacity .7s cubic-bezier(.22,1,.36,1), clip-path .9s cubic-bezier(.22,1,.36,1), filter .8s ease, visibility 0s linear .9s; animation: aura-equator 4.8s ease-in-out infinite alternate; }
.character-aura[data-scene="sobre"] .aura-equator { opacity: 1; visibility: visible; clip-path: inset(0 -3%); filter: drop-shadow(0 0 7px rgba(255,103,28,.9)); transition-delay: 0s; }
.character-aura[data-scene="projetos"], .character-aura[data-scene="skills"] { filter: drop-shadow(0 0 18px rgba(255,103,28,.3)); }
@keyframes aura-turn { to { rotate: 360deg; } }
@keyframes aura-turn-reverse { to { rotate: -360deg; } }
@keyframes aura-pulse { 0%, 100% { opacity: .3; scale: .7; } 48% { opacity: 1; scale: 1.2; } }
@keyframes aura-equator { from { transform: rotate(-4deg) scaleX(.96); } to { transform: rotate(3deg) scaleX(1.04); } }
.frame-loader { position: fixed; z-index: 35; right: 34px; bottom: 28px; display: flex; align-items: center; gap: 10px; color: var(--muted); opacity: 1; transition: opacity .35s ease, visibility .35s ease; }
.frame-loader span { width: 22px; height: 22px; border: 1px solid var(--line); border-top-color: var(--orange); border-radius: 50%; animation: frame-loader-spin .8s linear infinite; }
.frame-loader small { font-size: 9px; text-transform: uppercase; letter-spacing: .14em; }
.frame-loader.is-hidden { opacity: 0; visibility: hidden; }
@keyframes frame-loader-spin { to { transform: rotate(360deg); } }

.site-header { position: fixed; z-index: 30; left: max(var(--page-gutter), calc((100vw - var(--max)) / 2)); right: max(var(--page-gutter), calc((100vw - var(--max)) / 2)); top: 24px; min-height: 70px; border: 1px solid var(--line); border-radius: 16px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: rgba(8, 9, 9, .74); backdrop-filter: blur(18px); transition: .3s ease; }
.site-header.scrolled { top: 12px; background: rgba(8, 9, 9, .92); box-shadow: 0 15px 50px rgba(0,0,0,.35); }
.brand { display: inline-flex; align-items: center; gap: 14px; font-weight: 700; font-size: 21px; white-space: nowrap; }
.brand-mark { color: var(--orange); font-family: Georgia, serif; font-size: 39px; font-weight: 900; line-height: 1; transform: scaleX(1.08); }
.brand i { width: 7px; height: 7px; background: var(--orange); border-radius: 50%; margin-left: 4px; opacity: .75; }
.main-nav { display: flex; align-items: stretch; align-self: stretch; gap: clamp(14px, 2vw, 28px); }
.main-nav a { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; color: #d7ccc0; transition: .25s; }
.main-nav a::after { content: ''; position: absolute; height: 2px; left: 50%; right: 50%; bottom: -1px; background: var(--orange); transition: .25s ease; }
.main-nav a:hover, .main-nav a.active { color: var(--orange); }
.main-nav a.active::after { left: 0; right: 0; }
@media (min-width: 901px) and (pointer: fine) {
  .site-header { min-height: 80px; padding: 12px 22px; gap: 24px; background: rgba(10,12,12,.94); }
  .site-header > .brand { flex-shrink: 0; }
  .main-nav { align-items: center; align-self: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #0c0f0f; }
  .main-nav a { flex: 0 0 auto; min-height: 42px; padding: 10px 14px; border: 1px solid transparent; border-radius: 6px; font-size: 14px; font-weight: 500; line-height: 1.2; white-space: nowrap; transition: color .18s, background-color .18s, border-color .18s; }
  .main-nav a::after { display: none; }
  .main-nav a:hover { background: #1b2020; color: var(--text); border-color: #333a37; }
  .main-nav a.active { background: #251a12; border-color: rgba(255,103,28,.38); color: #ff975e; }
  .main-nav .nav-profile { margin-left: 8px; padding-right: 10px; background: #1a201e; border-color: #39433d; color: var(--text); }
  .main-nav .nav-profile span { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 22px; width: 22px; height: 22px; color: var(--orange); font-size: 16px; }
  .main-nav .nav-profile:hover { background: #252b26; border-color: var(--orange); }
}
@media (min-width: 901px) and (max-width: 1100px) and (pointer: fine) {
  .site-header { left: 24px; right: 24px; padding-inline: 16px; gap: 16px; }
  .site-header .brand { font-size: 17px; gap: 10px; }
  .main-nav a { padding-inline: 9px; font-size: 13px; }
  .main-nav .nav-profile { margin-left: 3px; gap: 4px; }
}
.menu-toggle { display: none; background: none; border: 0; width: 42px; height: 42px; padding: 10px; cursor: pointer; }
.menu-toggle span { display: block; height: 2px; width: 100%; background: var(--text); margin: 6px 0; transition: .25s; }

.section { position: relative; width: min(var(--max), calc(100% - (var(--page-gutter) * 2))); margin-inline: auto; }
.eyebrow { margin: 0 0 10px; color: var(--orange); text-transform: uppercase; letter-spacing: .2em; font-size: 13px; font-weight: 600; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
.button { min-height: 46px; max-width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 20px; border-radius: 6px; border: 1px solid transparent; font-size: 14px; line-height: 1.4; font-weight: 600; text-align: center; cursor: pointer; transition: background-color .18s, border-color .18s, color .18s; }
.button-primary { color: #0a0908; background: var(--orange); border-color: var(--orange); }
.button-primary:hover { background: #ff803e; border-color: #ff803e; }
.button-secondary { color: var(--text); background: var(--bg-soft); border-color: var(--line); }
.button-secondary:hover { background: #191b1b; border-color: #77716a; }
.button:disabled { opacity: .5; cursor: default; }

.hero { min-height: 100vh; padding-top: 126px; display: grid; grid-template-columns: .95fr .78fr .62fr; grid-template-rows: minmax(560px, 1fr) auto; align-items: center; }
.hero-grid { position: absolute; inset: 120px 0 120px; opacity: .22; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 90px 90px; mask-image: radial-gradient(ellipse at center, black, transparent 74%); }
.hero-word { position: absolute; z-index: 0; top: 102px; left: 2%; margin: 0; width: 96%; font-family: var(--display); font-size: clamp(7rem, 13.8vw, 13rem); font-weight: 700; letter-spacing: -.055em; line-height: .9; text-align: center; color: #e7dccd; opacity: .96; white-space: nowrap; }
.hero-word::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 34%, var(--bg) 51%, transparent 66%); opacity: .22; }
.cross { position: absolute; z-index: 1; color: var(--orange); font-size: 27px; font-weight: 300; }
.cross-one { top: 28%; left: -18px; }
.cross-two { top: 54%; right: 19%; opacity: .4; }
.hero-copy { align-self: end; z-index: 4; padding: 0 0 32px; max-width: 520px; }
.hero-copy h1 { margin: 0; font-size: var(--hero-name-size); font-weight: 400; letter-spacing: -.045em; line-height: 1; }
.hero-copy h1 span { color: #cfc5ba; }
.role { color: var(--orange); font-size: clamp(1.15rem, 1.55vw, 1.6rem); margin: 10px 0 28px; }
.role strong { font-weight: 500; display: inline-block; min-width: 145px; transition: .2s; }
.role strong.changing { opacity: 0; transform: translateY(7px); }
.role > span { margin-left: 8px; letter-spacing: -.12em; }
.feature-list { border-top: 1px solid var(--line-hot); width: min(420px, 100%); padding-top: 14px; margin-bottom: 23px; }
.feature-list article { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 8px 0; }
.feature-list h2 { margin: 0 0 2px; font-size: 15px; }
.feature-list p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.feature-icon { color: var(--orange); width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line-hot); border-radius: 7px; }
.feature-icon svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.hero-copy .button { min-width: 156px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }

.character-wrap { position: relative; align-self: stretch; z-index: 3; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; min-width: 420px; }
.character-wrap img { position: relative; z-index: 2; height: min(78vh, 840px); width: auto; max-width: none; object-fit: contain; object-position: bottom; filter: drop-shadow(0 20px 35px rgba(0,0,0,.42)) saturate(.94); }
.orbit { position: absolute; left: 50%; top: 55%; translate: -50% -50%; border: 1px solid rgba(255, 103, 28, .28); border-radius: 50%; }
.orbit-one { width: 510px; height: 510px; }
.orbit-two { width: 390px; height: 390px; border-style: dashed; animation: spin 34s linear infinite; }
.orbit-two::before, .orbit-two::after { content: ''; position: absolute; width: 7px; height: 7px; border: 1px solid var(--orange); transform: rotate(45deg); }
.orbit-two::before { left: 1%; top: 40%; }.orbit-two::after { right: 11%; bottom: 18%; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-stats { z-index: 5; width: 100%; max-width: 330px; justify-self: end; align-self: end; margin: 0 16px 72px 0; padding: 10px 20px; background: linear-gradient(140deg, rgba(23,24,24,.9), rgba(14,15,15,.8)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 25px 60px rgba(0,0,0,.28); }
.hero-stats > div { min-height: 78px; display: grid; grid-template-columns: 54px 66px 1fr; align-items: center; border-bottom: 1px solid rgba(255,255,255,.06); gap: 10px; }
.hero-stats > div:last-child { border-bottom: 0; }
.stat-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.025); color: var(--orange); font-size: 20px; }
.hero-stats strong { font-size: 27px; font-weight: 600; }
.hero-stats strong.stat-word { font-size: 16px; color: var(--orange); letter-spacing: .06em; }
.hero-stats p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.hero-stats p b { display: block; color: var(--text); font-size: 13px; margin-bottom: 2px; }

.hero-socials { z-index: 7; display: flex; align-items: center; gap: 7px; padding-left: 4px; }
.hero-socials span { color: var(--muted); text-transform: uppercase; letter-spacing: .16em; font-size: 9px; margin-right: 2px; }
.hero-socials a { width: 44px; height: 44px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; transition: .2s; }
.hero-socials a:hover { color: var(--orange); }
.hero-socials svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.hero-socials svg .fill { fill: currentColor; stroke: none; }

.hero-cards { grid-column: 1 / -1; z-index: 7; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 30px; background: var(--bg-soft); }
.mini-card { min-width: 0; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-right: 1px solid var(--line); transition: background-color .18s; }
.mini-card:last-child { border-right: 0; }
.mini-card:hover { background: #151717; }
.mini-card h3 { color: var(--text); font-size: 16px; font-weight: 500; margin: 0 0 6px; }
.mini-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.mini-card > span { color: var(--muted); }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 60px; margin-bottom: 48px; }
.section-heading h2, .about-copy h2, .contact-copy h2 { max-width: 900px; font-family: var(--display); font-size: var(--section-title-size); letter-spacing: -.035em; line-height: 1.04; margin: 0; text-transform: uppercase; text-wrap: balance; }
.section-heading h2 em, .about-copy h2 em, .contact-copy h2 em { color: var(--orange); font-style: normal; }
.section-heading > p { width: 360px; margin: 0; color: var(--muted); line-height: 1.65; font-size: 14px; }

.projects { padding: 150px 0 80px; }
.project-grid { display: grid; }
.project-card { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--card-solid); }
.project-featured { display: grid; grid-template-columns: 1.55fr .65fr; min-height: 570px; }
.project-visual { min-height: 400px; position: relative; overflow: hidden; }
.visual-zayres { display: block; background: #eeeae2; }
.visual-zayres::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 55%, rgba(255, 103, 28, .13)); opacity: 0; transition: .35s; }
.visual-zayres img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.visual-zayres > span { position: absolute; z-index: 2; left: 26px; bottom: 26px; padding: 13px 18px; border-radius: 8px; background: rgba(8,9,9,.92); color: var(--text); font-size: 12px; font-weight: 600; transform: translateY(12px); opacity: 0; transition: .3s; }
.visual-zayres:hover img { transform: scale(1.025); }
.visual-zayres:hover::after, .visual-zayres:hover > span { opacity: 1; transform: none; }
.project-info { padding: 50px 42px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.project-info > p { color: var(--orange); text-transform: uppercase; letter-spacing: .15em; font-size: 11px; margin: 0 0 14px; }
.project-info h3 { font-family: var(--display); font-size: var(--project-title-size); text-transform: uppercase; line-height: 1; margin: 0 0 22px; }
.project-info > span { color: var(--muted); line-height: 1.7; font-size: 14px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 25px 0 32px; }
.project-tags i, .modal-tags span { font-style: normal; color: var(--muted); padding: 0; font-size: 13px; line-height: 1.5; }
.project-tags i + i::before, .modal-tags span + span::before { content: '/'; color: #686661; margin-right: 8px; }
.project-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; width: 100%; }

.about { margin-top: 120px; padding: 135px 0; display: grid; grid-template-columns: .32fr 1fr .85fr; gap: 70px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-number { font-family: var(--display); color: transparent; -webkit-text-stroke: 1px rgba(255,103,28,.6); font-size: 10rem; line-height: .8; }
.about-copy > p:not(.eyebrow) { max-width: 620px; color: var(--muted); line-height: 1.8; font-size: 15px; margin: 35px 0 25px; }
.text-link { color: var(--orange); font-size: 13px; font-weight: 600; display: inline-flex; gap: 20px; padding-bottom: 7px; border-bottom: 1px solid var(--line-hot); }
.about-values { display: grid; align-content: center; }
.about-values article { position: relative; padding: 25px 0 25px 52px; border-bottom: 1px solid var(--line); }
.about-values article:last-child { border: 0; }
.about-values span { position: absolute; left: 0; top: 29px; color: var(--orange); font-size: 11px; }
.about-values h3 { margin: 0 0 5px; font-size: 18px; }
.about-values p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.about-values .experience-period { margin: 4px 0 10px; color: var(--orange); }

.skills { padding: 150px 0; }
.skill-category + .skill-category { margin-top: 40px; }
.category-title { margin: 0 0 18px; font-size: 18px; font-weight: 500; color: var(--text); }
.skill-grid { background: var(--bg-soft); }
.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.skill-grid article { position: relative; min-width: 0; min-height: 150px; padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.skill-grid h4 { font-family: var(--display); color: var(--orange); font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 500; margin: 0 0 12px; overflow-wrap: anywhere; }
.skill-grid p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--muted); }

.contact { margin-bottom: 80px; padding: 100px 80px; border: 1px solid var(--line); border-radius: 24px; background: radial-gradient(circle at 15% 50%, rgba(255,103,28,.08), transparent 30%), rgba(14,15,15,.66); display: grid; grid-template-columns: 1fr; gap: 0; overflow: hidden; }
.contact-copy > p:not(.eyebrow) { color: var(--muted); line-height: 1.7; max-width: 560px; }
.contact-socials { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 35px; }
.contact-socials a { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; overflow-wrap: anywhere; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; transition: color .18s; }
.contact-socials a:hover { border-color: var(--orange); color: var(--orange); }
.contact-socials span { margin-left: 8px; }

footer { width: min(var(--max), calc(100% - (var(--page-gutter) * 2))); margin: auto; min-height: 120px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.footer-brand { font-size: 16px; }.footer-brand .brand-mark { font-size: 29px; }
footer p { color: var(--muted); font-size: 11px; }
.back-top { width: 45px; height: 45px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; transition: .2s; }
.back-top:hover { border-color: var(--orange); color: var(--orange); }

.project-modal { width: min(600px, calc(100% - 32px)); color: var(--text); background: #111212; border: 1px solid var(--line-hot); border-radius: 20px; padding: 52px; box-shadow: 0 30px 100px #000; }
.project-modal::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(8px); }
.project-modal h2 { font: 600 3.5rem/1 var(--display); text-transform: uppercase; margin: 0 0 22px; }
.project-modal > p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }
.modal-close { position: absolute; right: 18px; top: 16px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 6px; background: transparent; font-size: 23px; cursor: pointer; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }
body.section-motion-active .motion-layer {
  opacity: var(--motion-opacity, 1);
  transform: translate3d(0, var(--motion-y, 0), 0) scale(var(--motion-scale, 1));
  filter: blur(var(--motion-blur, 0));
  transform-origin: center top;
  transition: none;
  will-change: opacity, transform, filter;
}
body.section-motion-active .section-heading { position: relative; padding-bottom: 22px; }
body.section-motion-active .section-heading::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--orange), rgba(255,103,28,.18), transparent 82%);
  transform: scaleX(var(--motion-progress, 0));
  transform-origin: left;
}
body.section-motion-active .project-visual.motion-layer {
  clip-path: inset(0 var(--motion-clip, 0) 0 0 round 18px 0 0 18px);
}
body.section-motion-active .skill-grid article.motion-layer::after,
body.section-motion-active .about-values article.motion-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, rgba(255,103,28,.1), transparent 42%);
  opacity: .45;
}
body.frame-story-active main { position: relative; }
body.frame-story-active footer { position: relative; z-index: 4; background: var(--bg); }
body.frame-story-active .character-wrap img { opacity: 0; }
body.frame-story-active .character-wrap::after { display: none; }
body.frame-story-active .hero-copy,
body.frame-story-active .hero-stats,
body.frame-story-active .hero-cards,
body.frame-story-active .projects > *,
body.frame-story-active .about > *,
body.frame-story-active .skills > *,
body.frame-story-active .contact > * { position: relative; z-index: 4; }
body.frame-story-active .hero-word { z-index: 0; }

@media (min-width: 901px) and (pointer: fine) {
  body.frame-story-active .projects,
  body.frame-story-active .about,
  body.frame-story-active .skills,
  body.frame-story-active .contact { min-height: 100vh; }
  body.frame-story-active .projects { padding-right: 39%; }
  body.frame-story-active .projects .section-heading { display: block; }
  body.frame-story-active .projects .section-heading > p { width: auto; max-width: 620px; margin-top: 22px; }
  body.frame-story-active .project-featured { grid-template-columns: 1fr; min-height: 0; }
  body.frame-story-active .project-visual { min-height: 330px; }
  body.frame-story-active .project-info { padding: 36px 38px 42px; }
  body.frame-story-active .about { grid-template-columns: .22fr 1fr; padding-right: 39%; gap: 45px; }
  body.frame-story-active .about-values { grid-column: 2; grid-template-columns: 1fr; }
  body.frame-story-active .about-values article { padding-left: 34px; }
  body.frame-story-active .skills { padding-right: 39%; }
  body.frame-story-active .skills .section-heading { display: block; }
  body.frame-story-active .skills .section-heading > p { width: auto; max-width: 620px; margin-top: 22px; }
  body.frame-story-active .skill-grid { grid-template-columns: repeat(2, 1fr); }
  body.frame-story-active .contact { grid-template-columns: 1fr; align-content: center; padding: 88px 43% 88px 70px; gap: 46px; background: radial-gradient(circle at 15% 50%, rgba(255,103,28,.09), transparent 32%), rgba(14,15,15,.42); }
}

@media (max-width: 1200px) {
  .hero { grid-template-columns: .9fr .8fr; grid-template-rows: 650px auto auto; }
  .character-wrap { min-width: 360px; }
  .character-wrap img { height: 660px; }
  .hero-stats { position: absolute; right: 0; bottom: 205px; max-width: 290px; }
  .hero-word { font-size: 13.4vw; }
  .hero-cards { grid-row: 3; }
  .about { grid-template-columns: .2fr 1fr; }
  .about-values { grid-column: 2; grid-template-columns: 1fr; }
  .about-values article { padding-left: 35px; }
  .contact { gap: 60px; padding: 70px 55px; }
}

@media (max-width: 900px), (pointer: coarse) {
  :root {
    --page-gutter: 20px;
    --section-title-size: 2.5rem;
    --hero-name-size: 3.1rem;
    --project-title-size: 2.75rem;
  }
  .scroll-character.is-ready { opacity: .62; }
  .character-aura { filter: none !important; }
  .aura-ring { filter: drop-shadow(0 0 4px rgba(255,103,28,.5)); }
  .aura-ring-dash, .aura-spark-two { display: none; }
  .aura-equator { border-width: 1px; }
  .aura-ring-wide { animation-duration: 22s; }
  .aura-ring-core { animation-duration: 14s; }
  .frame-loader { right: 18px; bottom: 18px; }
  .frame-loader small { display: none; }
  .site-header { padding: 0 18px; }
  .menu-toggle { display: block; position: relative; z-index: 2; }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .main-nav { position: fixed; inset: 0; height: 100dvh; background: rgba(7,8,8,.97); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 24px; opacity: 0; visibility: hidden; transition: .25s; }
  .main-nav.open { opacity: 1; visibility: visible; }
  .main-nav a { font: 600 3rem/1 var(--display); text-transform: uppercase; }
  .main-nav a::after { display: none; }
  .hero { display: block; min-height: auto; padding-top: 132px; }
  .hero-word { top: 133px; left: 18px; width: calc(100% - 18px); font-size: 0; white-space: nowrap; overflow: hidden; text-align: left; opacity: .35; }
  .hero-word::before { content: 'DEV'; font: 700 clamp(8rem, 40vw, 12rem)/.82 var(--display); letter-spacing: -.055em; }
  .cross { display: none; }
  .hero-copy { position: relative; padding: 160px 0 40px; max-width: 460px; }
  .character-wrap { position: absolute; right: -110px; top: 120px; height: 680px; width: 550px; min-width: 0; opacity: .75; }
  .character-wrap::after { content: ''; position: absolute; z-index: 3; inset: 55% 0 0; background: linear-gradient(transparent, var(--bg) 82%); }
  .character-wrap img { height: 650px; }
  .orbit { display: none; }
  .hero-stats { position: relative; right: auto; bottom: auto; margin: 0 0 25px; max-width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .hero-stats > div { grid-template-columns: 45px 1fr; padding: 10px; border-right: 1px solid var(--line); border-bottom: 0; }
  .hero-stats > div:last-child { border: 0; }
  .hero-stats p { grid-column: 1 / -1; margin-top: 5px; }
  .hero-cards { grid-template-columns: 1fr; }
  .mini-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .mini-card:last-child { border-bottom: 0; }
  .section-heading { display: block; }
  .section-heading > p { width: auto; margin-top: 25px; max-width: 520px; }
  .project-featured { grid-template-columns: 1fr; }
  .project-visual { min-height: 430px; }
  .about { grid-template-columns: 1fr; gap: 45px; }
  .about-number { font-size: 7rem; }
  .about-values { grid-column: auto; }
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
  .contact { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .site-header { min-height: 62px; top: 12px; }
  .brand { font-size: 17px; gap: 10px; }.brand-mark { font-size: 32px; }
  .hero { padding-top: 92px; }
  .hero-word { top: 112px; }
  .hero-copy { padding-top: 145px; }
  .role { font-size: 1rem; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .hero-socials { padding-left: 0; }
  .character-wrap { right: -215px; top: 80px; height: 630px; opacity: .58; }
  .character-wrap img { height: 610px; }
  .hero-stats { grid-template-columns: 1fr; padding: 4px 16px; }
  .hero-stats > div { min-height: 72px; grid-template-columns: 52px 67px 1fr; border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-stats p { grid-column: auto; margin: 0; }
  .mini-card { padding: 18px 20px; }
  .projects, .skills { padding-top: 105px; }
  .section-heading { margin-bottom: 34px; }
  .project-visual { min-height: 280px; }
  .project-info { padding: 35px 25px; }
  .project-actions { flex-direction: column; align-items: stretch; }
  .project-actions .button { width: 100%; }
  .about { margin-top: 75px; padding: 95px 0; }
  .about-values { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: 1fr; }
  .skill-grid article { min-height: 140px; }
  .contact { padding: 48px 23px; margin-bottom: 45px; gap: 55px; }
  .contact-socials { flex-direction: column; }
  .project-modal { padding: 45px 25px 30px; }
  .project-modal h2 { font-size: 2.8rem; }
  footer { flex-wrap: wrap; padding: 25px 0; }
  footer p { order: 3; width: 100%; }
}

/* Mobile navigation and safe areas, including short landscape viewports. */
html { -webkit-text-size-adjust: 100%; }
.section, .hero-copy, .project-info, .about-copy, .skill-category, .contact-copy { min-width: 0; }
@media (max-width: 900px), (pointer: coarse) {
  :root { --page-gutter: clamp(14px, 4vw, 24px); }
  body { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  body.menu-open { overscroll-behavior: none; }
  .site-header, .site-header.scrolled {
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: max(var(--page-gutter), env(safe-area-inset-left, 0px));
    right: max(var(--page-gutter), env(safe-area-inset-right, 0px));
    min-height: 62px; backdrop-filter: none; -webkit-backdrop-filter: none;
    background: #0b0e0e; padding: 0 14px;
  }
  .menu-toggle { width: 48px; height: 48px; flex-shrink: 0; touch-action: manipulation; }
  .main-nav {
    height: 100vh; height: 100dvh; width: 100%;
    padding: calc(94px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
    justify-content: flex-start; align-items: stretch; gap: 4px;
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    transition: opacity .18s, visibility .18s;
  }
  .main-nav a { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 10px 12px; font-size: clamp(20px, 4vw, 30px); line-height: 1.2; border-bottom: 1px solid var(--line); }
  .main-nav a:last-child { margin-top: 8px; color: var(--orange); }
  .main-nav a.active { background: #151919; border-radius: 6px; }
  .hero { padding-top: calc(100px + env(safe-area-inset-top, 0px)); }
  .hero-copy { padding-top: clamp(90px, 16svh, 145px); }
  .hero-actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
  .hero-actions .button { min-width: 0; flex: 1 1 150px; min-height: 48px; }
  .hero-socials { flex-basis: 100%; padding-left: 0; }
  .role strong { min-width: 0; }
  .feature-list p { font-size: 14px; }
  .hero-stats p { font-size: 12px; }
  .contact-copy > p { overflow-wrap: anywhere; }
  .contact-socials a { min-height: 48px; }
  footer { padding-bottom: calc(25px + env(safe-area-inset-bottom, 0px)); }
  .project-modal { max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
  /* Keep reading and tapping stable while the character follows touch scrolling. */
  body.section-motion-active .motion-layer { opacity: 1; transform: none; filter: none; will-change: auto; }
  body.section-motion-active .project-visual.motion-layer { clip-path: none; }
}
@media (max-width: 360px) {
  .brand { font-size: 16px; gap: 8px; }
  .hero-copy h1 { font-size: 2.7rem; }
  .hero-stats { padding-inline: 10px; }
  .hero-stats > div { grid-template-columns: 36px 58px minmax(0, 1fr); gap: 8px; }
  .stat-icon { width: 32px; height: 40px; }
  .hero-stats strong { font-size: 23px; }
  .project-info { padding: 28px 18px; }
  .contact { padding-inline: 18px; }
}
@media (max-width: 900px) and (max-height: 500px), (pointer: coarse) and (max-height: 500px) {
  .main-nav { padding-top: calc(84px + env(safe-area-inset-top, 0px)); }
  .main-nav a { min-height: 44px; font-size: 20px; }
  .hero-copy { padding-top: 56px; }
}

@media (max-width: 900px), (pointer: coarse) {
  .hero-copy { padding-top: 230px; }
  .character-wrap { top: 100px; right: 0; width: 44%; height: min(220px, 56vw); opacity: 1; align-items: flex-start; }
  .character-wrap img { height: 100%; max-width: 100%; width: auto; }
  .character-wrap::after { display: none; }
  .scroll-character.is-ready { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .character-aura { display: none !important; }
}
