/* Daniel Raposo — site pessoal
   Conceito: índice editorial em grande escala. Tipografia expandida, grelha de 12 colunas,
   linhas finas, as duas cores da marca como únicos acentos. */
:root {
  --bg: #F5F5F2;
  --bg-2: #EAEAE5;
  --fg: #0E1030;
  --fg-2: #4B4D66;
  --fg-3: #8A8CA0;
  --line: #D3D3DA;
  --blue: #54AADF;   /* marca: Daniel */
  --navy: #30368C;   /* marca: Raposo */
  --mk-a: #54AADF;
  --mk-b: #30368C;
  --invert-bg: #0E1030;
  --invert-fg: #F5F5F2;
  --display: "Archivo", "Arial Black", Helvetica, sans-serif;
  --text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: clamp(16px, 3.2vw, 48px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0C1F; --bg-2: #13152E; --fg: #ECEDF4; --fg-2: #B4B6CA; --fg-3: #7D7F98; --line: #262845;
    --mk-a: #54AADF; --mk-b: #ECEDF4; --invert-bg: #ECEDF4; --invert-fg: #0B0C1F; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0C1F; --bg-2: #13152E; --fg: #ECEDF4; --fg-2: #B4B6CA; --fg-3: #7D7F98; --line: #262845;
  --mk-a: #54AADF; --mk-b: #ECEDF4; --invert-bg: #ECEDF4; --invert-fg: #0B0C1F; color-scheme: dark;
}
.mono-mark { --mk-a: var(--fg); --mk-b: var(--fg); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 17px/1.55 var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
h1, h2, h3, h4, p { margin: 0; }
.wrap { padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--fg); color: var(--bg); padding: 8px 14px; z-index: 99; }
.skip:focus { left: 8px; }
.mk-a { fill: var(--mk-a); } .mk-b { fill: var(--mk-b); }
.label { font: 500 12px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); }

/* Cabeçalho */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 31; background: var(--bg); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; }
.brand { display: block; height: 40px; }
.brand .mark, .brand img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); font: 500 14px var(--text); }
.nav a { position: relative; color: var(--fg-2); transition: color .2s; }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 1px; background: currentColor; transition: right .35s var(--ease); }
.nav a:hover { color: var(--fg); }
.nav a:hover::after { right: 0; }
.nav .lang { font: 500 12px var(--mono); letter-spacing: .06em; color: var(--fg); border: 1px solid var(--fg); border-radius: 99px; padding: 6px 12px; }
.nav .lang::after { display: none; }
.nav .lang:hover { background: var(--fg); color: var(--bg); }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--fg); border-radius: 99px; color: var(--fg); font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 8px 14px; cursor: pointer; }
  .nav { position: fixed; inset: calc(68px + env(safe-area-inset-top, 0px)) 0 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); padding: 12px max(var(--gutter), env(safe-area-inset-right, 0px)) 40px max(var(--gutter), env(safe-area-inset-left, 0px)); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .3s var(--ease); }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav a { font: 700 clamp(30px, 9vw, 44px)/1 var(--display); font-stretch: 112%; letter-spacing: -.02em; color: var(--fg); padding: 16px 0; border-bottom: 1px solid var(--line); text-transform: uppercase; }
  .nav a::after { display: none; }
  .nav .lang { align-self: flex-start; margin-top: 24px; font-size: 13px; padding: 10px 16px; border-bottom: 1px solid var(--fg); }
}

/* Abertura */
.hero { padding-block: clamp(40px, 7vw, 96px) clamp(28px, 4vw, 48px); }
.hero-meta { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; align-items: end; margin-bottom: clamp(24px, 4vw, 56px); }
.hero-meta .label:first-child { grid-column: 1 / span 4; }
.hero-meta .role { grid-column: 5 / span 5; font: 400 clamp(18px, 1.6vw, 22px)/1.35 var(--text); color: var(--fg-2); max-width: 40ch; }
.hero-meta .avail { grid-column: 10 / span 3; justify-self: end; text-align: right; }
.hero-title { font-family: var(--display); font-weight: 800; font-stretch: 125%; text-transform: uppercase; line-height: .84; letter-spacing: -.035em; font-size: clamp(56px, 13.4vw, 236px); }
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line > span { display: block; animation: rise .9s var(--ease) both; }
.hero-title .line:nth-child(2) > span { animation-delay: .08s; }
.hero-title .l1 { color: var(--blue); }
.hero-title .l2 { color: var(--navy); }
:root[data-theme="dark"] .hero-title .l2 { color: var(--fg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-title .l2 { color: var(--fg); } }
.mono-mark .hero-title .l1, .mono-mark .hero-title .l2 { color: var(--fg); }
.hero-foot { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; margin-top: clamp(28px, 4vw, 56px); padding-top: 20px; border-top: 1px solid var(--fg); align-items: start; }
.hero-foot .lede { grid-column: 1 / span 6; font: 400 clamp(22px, 2.3vw, 34px)/1.2 var(--text); letter-spacing: -.01em; max-width: 26ch; text-wrap: balance; }
.hero-foot .portrait { grid-column: 9 / span 4; margin: 0; aspect-ratio: 4 / 5; background: var(--bg-2); overflow: hidden; position: relative; }
.portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.06); transition: filter .6s var(--ease), transform .8s var(--ease); }
.portrait:hover img { filter: grayscale(0); transform: scale(1.03); }
.portrait .mark-r { position: absolute; inset: 18% 18%; width: 64%; height: auto; }
@keyframes rise { from { transform: translateY(102%); } to { transform: none; } }
@media (max-width: 760px) {
  .hero-meta, .hero-foot { grid-template-columns: 1fr; gap: 14px; }
  .hero-meta > *, .hero-foot > * { grid-column: auto !important; justify-self: start !important; text-align: left !important; }
  .hero-foot .portrait { max-width: 260px; }
}

/* Faixa em movimento */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding-block: 16px; background: var(--bg); }
.marquee-track { display: flex; width: max-content; animation: slide 38s linear infinite; }
.marquee span { font: 700 clamp(22px, 2.6vw, 36px)/1 var(--display); font-stretch: 112%; text-transform: uppercase; letter-spacing: -.01em; white-space: nowrap; padding-right: .9em; }
.marquee span:nth-child(odd) { color: var(--fg); }
.marquee span:nth-child(even) { color: transparent; -webkit-text-stroke: 1px var(--fg); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }

/* Números */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-bottom: 1px solid var(--line); }
.facts li { list-style: none; padding: clamp(24px, 3vw, 40px) 20px clamp(24px, 3vw, 40px) 0; display: grid; gap: 10px; align-content: start; }
.facts li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.facts strong { font: 800 clamp(48px, 6vw, 92px)/.9 var(--display); font-stretch: 118%; letter-spacing: -.03em; color: var(--navy); }
:root[data-theme="dark"] .facts strong { color: var(--blue); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .facts strong { color: var(--blue); } }
.facts span { font-size: 15px; color: var(--fg-2); max-width: 28ch; }
.facts { margin: 0; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
@media (max-width: 560px) { .facts li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); } }

/* Secções */
.section { padding-block: clamp(72px, 10vw, 150px); border-bottom: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; align-items: end; margin-bottom: clamp(36px, 5vw, 72px); }
.sec-head h2 { grid-column: 1 / span 8; font: 800 clamp(44px, 8vw, 132px)/.86 var(--display); font-stretch: 125%; text-transform: uppercase; letter-spacing: -.035em; }
.sec-head h2 sup { font: 500 clamp(12px, 1vw, 15px)/1 var(--mono); letter-spacing: .04em; vertical-align: top; margin-left: .4em; color: var(--blue); position: relative; top: .5em; }
.sec-head .intro { grid-column: 9 / span 4; color: var(--fg-2); font-size: 15px; max-width: 36ch; }
.sec-head .intro a { border-bottom: 1px solid currentColor; }
@media (max-width: 760px) { .sec-head { grid-template-columns: 1fr; } .sec-head > * { grid-column: auto !important; } }

/* Sobre */
.about-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.about-text { grid-column: 4 / span 8; }
.about-text p { font-size: 18px; color: var(--fg-2); max-width: 64ch; margin-bottom: 1.1em; }
.about-text p:first-child { font: 400 clamp(24px, 2.6vw, 38px)/1.22 var(--text); letter-spacing: -.012em; color: var(--fg); max-width: 32ch; margin-bottom: 1em; text-wrap: pretty; }
.about-side { grid-column: 1 / span 3; }
.edu { list-style: none; margin: 56px 0 0; padding: 0; grid-column: 4 / span 9; border-top: 1px solid var(--fg); }
.edu li { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.edu li strong { font-weight: 600; }
.edu li span { color: var(--fg-2); }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } .about-grid > * { grid-column: auto !important; } .edu li { grid-template-columns: 1fr; gap: 2px; } }

/* Experiência: separadores + linhas grandes */
.tab-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tab-list button { background: none; border: 1px solid var(--line); border-radius: 99px; padding: 10px 18px; cursor: pointer; font: 500 14px var(--text); color: var(--fg-2); transition: .2s; }
.tab-list button:hover { border-color: var(--fg); color: var(--fg); }
.tab-list button[aria-selected="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.tab-list button .n { font: 500 11px var(--mono); margin-left: 6px; opacity: .7; }
.panel-title { display: none; }
.tabs:not(.js) .tab-list { display: none; }
.tabs:not(.js) .panel-title { display: block; font: 700 22px var(--display); text-transform: uppercase; margin: 40px 0 12px; }
.tabs.js [data-hidden] { display: none; }
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--fg); }
.row { position: relative; display: grid; grid-template-columns: 2fr 6fr 4fr; gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--line); isolation: isolate; transition: color .3s var(--ease); }
.row::before { content: ""; position: absolute; inset: 0 calc(-1 * var(--gutter)); background: var(--navy); transform: scaleY(0); transform-origin: bottom; transition: transform .45s var(--ease); z-index: -1; }
.row:hover::before { transform: scaleY(1); }
.row:hover, .row:hover .row-org, .row:hover .row-text, .row:hover .row-period { color: #F5F5F2; }
.row-period { font: 500 13px/1.6 var(--mono); color: var(--fg-3); padding-top: 6px; font-variant-numeric: tabular-nums; }
.row h4 { font: 700 clamp(22px, 2.4vw, 34px)/1.05 var(--display); font-stretch: 108%; letter-spacing: -.015em; text-wrap: balance; }
.row-org { color: var(--fg-2); font-size: 15px; margin-top: 8px; }
.row-text { color: var(--fg-2); font-size: 15px; padding-top: 6px; }
@media (max-width: 760px) { .row { grid-template-columns: 1fr; gap: 8px; } .row-text { padding-top: 0; } }
@media (hover: none) { .row::before { display: none; } .row:hover, .row:hover .row-org, .row:hover .row-text, .row:hover .row-period { color: inherit; } }

/* Livros: faixa horizontal */
.books-wrap { position: relative; }
.books { list-style: none; margin: 0; padding: 0 max(var(--gutter), env(safe-area-inset-right, 0px)) 24px max(var(--gutter), env(safe-area-inset-left, 0px)); display: grid; grid-auto-flow: column; grid-auto-columns: clamp(240px, 26vw, 380px); gap: clamp(16px, 2vw, 28px); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)); scrollbar-width: thin; cursor: grab; }
.books.drag { cursor: grabbing; scroll-snap-type: none; }
.books li { scroll-snap-align: start; }
.book { display: block; }
.cover { aspect-ratio: 1; max-width: 100%; overflow: hidden; background: #fff; display: grid; place-items: center; position: relative; }
.cover img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: transform .7s var(--ease); }
.book:hover .cover img { transform: scale(1.06) rotate(-1.5deg); }
.gen-book { width: 52%; aspect-ratio: 2 / 3; display: flex; flex-direction: column; justify-content: space-between; padding: 8%; box-shadow: -10px 14px 26px rgba(14,16,48,.22); transition: transform .6s var(--ease); }
.book:hover .gen-book { transform: scale(1.05) rotate(-1.5deg); }
.gen-book.c0 { background: var(--navy); color: #fff; }
.gen-book.c1 { background: var(--blue); color: #0E1030; }
.gen-book.c2 { background: #0E1030; color: #F5F5F2; }
.gen-book.c3 { background: #E7E7E2; color: #0E1030; }
.cg-title { font: 800 clamp(13px, 1.25vw, 17px)/1.02 var(--display); font-stretch: 112%; text-transform: uppercase; letter-spacing: -.02em; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.cg-pub { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.book-meta { padding-top: 14px; display: grid; gap: 4px; }
.book-meta h3 { font: 600 16px/1.3 var(--text); }
.book-pub { font-size: 14px; color: var(--fg-3); }
.books-hint { display: flex; justify-content: space-between; margin-top: 12px; }
.books-nav { display: flex; gap: 8px; }
.books-nav button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--fg); background: none; color: var(--fg); cursor: pointer; font-size: 18px; transition: .2s; }
.books-nav button:hover { background: var(--fg); color: var(--bg); }

/* Publicações */
.pubs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--fg); }
.pubs li { display: grid; grid-template-columns: 2fr 9fr 1fr; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.pub-year { font: 800 28px/1 var(--display); font-stretch: 118%; color: var(--blue); }
.pubs p { font-size: 16px; color: var(--fg-2); max-width: 90ch; }
.pub-link { justify-self: end; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; transition: .2s; }
.pub-link:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
@media (max-width: 760px) { .pubs li { grid-template-columns: 1fr auto; } .pubs p { grid-column: 1 / -1; grid-row: 2; } }

/* Palestras */
.talks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(28px, 3vw, 44px) 20px; }
.talk { grid-column: span 4; min-width: 0; }
.talk.feature { grid-column: span 8; grid-row: span 2; }
.talk-link { display: grid; gap: 16px; }
.talk-img { position: relative; aspect-ratio: 4 / 3; max-width: 100%; overflow: hidden; background: var(--bg-2); }
.talk.feature .talk-img { aspect-ratio: 16 / 11; }
.talk-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter .6s var(--ease), transform .9s var(--ease); }
.talk-link:hover .talk-img img { filter: grayscale(0); transform: scale(1.04); }
.talk-ph { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 8%; background: var(--navy); color: #fff; }
.talk:nth-child(3n+2) .talk-ph { background: var(--blue); color: #0E1030; }
.talk:nth-child(3n) .talk-ph { background: var(--bg-2); color: var(--fg); }
.talk-ph span { font: 800 clamp(20px, 2.2vw, 34px)/.95 var(--display); font-stretch: 118%; text-transform: uppercase; letter-spacing: -.02em; }
.talk.feature .talk-ph span { font-size: clamp(30px, 4vw, 64px); }
.talk-cta { position: absolute; top: 16px; right: 16px; background: var(--bg); color: var(--fg); border-radius: 99px; padding: 8px 14px; font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; transform: translateY(-8px); opacity: 0; transition: .35s var(--ease); }
.talk-link:hover .talk-cta { transform: none; opacity: 1; }
.talk-meta { display: grid; gap: 6px; }
.talk-meta h3 { font: 700 clamp(20px, 1.8vw, 26px)/1.1 var(--display); font-stretch: 108%; letter-spacing: -.015em; text-wrap: balance; }
.talk.feature .talk-meta h3 { font-size: clamp(26px, 2.8vw, 40px); }
.talk-meta p { color: var(--fg-2); font-size: 15px; }
@media (max-width: 900px) { .talk, .talk.feature { grid-column: span 6; grid-row: auto; } .talk.feature { grid-column: 1 / -1; } }
@media (max-width: 560px) { .talk, .talk.feature { grid-column: 1 / -1; } }
@media (hover: none) { .talk-cta { opacity: 1; transform: none; } .talk-img img { filter: none; } }

/* Projetos */
.projects { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.project { background: var(--bg); padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; gap: 14px; min-height: 280px; transition: background .3s var(--ease); }
.project:hover { background: var(--bg-2); }
.project h3 { font: 700 clamp(24px, 2.4vw, 32px)/1.05 var(--display); font-stretch: 108%; letter-spacing: -.015em; }
.project p { color: var(--fg-2); font-size: 15px; }
.more { margin-top: auto; font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; display: inline-flex; gap: 8px; align-items: center; }
.more span { transition: transform .3s var(--ease); }
.more:hover span { transform: translateX(6px); }

/* Contacto */
.contact { background: var(--invert-bg); color: var(--invert-fg); padding-block: clamp(80px, 12vw, 180px) 40px; }
.contact .label { color: color-mix(in srgb, var(--invert-fg) 55%, transparent); }
.contact-lede { font: 400 clamp(22px, 2.4vw, 34px)/1.25 var(--text); max-width: 30ch; margin-top: 20px; }
.contact-big { display: block; margin: clamp(40px, 6vw, 80px) 0; font: 800 clamp(40px, 9.6vw, 170px)/.88 var(--display); font-stretch: 125%; text-transform: uppercase; letter-spacing: -.035em; overflow-wrap: anywhere; }
.contact-big .out { color: transparent; -webkit-text-stroke: 1.5px var(--invert-fg); transition: color .4s var(--ease); }
a.contact-big:hover .out { color: var(--blue); -webkit-text-stroke-color: var(--blue); }
.contact-mail { font: 500 clamp(18px, 2vw, 26px) var(--text); border-bottom: 1px solid currentColor; overflow-wrap: anywhere; }
.contact-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; padding-top: 28px; margin-top: 56px; border-top: 1px solid color-mix(in srgb, var(--invert-fg) 25%, transparent); font-size: 15px; }
.contact-grid address { grid-column: 1 / span 4; font-style: normal; opacity: .8; }
.contact-grid .links { grid-column: 5 / span 5; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.contact-grid .links a { border-bottom: 1px solid transparent; transition: border-color .2s; }
.contact-grid .links a:hover { border-bottom-color: currentColor; }
.contact-grid .copy { grid-column: 10 / span 3; justify-self: end; opacity: .6; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } .contact-grid > * { grid-column: auto !important; justify-self: start !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
@media print { .top, .marquee, .books-hint { display: none; } .books { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; } }

/* Abertura: sequência de capas */
.portrait.shelf { background: #fff; aspect-ratio: 1; }
.portrait.shelf img { position: absolute; inset: 0; filter: none; opacity: 0; transform: scale(1.04); transition: opacity 1s var(--ease), transform 4s linear; }
.portrait.shelf img.on { opacity: 1; transform: none; }
.portrait.shelf:hover img { filter: none; }
