:root {
  --forest: #0d2b1e;
  --pine: #1e5e3a;
  --green: #22c55e;
  --green-bright: #34d399;
  --mist: #e7f5ec;
  --slate: #e2e5e7;
  --white: #fff;
  --ink: #112e22;
  --muted: #5d7067;
  --card-bg: #123726;
  --glass: rgba(13, 43, 30, 0.85);
  --serif-display: "Satoshi", "Inter", sans-serif;
  --ui: "Inter", Arial, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --grid-x: 50%;
  --grid-y: 40%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body { margin: 0; background: var(--mist); color: var(--forest); font-family: var(--ui); font-size: 16px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.container { width: min(100% - 48px, 1240px); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; left: 20px; top: -50px; background: var(--green); padding: 10px 14px; color: var(--forest); font-weight: 700; transition: top .2s; }
.skip-link:focus { top: 20px; }

/* Header & Nav */
.site-header { position: absolute; z-index: 10; inset: 0 0 auto; color: var(--mist); transition: background .22s, box-shadow .22s; }
.site-header.scrolled { position: fixed; background: rgba(13, 43, 30, .96); box-shadow: 0 1px 0 rgba(231, 245, 236, .13); backdrop-filter: blur(14px); }
.nav-wrap { height: 82px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--serif-display); font-size: 23px; font-weight: 800; letter-spacing: -1.1px; }
.brand-mark { width: 30px; height: 27px; display: block; object-fit: cover; filter: invert(1); }

.header-right { display: flex; align-items: center; gap: 20px; }

/* Language Switcher */
.lang-switcher { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: rgba(231, 245, 236, 0.12); border: 1px solid rgba(231, 245, 236, 0.25); border-radius: 20px; color: var(--mist); font-size: 12px; font-weight: 700; transition: background .2s, border-color .2s, transform .15s; }
.lang-switcher:hover { background: rgba(34, 197, 94, 0.2); border-color: var(--green); transform: translateY(-1px); }
.lang-flag { font-size: 14px; }

.main-nav { display: flex; align-items: center; gap: 28px; font-size: 13px; font-weight: 600; }
.main-nav > a:not(.button) { position: relative; opacity: .88; transition: opacity .2s; }
.main-nav > a:not(.button)::after { content: ""; height: 2px; position: absolute; bottom: -6px; left: 0; right: 0; background: var(--green); transform: scaleX(0); transform-origin: right; transition: transform .2s var(--ease-out); }
.main-nav > a:not(.button):hover { opacity: 1; }.main-nav > a:not(.button):hover::after { transform: scaleX(1); transform-origin: left; }

.button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; padding: 14px 22px; background: var(--green); color: var(--forest); border: 1px solid var(--green); border-radius: 8px; font-size: 14px; font-weight: 800; transition: transform .2s var(--ease-out), background .2s, border-color .2s, box-shadow .2s; }
.button:hover { transform: translateY(-3px); background: #34d36b; border-color: #34d36b; box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3); }
.button span, .text-link span, .project-link span { font-size: 16px; line-height: 12px; transition: transform .2s var(--ease-out); }
.button:hover span, .text-link:hover span, .project-link:hover span { transform: translate(3px, -2px); }
.button-small { padding: 9px 16px; font-size: 12px; }
.menu-toggle { display: none; }

/* Hero Section */
.hero { min-height: 740px; padding: 160px 0 80px; position: relative; overflow: hidden; background-color: var(--forest); color: var(--mist); }
.modular-surface::before { content: ""; position: absolute; pointer-events: none; inset: 0; opacity: .12; background-image: url("data:image/svg+xml,%3Csvg width='148' height='128' viewBox='0 0 148 128' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%2374d796' stroke-width='1'%3E%3Cpath d='M37 2 74 23v42L37 86 0 65V23ZM111 44l37 21v42l-37 21-37-21V65Z'/%3E%3C/g%3E%3C/svg%3E"); background-size: 148px 128px; background-position: var(--grid-x) var(--grid-y); transition: background-position .12s linear; }
.hero::after { content: ""; position: absolute; height: 1px; background: rgba(231,245,236,.25); left: 0; right: 0; bottom: 0; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; min-height: 480px; gap: 36px; }

.status-badge { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px; background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.3); border-radius: 20px; color: var(--green); font-size: 12px; font-weight: 700; margin-bottom: 24px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

h1, h2, h3, h4 { margin: 0; font-family: var(--serif-display); letter-spacing: -.045em; }
h1 { max-width: 720px; font-size: clamp(40px, 4.4vw, 64px); line-height: 1.03; font-weight: 900; }
.hero h1 em { color: var(--green); font-style: normal; text-shadow: 0 0 20px rgba(34, 197, 94, 0.2); }
.hero-description { max-width: 580px; margin: 24px 0 36px; color: #c1d3c8; font-size: 17px; line-height: 1.65; }
.hero-actions { display: flex; align-items: center; gap: 24px; }
.text-link { display: inline-flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--mist); border-bottom: 1px solid rgba(231,245,236,.35); font-size: 14px; font-weight: 700; transition: border .2s, color .2s; }
.text-link:hover { color: var(--green); border-color: var(--green); }

/* Hero Graphic System */
.hero-system { width: 100%; max-width: 460px; justify-self: end; position: relative; aspect-ratio: 1; background: transparent; display: flex; align-items: center; justify-content: center; }
.hero-system::before { display: none; }
.frog-assembly { position: relative; width: 95%; height: 95%; top: 0; left: 0; display: block; object-fit: contain; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.4)) drop-shadow(0 0 25px rgba(34, 197, 94, 0.3)); animation: mark-in .72s var(--ease-out) both; }
.system-label, .system-base { display: none; }
@keyframes mark-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* Tech Strip Marquee */
.tech-strip { height: 64px; overflow: hidden; display: flex; align-items: center; background: #103222; border-bottom: 1px solid rgba(231,245,236,.1); color: #b9d1c1; }
.tech-track { display: flex; width: max-content; animation: marquee 34s linear infinite; }
.tech-group { display: flex; align-items: center; gap: 32px; padding-right: 32px; white-space: nowrap; font-size: 13px; font-weight: 700; letter-spacing: .03em; }
.tech-group b { color: var(--green); font-size: 12px; }
@keyframes marquee { to { transform: translateX(-50%); } }
.tech-strip:hover .tech-track { animation-play-state: paused; }

/* Sections Common */
.section { position: relative; padding: 110px 0; }
.eyebrow { margin: 0 0 16px; display: flex; gap: 8px; align-items: center; color: var(--green); text-transform: uppercase; letter-spacing: .15em; font-size: 12px; font-weight: 800; }
.eyebrow-index { color: var(--green); }

/* About Section */
.about { background: var(--mist); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: min(10vw, 120px); }
.section-intro h2, .projects-heading h2 { font-size: clamp(32px, 3.4vw, 48px); line-height: 1.08; font-weight: 900; }
.about-copy { padding-top: 20px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.about-copy p { margin: 0 0 20px; }
.about-copy .lead { color: var(--forest); font-size: 21px; line-height: 1.5; letter-spacing: -.025em; font-weight: 700; }
.dark-link { color: var(--forest); border-color: rgba(13,43,30,.3); margin-top: 8px; }
.dark-link:hover { color: var(--pine); border-color: var(--pine); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid rgba(13,43,30,.2); margin-top: 80px; }
.stat { min-height: 150px; padding: 25px 22px 0 0; display: flex; flex-direction: column; gap: 8px; border-right: 1px solid rgba(13,43,30,.2); }
.stat + .stat { padding-left: 25px; }
.stat strong { font-family: var(--serif-display); letter-spacing: -.06em; font-size: 52px; line-height: 1; color: var(--forest); font-weight: 900; }
.stat span { max-width: 140px; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.45; text-transform: uppercase; }
.stat-note { justify-content: flex-end; border-right: 0; }
.stat-note span { max-width: 220px; color: var(--pine); font-size: 13px; line-height: 1.5; text-transform: none; font-weight: 600; }

/* Skills Section */
.skills-section { background: var(--forest); color: var(--mist); }
.skills-section .section-intro { margin-bottom: 50px; }
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.skill-card { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(231, 245, 236, 0.15); border-radius: 10px; padding: 28px 24px; transition: transform .2s var(--ease-out), border-color .2s; }
.skill-card:hover { transform: translateY(-4px); border-color: var(--green); background: rgba(255, 255, 255, 0.08); }
.skill-icon { font-size: 32px; margin-bottom: 16px; }
.skill-card h3 { font-size: 20px; margin-bottom: 10px; color: var(--mist); font-weight: 800; }
.skill-card p { font-size: 13px; color: #b7cec0; line-height: 1.55; margin: 0 0 20px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-tags span { padding: 4px 8px; background: rgba(34, 197, 94, 0.15); color: var(--green); border-radius: 4px; font-size: 11px; font-weight: 700; }

/* Projects Section */
.projects { background: #fff; }
.projects-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 35px; margin-bottom: 36px; }
.projects-heading h2 { max-width: 600px; }
.projects-heading > p { max-width: 380px; margin: 0 0 6px; color: var(--muted); font-size: 14px; line-height: 1.55; }

/* Filter Buttons */
.filter-wrap { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.filter-btn { padding: 8px 18px; border: 1px solid var(--slate); border-radius: 20px; background: var(--white); color: var(--forest); font-size: 13px; font-weight: 700; transition: all .2s; }
.filter-btn:hover { border-color: var(--pine); color: var(--pine); }
.filter-btn.active { background: var(--forest); border-color: var(--forest); color: var(--green); box-shadow: 0 4px 12px rgba(13,43,30,0.15); }

/* Projects Grid */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project-card { display: flex; flex-direction: column; border: 1px solid var(--slate); border-radius: 12px; overflow: hidden; background: var(--white); transition: transform .22s var(--ease-out), border-color .22s, box-shadow .22s; position: relative; }
.project-card:hover { transform: translateY(-6px); border-color: var(--green); box-shadow: 0 14px 30px rgba(13,43,30,.12); }

.project-visual-box { height: 220px; position: relative; overflow: hidden; background: var(--forest); }
.project-visual-box img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .3s var(--ease-out); }
.project-card:hover .project-visual-box img { transform: scale(1.05); }

.project-badge-bar { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; z-index: 2; pointer-events: none; }
.proj-cat-badge { padding: 4px 10px; background: rgba(13, 43, 30, 0.88); color: var(--green); border-radius: 4px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; backdrop-filter: blur(4px); }
.proj-date-badge { padding: 4px 8px; background: rgba(0, 0, 0, 0.7); color: #e2e8f0; border-radius: 4px; font-size: 10px; font-weight: 700; backdrop-filter: blur(4px); }

.project-info { padding: 24px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.project-title-box h3 { font-size: 22px; line-height: 1.15; font-weight: 800; color: var(--forest); margin-bottom: 10px; }
.project-title-box p { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 0; }

.project-tags-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.project-tags-list span { padding: 3px 7px; background: var(--mist); color: var(--pine); border-radius: 3px; font-size: 11px; font-weight: 700; }

.project-actions-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--slate); padding-top: 14px; }
.btn-preview { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; background: var(--mist); color: var(--forest); border-radius: 6px; font-size: 12px; font-weight: 800; border: 1px solid rgba(13,43,30,0.1); transition: all .2s; }
.btn-preview:hover { background: var(--green); color: var(--forest); border-color: var(--green); }
.btn-demo-link { font-size: 12px; font-weight: 700; color: var(--pine); text-decoration: underline; }

/* Contact Section */
.contact { overflow: hidden; background: var(--forest); color: var(--mist); }
.contact::before { opacity: .09; }
.contact-wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: 80px; }
.contact h2 { max-width: 600px; font-size: clamp(36px, 4vw, 54px); line-height: 1.05; font-weight: 900; }
.contact-copy > p { margin: 20px 0 30px; color: #bbd0c1; font-size: 16px; line-height: 1.6; }

.contact-methods { display: flex; flex-direction: column; gap: 14px; }
.contact-method-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(231, 245, 236, 0.15); border-radius: 8px; transition: background .2s, border-color .2s; }
.contact-method-item:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--green); }
.method-icon { font-size: 22px; }
.contact-method-item small { display: block; color: var(--green); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.contact-method-item strong { color: var(--mist); font-size: 14px; }

.contact-form { display: grid; gap: 18px; }
.contact-form label { display: grid; gap: 6px; color: #c4d6ca; font-size: 12px; font-weight: 700; }
.contact-form input, .contact-form textarea { resize: vertical; width: 100%; padding: 10px 12px; outline: 0; border: 1px solid rgba(231,245,236,.3); border-radius: 6px; background: rgba(0, 0, 0, 0.2); color: var(--mist); font-size: 14px; transition: border-color .2s; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: rgba(231,245,236,.4); }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--green); background: rgba(0, 0, 0, 0.3); }

/* Footer */
.site-footer { background: #081d14; color: var(--mist); }
.footer-top { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 35px; }
.footer-top > p { margin: 0; color: var(--green); letter-spacing: .14em; font-size: 11px; font-weight: 800; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; color: #aec5b4; font-size: 13px; font-weight: 600; }
.footer-links a:hover { color: var(--green); }
.footer-bottom { display: flex; justify-content: space-between; border-top: 1px solid rgba(231,245,236,.12); padding: 20px 0 24px; color: #8eaa99; font-size: 12px; }
.footer-bottom a:hover { color: var(--green); }

/* Interactive Modal ("Palinha Tela a Tela") */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(5, 20, 14, 0.88); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .25s var(--ease-out); }
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal-content { background: var(--forest); color: var(--mist); border: 1px solid rgba(231, 245, 236, 0.2); border-radius: 14px; width: min(100%, 1100px); max-height: 90vh; overflow-y: auto; position: relative; box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5); }
.modal-close { position: absolute; top: 16px; right: 20px; z-index: 10; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 50%; width: 36px; height: 36px; color: var(--mist); font-size: 24px; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.modal-close:hover { background: var(--green); color: var(--forest); }

.modal-body { display: grid; grid-template-columns: 1.15fr .85fr; }

/* Modal Carousel */
.modal-carousel-section { background: #081a12; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid rgba(231, 245, 236, 0.1); }
.modal-main-image-wrap { position: relative; height: 400px; border-radius: 8px; overflow: hidden; background: #000; display: flex; align-items: center; justify-content: center; }
.modal-main-image-wrap img { width: 100%; height: 100%; object-fit: contain; }

.carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(13, 43, 30, 0.8); border: 1px solid rgba(231, 245, 236, 0.3); color: var(--mist); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all .2s; }
.carousel-nav:hover { background: var(--green); color: var(--forest); }
.carousel-nav.prev { left: 12px; }
.carousel-nav.next { right: 12px; }
.modal-image-counter { position: absolute; bottom: 12px; right: 12px; background: rgba(0, 0, 0, 0.75); color: #fff; padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }

.modal-thumbnails { display: flex; gap: 10px; overflow-x: auto; padding-top: 16px; }
.thumb-item { width: 70px; height: 50px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; cursor: pointer; flex-shrink: 0; opacity: 0.6; transition: all .2s; }
.thumb-item.active, .thumb-item:hover { opacity: 1; border-color: var(--green); }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; }

/* Modal Info */
.modal-info-section { padding: 32px; display: flex; flex-direction: column; gap: 22px; }
.modal-meta { display: flex; gap: 10px; margin-bottom: 8px; }
.modal-category-badge { padding: 4px 10px; background: rgba(34, 197, 94, 0.2); color: var(--green); border-radius: 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.proj-cat-badge.badge-tcc { background: #f59e0b; color: #000; font-weight: 900; }
.modal-date-badge { padding: 4px 10px; background: rgba(255, 255, 255, 0.1); color: #cbd5e1; border-radius: 4px; font-size: 11px; font-weight: 700; }
.modal-header h2 { font-size: 32px; color: var(--mist); font-weight: 900; }

.modal-desc-box h4, .modal-rationale-box h4, .modal-tech-stack h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--green); margin-bottom: 8px; font-weight: 800; }
.modal-desc-box p, .modal-rationale-box p { font-size: 14px; color: #cbd5e1; line-height: 1.6; margin: 0; }

.modal-rationale-box { background: rgba(34, 197, 94, 0.08); border-left: 3px solid var(--green); padding: 14px 16px; border-radius: 0 8px 8px 0; }

.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-tags span { padding: 4px 10px; background: rgba(231, 245, 236, 0.1); color: var(--mist); border-radius: 4px; font-size: 12px; font-weight: 700; }

.modal-actions { display: flex; gap: 14px; margin-top: 10px; }

/* Reveal Animations */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .65s var(--ease-out), transform .65s var(--ease-out); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Responsive Media Queries */
@media (max-width: 1080px) {
  .projects-grid, .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-body { grid-template-columns: 1fr; }
  .modal-carousel-section { border-right: 0; border-bottom: 1px solid rgba(231, 245, 236, 0.1); }
}

@media (max-width: 800px) {
  .container { width: min(100% - 36px, 640px); }
  .nav-wrap { height: 70px; }
  .main-nav { display: none; position: absolute; top: 70px; right: 20px; left: 20px; padding: 20px; align-items: stretch; flex-direction: column; gap: 16px; border: 1px solid rgba(231,245,236,.2); border-radius: 8px; background: var(--forest); box-shadow: 0 16px 35px rgba(0,0,0,.4); }
  .main-nav.open { display: flex; }
  .menu-toggle { position: relative; display: block; width: 36px; height: 36px; padding: 0; border: 1px solid rgba(231,245,236,.38); border-radius: 5px; background: transparent; }
  .menu-toggle span:not(.sr-only) { position: absolute; width: 16px; height: 2px; left: 9px; background: var(--mist); transition: transform .2s; }
  .menu-toggle span:nth-child(2) { top: 13px; }
  .menu-toggle span:nth-child(3) { top: 21px; }
  .menu-toggle.active span:nth-child(2) { transform: translateY(4px) rotate(45deg); }
  .menu-toggle.active span:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }

  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-system { width: min(100%, 500px); justify-self: start; }
  .about-grid, .contact-wrap { grid-template-columns: 1fr; gap: 40px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); margin-top: 60px; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(3) { border-top: 1px solid rgba(13,43,30,.2); padding-left: 0; }
  .stat:nth-child(4) { border-top: 1px solid rgba(13,43,30,.2); }
}

@media (max-width: 580px) {
  .projects-grid, .skills-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal-main-image-wrap { height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tech-track, .frog-assembly { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
