/* =====================================================
   Carlos Westfal — Portfólio v2
   Ordem: temas -> base -> header -> hero -> seções -> cards -> mobile
   ===================================================== */

:root {
  color-scheme: dark;
  --bg: #080e1a;
  --surface: #101b2e;
  --surface-2: #14243c;
  --surface-soft: #0d1627;
  --text: #f3f7ff;
  --muted: #a0afc7;
  --faint: #7488a6;
  --border: #23334e;
  --accent: #4d90ff;
  --accent-strong: #337af4;
  --accent-light: #80b0ff;
  --accent-glow: rgba(59, 130, 246, .16);
  --shadow: 0 24px 65px rgba(0, 0, 0, .25);
  --header: rgba(8, 14, 26, .88);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f9ff;
  --surface: #ffffff;
  --surface-2: #edf3fc;
  --surface-soft: #f0f5fd;
  --text: #17253d;
  --muted: #51627c;
  --faint: #63738c;
  --border: #dbe4f0;
  --accent: #2563eb;
  --accent-strong: #1d4fd2;
  --accent-light: #2d70ee;
  --accent-glow: rgba(37, 99, 235, .10);
  --shadow: 0 22px 55px rgba(39, 62, 107, .09);
  --header: rgba(246, 249, 255, .90);
}

/* RESET E ACESSIBILIDADE */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .28s ease, color .28s ease;
}
a { text-decoration: none; color: inherit; }
button { font: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: white; }
.container { width: min(1320px, calc(100% - 96px)); margin-inline: auto; }
.skip-link { position: fixed; left: 18px; top: -90px; background: var(--surface); padding: 12px 16px; border-radius: 10px; z-index: 100; }
.skip-link:focus { top: 12px; }
.site-glow {
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 760px;
  z-index: -1;
  background: radial-gradient(ellipse 40% 48% at 76% 35%, var(--accent-glow), transparent 78%);
}

/* CABEÇALHO */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--header);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.header-inner { min-height: 78px; display: flex; justify-content: space-between; align-items: center; gap: 26px; }
.brand, .footer-brand { font-weight: 850; font-size: 32px; letter-spacing: -.12em; line-height: 1; }
.brand span, .footer-brand span { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: clamp(15px, 2.3vw, 33px); margin-left: auto; }
.site-nav a { color: var(--muted); font-size: .89rem; transition: color .2s ease; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--accent-light); }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: 18px; }
.header-cta { font-size: .84rem; font-weight: 700; border: 1px solid var(--border); padding: 10px 15px; border-radius: 10px; white-space: nowrap; transition: border-color .2s, transform .2s; }
.header-cta span { color: var(--accent); margin-left: 8px; }
.header-cta:hover { border-color: var(--accent); transform: translateY(-1px); }
.icon-button { display: grid; place-items: center; flex: none; width: 43px; height: 43px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; color: var(--text); cursor: pointer; transition: border-color .2s, background .2s; }
.icon-button:hover { border-color: var(--accent); background: var(--surface-2); }
.theme-toggle { font-size: 18px; }
.menu-toggle { display: none; }

/* TIPOGRAFIA COMPARTILHADA */
.eyebrow, .section-kicker { display: flex; align-items: center; gap: 11px; margin: 0 0 23px; color: var(--accent-light); font-size: .76rem; line-height: 1.5; letter-spacing: .18em; font-weight: 750; }
.eyebrow-dot { width: 7px; height: 7px; background: #3bdd9c; box-shadow: 0 0 0 5px rgba(59, 221, 156, .11); border-radius: 100%; flex: none; }
.section-kicker span { color: var(--faint); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.045em; line-height: 1.12; }
h2 { font-size: clamp(2.15rem, 3.55vw, 3.45rem); margin: 0 0 25px; }
.text-accent { color: var(--accent); }
.section { padding-block: clamp(78px, 8vw, 126px); }
.section-heading { max-width: 760px; margin-bottom: 40px; }
.section-heading p:last-child { color: var(--muted); font-size: 1rem; max-width: 600px; margin: 0; }

/* HERO */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); align-items: center; gap: clamp(32px, 6vw, 90px); min-height: min(740px, calc(100svh - 79px)); padding-block: 95px; }
.hero-copy { position: relative; z-index: 1; }
.hero h1 { max-width: 750px; margin: 0 0 24px; font-size: clamp(3.1rem, 5.1vw, 5.65rem); line-height: 1.045; letter-spacing: -.067em; font-weight: 780; }
.hero h1 .text-accent { display: inline; }
.lead { color: var(--muted); max-width: 590px; font-size: clamp(1rem, 1.3vw, 1.13rem); line-height: 1.8; }
.lead strong { color: var(--text); font-weight: 650; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 19px; min-height: 50px; padding: 12px 20px; border-radius: 11px; font-size: .9rem; font-weight: 720; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.button:hover { transform: translateY(-3px); }
.button-primary { background: var(--accent-strong); color: #fff; box-shadow: 0 9px 28px rgba(43, 104, 223, .17); }
.button-primary:hover { box-shadow: 0 13px 34px rgba(43, 104, 223, .32); }
.button-outline { color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.button-outline:hover { border-color: var(--accent); }
.hero-footnote { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: .8rem; margin-top: 38px; }
.hero-footnote .line { width: 33px; height: 1px; background: var(--accent); }
.hero-visual { position: relative; padding: 34px 8px; min-width: 0; }
.hero-visual::before { content: ""; position: absolute; inset: -10px -25px; background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 23px 23px; mask-image: radial-gradient(ellipse at 50% 50%, #000, transparent 72%); opacity: .5; pointer-events: none; }
.terminal-card { position: relative; isolation: isolate; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 17px; box-shadow: var(--shadow), 0 0 0 9px rgba(75, 145, 255, .025); }
.terminal-bar { display: flex; align-items: center; gap: 14px; height: 50px; border-bottom: 1px solid var(--border); padding-inline: 18px; color: var(--faint); font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.window-dots { display: flex; gap: 6px; }
.window-dots i { width: 9px; height: 9px; background: #ff665c; border-radius: 50%; }
.window-dots i:nth-child(2) { background: #ffbd45; }
.window-dots i:nth-child(3) { background: #38c878; }
.terminal-pill { margin-left: auto; border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; font-size: 11px; }
.terminal-content { padding: clamp(22px, 3vw, 34px); font: clamp(12px, 1vw, 14px)/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; }
.terminal-line { margin-bottom: 6px; white-space: nowrap; }
.terminal-dollar { color: #49d7a7; margin-right: 6px; font-weight: bold; }
.terminal-cmd { color: var(--text); }
.terminal-value { margin: 0 0 22px 22px; color: var(--muted); }
.terminal-muted { color: var(--faint); }
.terminal-blue { color: var(--accent-light); }
.cursor { display: inline-block; width: 8px; height: 16px; background: var(--accent); vertical-align: -3px; animation: blink 1.1s steps(2, start) infinite; }
.terminal-bottom { border-top: 1px solid var(--border); padding: 13px 20px; display: flex; align-items: center; gap: 9px; font-size: .72rem; color: var(--muted); }
.terminal-bottom > span:last-child { margin-left: auto; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--faint); }
.status-light { width: 7px; height: 7px; flex: none; background: #39d5a4; border-radius: 50%; }
.floating-tag { position: absolute; z-index: 2; padding: 10px 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--muted); box-shadow: 0 8px 20px rgba(0, 0, 0, .12); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.floating-tag span { color: var(--accent-light); margin-right: 7px; }
.floating-tag-a { right: -19px; top: 5px; transform: rotate(3deg); }
.floating-tag-b { bottom: -4px; left: -20px; transform: rotate(-2deg); }
@keyframes blink { to { opacity: 0; } }

/* SOBRE */
.about-layout { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(45px, 9vw, 155px); padding-top: 28px; border-top: 1px solid var(--border); }
.about-layout h2 { max-width: 590px; }
.about-copy { padding-top: 50px; }
.about-copy > p { font-size: 1.05rem; color: var(--muted); margin-bottom: 18px; }
.about-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 30px; }
.about-highlights > div { display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.about-highlights span { color: var(--accent); font: 700 .78rem ui-monospace, SFMono-Regular, Consolas, monospace; margin-bottom: 11px; }
.about-highlights strong { font-size: .9rem; }
.about-highlights small { color: var(--muted); font-size: .75rem; margin-top: 4px; }

/* TECNOLOGIAS */
.section-tonal { background: linear-gradient(180deg, var(--surface-soft), var(--bg)); border-block: 1px solid var(--border); }
.skill-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.skill-panel { border: 1px solid var(--border); border-radius: 17px; padding: clamp(21px, 3vw, 32px); background: var(--surface); transition: border-color .2s ease, transform .2s ease; }
.skill-panel:hover { border-color: var(--accent); transform: translateY(-3px); }
.skill-panel-heading { display: flex; align-items: center; gap: 17px; margin-bottom: 25px; }
.skill-symbol { display: grid; place-items: center; min-width: 53px; height: 53px; padding: 0 5px; border-radius: 12px; background: rgba(74, 142, 255, .12); color: var(--accent-light); font: 700 1rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.skill-panel h3 { font-size: 1.12rem; margin: 0 0 5px; letter-spacing: -.02em; }
.skill-panel-heading p { font-size: .82rem; margin: 0; color: var(--muted); }
.tag-group { display: flex; flex-wrap: wrap; gap: 9px; }
.tag-group span { background: var(--surface-2); border: 1px solid var(--border); padding: 8px 13px; border-radius: 8px; font-size: .81rem; font-weight: 600; }
.tag-group .tag-learning { border-color: rgba(77, 144, 255, .26); color: var(--accent-light); }

/* PROJETOS */
.projects-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project-card { overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); display: flex; flex-direction: column; min-width: 0; transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.project-card:hover { transform: translateY(-7px); border-color: rgba(77, 144, 255, .66); box-shadow: var(--shadow); }
.project-featured { border-color: rgba(77, 144, 255, .42); }
.project-art { position: relative; display: grid; place-items: center; height: 220px; overflow: hidden; border-bottom: 1px solid var(--border); }
.art-portfolio { background: radial-gradient(ellipse at 78% 22%, rgba(66, 132, 251, .34), transparent 55%), linear-gradient(135deg, #08182c, #102d54); }
.art-orbit { position: absolute; right: -65px; top: -87px; width: 210px; height: 210px; border: 1px solid rgba(138, 191, 255, .14); border-radius: 50%; }
.mini-browser { position: relative; z-index: 1; width: 75%; height: 165px; border: 1px solid #314f75; border-radius: 10px; background: #0a1425; box-shadow: 12px 16px 32px rgba(0, 0, 0, .32); transform: rotate(-5deg) translateY(10px); overflow: hidden; }
.mini-browser-top { height: 29px; display: flex; align-items: center; gap: 4px; border-bottom: 1px solid #263956; padding: 0 10px; }
.mini-browser-top > span { width: 5px; height: 5px; background: #f66b6b; border-radius: 50%; }
.mini-browser-top > span:nth-child(2) { background: #eab753; }
.mini-browser-top > span:nth-child(3) { background: #32c780; }
.mini-address { margin: auto; color: #6f8ba9; font: 8px ui-monospace, SFMono-Regular, Consolas, monospace; }
.mini-browser-main { padding: 15px 18px; }
.mini-kicker { width: 69px; height: 5px; border-radius: 6px; background: #427de8; margin-bottom: 14px; }
.mini-headline { font-size: 24px; line-height: 1.05; font-weight: 800; color: #fff; letter-spacing: -.06em; }
.mini-headline em { color: #5695ff; font-style: normal; }
.mini-lines { margin-top: 13px; }
.mini-lines i { display: block; height: 4px; width: 68%; border-radius: 5px; margin-bottom: 5px; background: #304564; }
.mini-lines i:nth-child(2) { width: 43%; }
.mini-button { width: 65px; height: 15px; border-radius: 4px; background: #3b7ae7; margin-top: 12px; }
.art-studies { background: radial-gradient(ellipse at 15% 85%, rgba(43, 136, 148, .34), transparent 70%), linear-gradient(135deg, #0b2333, #10202e); }
.study-window { width: 81%; max-width: 290px; padding: 14px; background: rgba(8, 23, 33, .82); border: 1px solid #2b4e5f; border-radius: 10px; transform: translateY(8px) rotate(3deg); box-shadow: 10px 13px 25px rgba(0, 0, 0, .24); }
.study-title { color: #d4e9ee; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; padding-bottom: 12px; border-bottom: 1px solid #284352; }
.study-title span { color: #55d9ca; font-weight: 800; }
.study-row { display: flex; align-items: center; gap: 11px; padding: 7px 0; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; color: #bbd7df; border-bottom: 1px solid rgba(74, 104, 116, .2); }
.study-row:last-child { border-bottom: 0; }
.study-row b { color: #58cbbb; font-weight: normal; }
.study-row i { margin-left: auto; width: 22px; height: 4px; border-radius: 5px; background: #346772; }
.art-landing { background: radial-gradient(ellipse at 85% 40%, rgba(145, 104, 214, .34), transparent 63%), linear-gradient(135deg, #192443, #271d41); }
.landing-wireframe { width: 82%; height: 163px; background: #eef3ff; border-radius: 10px; box-shadow: 9px 14px 28px rgba(0, 0, 0, .24); transform: translateY(12px) rotate(-3deg); overflow: hidden; }
.landing-nav { display: flex; align-items: center; gap: 10px; height: 32px; padding-inline: 14px; border-bottom: 1px solid #dce5f2; }
.landing-nav i { width: 26px; height: 7px; border-radius: 4px; background: #526bdc; margin-right: auto; }
.landing-nav span { width: 21px; height: 3px; border-radius: 3px; background: #a8b3c8; }
.landing-content { display: grid; grid-template-columns: 1.25fr .75fr; height: calc(100% - 32px); align-items: center; gap: 8px; padding: 0 18px; }
.landing-content b { display: block; font-size: 19px; line-height: 1.13; color: #203452; letter-spacing: -.06em; }
.landing-content em { color: #6b60d9; font-style: normal; }
.landing-content i { display: block; width: 85%; height: 3px; background: #abb8cf; border-radius: 3px; margin-top: 8px; }
.landing-content i:nth-of-type(2) { width: 64%; margin-top: 4px; }
.landing-content div > span { display: block; width: 58px; height: 15px; margin-top: 11px; background: #6d65e3; border-radius: 4px; }
.landing-picture { height: 93px; display: grid; place-items: center; border-radius: 8px; background: linear-gradient(135deg, #c8c9ff, #eecefa); overflow: hidden; }
.landing-circle { height: 64px; width: 64px; border-radius: 50%; background: linear-gradient(135deg, #9e8feb, #6e6ee2); box-shadow: 10px 14px 0 rgba(255, 255, 255, .25); }
.project-info { display: flex; flex-direction: column; flex: 1; padding: 25px; }
.project-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; }
.project-category { color: var(--accent-light); font-size: .68rem; letter-spacing: .14em; font-weight: 800; }
.project-status { color: #45d3a0; display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 650; white-space: nowrap; }
.project-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.project-status-muted { color: var(--faint); }
.project-info h3 { font-size: 1.4rem; margin: 0 0 12px; }
.project-info p { color: var(--muted); font-size: .9rem; line-height: 1.7; margin-bottom: 23px; }
.project-stack { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; margin-bottom: 24px; }
.project-stack span { color: var(--muted); font-size: .71rem; border: 1px solid var(--border); padding: 5px 8px; border-radius: 6px; }
.project-links { display: flex; gap: 25px; }
.project-links a { font-weight: 750; color: var(--accent-light); font-size: .84rem; }
.project-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.project-quiet { color: var(--faint); font-size: .84rem; font-weight: 650; }

/* CONTATO */
.contact-section { padding-top: 25px; }
.contact-card { position: relative; overflow: hidden; text-align: center; padding: clamp(55px, 8vw, 100px) 24px; background: linear-gradient(135deg, var(--surface), var(--surface-soft)); border: 1px solid var(--border); border-radius: 24px; isolation: isolate; }
.contact-decoration { position: absolute; z-index: -1; width: 560px; height: 450px; left: 50%; top: -190px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, var(--accent-glow), transparent 67%); }
.contact-card .section-kicker { justify-content: center; }
.contact-card h2 { max-width: 770px; margin-inline: auto; }
.contact-card h2 span { color: var(--accent); }
.contact-card > p:not(.section-kicker) { color: var(--muted); max-width: 520px; margin: 0 auto 28px; }

/* RODAPÉ */
.site-footer { border-top: 1px solid var(--border); padding: 25px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-brand { font-size: 28px; }
.footer-inner p { margin: 0; color: var(--faint); font-size: .82rem; }
.back-to-top { font-size: .83rem; font-weight: 650; color: var(--muted); }
.back-to-top:hover { color: var(--accent); }

/* EFEITOS OPCIONAIS: JS ativa somente se há suporte */
.reveal-ready .reveal { opacity: 0; transform: translateY(20px); transition: opacity .68s ease, transform .68s cubic-bezier(.2,.72,.27,1); }
.reveal-ready .reveal.is-visible { opacity: 1; transform: translateY(0); }

/* TABLET E CELULAR */
@media (max-width: 1100px) {
  .container { width: min(1320px, calc(100% - 64px)); }
  .hero { gap: 32px; }
  .hero h1 { font-size: clamp(3.05rem, 5.2vw, 4.65rem); }
  .floating-tag-a { right: -4px; }
  .floating-tag-b { left: -5px; }
  .projects-grid { gap: 14px; }
  .project-info { padding: 20px; }
}
@media (max-width: 820px) {
  html { scroll-padding-top: 90px; }
  .header-inner { min-height: 70px; }
  .menu-toggle { display: grid; }
  .header-cta { display: none; }
  .site-nav {
    display: none; position: absolute; top: calc(100% + 1px); left: 0; width: 100%;
    padding: 16px max(24px, calc((100vw - 1320px)/2));
    margin: 0; border-bottom: 1px solid var(--border); background: var(--bg);
    box-shadow: 0 24px 35px rgba(0, 0, 0, .12); flex-direction: column; align-items: stretch; gap: 0;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { display: block; padding: 12px 8px; font-size: .95rem; }
  .hamburger { display: flex; flex-direction: column; gap: 4px; }
  .hamburger span { display: block; width: 18px; height: 2px; border-radius: 4px; background: var(--text); }
  .hero { min-height: auto; grid-template-columns: 1fr; padding-block: 80px 50px; gap: 26px; }
  .hero h1 { font-size: clamp(3rem, 8vw, 5rem); }
  .hero-visual { max-width: 650px; width: 100%; margin-inline: auto; }
  .about-layout { grid-template-columns: 1fr; gap: 0; }
  .about-copy { padding-top: 0; }
  .skill-layout { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-featured { grid-column: span 2; display: grid; grid-template-columns: 1fr 1.15fr; }
  .project-featured .project-art { height: 100%; min-height: 260px; border-bottom: 0; border-right: 1px solid var(--border); }
}
@media (max-width: 620px) {
  .container { width: calc(100% - 36px); }
  .section { padding-block: 72px; }
  .hero { padding-block: 67px 45px; }
  .hero h1 { font-size: clamp(2.75rem, 11vw, 4rem); letter-spacing: -.065em; }
  .eyebrow, .section-kicker { font-size: .69rem; }
  .lead { font-size: .98rem; }
  .hero-actions { gap: 10px; }
  .button { min-height: 48px; padding-inline: 15px; gap: 9px; }
  .hero-footnote { margin-top: 30px; }
  .hero-visual { padding-block: 21px; }
  .floating-tag { display: none; }
  .terminal-content { padding: 22px 17px; }
  .terminal-value { margin-left: 14px; }
  .terminal-bottom { font-size: .66rem; }
  .section-heading { margin-bottom: 27px; }
  h2 { font-size: clamp(2rem, 8vw, 2.7rem); }
  .about-highlights { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-featured { grid-column: auto; display: flex; }
  .project-featured .project-art { width: 100%; height: 220px; min-height: 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .project-art { height: 210px; }
  .footer-inner { flex-direction: column; text-align: center; gap: 14px; }
  .contact-card { border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .reveal-ready .reveal { opacity: 1 !important; transform: none !important; }
}

/* Não permitir que a grade decorativa ultrapasse a janela no celular. */
@media (max-width: 620px) {
  .hero-visual::before { inset: 0; }
}
