/* ─────────────────────────────────────────────
   Jorge Ribeiro Alves — CV
   styles.css
   ───────────────────────────────────────────── */

:root {
  --bg:           #f7f7f7;
  --ink:          #171717;
  --soft:         #686868;
  --muted:        #aaa7a1;
  --line:         #d8d5cf;
  --accent:       #007fa3;
  --accent-soft:  #a6d3d9;
  --max:          1180px;
  --pad:          clamp(20px, 4vw, 44px);
  --mono:         'Roboto Mono', ui-monospace, monospace;
  --sans:         'Inter', system-ui, -apple-system, sans-serif;
  --serif:        'Libre Baskerville', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); font-weight: 400; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; cursor: default; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--accent); color: var(--bg); }
img, svg, video { max-width: 100%; height: auto; }

/* ── TOPLINE ────────────────────────────────── */
.topline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 46px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 247, .94);
  backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 0 var(--pad);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #5d5b57;
}
.topline .left { justify-self: start; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.topline .right { justify-self: end; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); vertical-align: 1px; cursor: pointer; border: none; padding: 0; appearance: none; }
.dot:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }


.top-nav { justify-self: center; display: flex; align-items: center; justify-content: center; gap: clamp(16px, 2.8vw, 38px); color: #77736d; min-width: 0; scrollbar-width: none; }
.top-nav::-webkit-scrollbar { display: none; }
.top-nav a { transition: color .2s ease; white-space: nowrap; }
.top-nav a:hover { color: var(--ink); text-decoration: none; }
.top-nav a.active { color: var(--ink); }
.top-nav .external::after { content: ''; font-size: 10px; margin-left: 5px; color: var(--accent); }

.right-wrap { justify-self: end; display: flex; align-items: center; gap: 0; white-space: nowrap; }
.lang-switch { display: inline-flex; gap: 8px; margin-right: 16px; }
.lang-btn { background: none; border: none; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #aaa7a1; cursor: pointer; padding: 0; }
.lang-btn.active, .lang-btn:hover { color: var(--ink); }
#clock { color: #5d5b57; }

/* ── MAIN & WRAP ────────────────────────────── */
main { padding-top: 46px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); width: 100%; }

/* ── HERO ───────────────────────────────────── */
.hero {
  min-height: calc(100vh - 46px);
  display: flex; align-items: flex-end;
  border-bottom: 1px solid var(--line);
  padding: clamp(70px, 8vw, 112px) 0 clamp(42px, 6vw, 76px);
  position: relative; overflow: hidden;
}
.hero-grid { display: block; width: 100%; }
.hero-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(62px, 11vw, 150px);
  font-weight: 400;
  letter-spacing: -.07em;
  line-height: .94;
  max-width: 1050px;
  transform: translateY(18px);
  opacity: 0;
  filter: blur(16px);
  animation: nameReveal 1.5s cubic-bezier(.16, 1, .3, 1) .15s forwards;
}
.hero-name span { display: block; white-space: nowrap; }
.hero-name span:first-child { transform: translateY(-0.04em); }
.hero-name .surname { color: var(--accent); margin-top: .015em; }
.hero-info { opacity: 0; transform: translateY(14px); animation: fadeUp .9s ease 1.1s forwards; }
.hero-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 24px 0 22px; }
.hero-copy { font-size: clamp(19px, 2.2vw, 30px); line-height: 1.45; letter-spacing: -.025em; color: #333; max-width: 760px; }
.hero-copy em { font-family: inherit; font-style: normal; color: inherit; }

@keyframes nameReveal { to { opacity: 1; filter: blur(0); transform: translateY(0); } }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ── AREA STRIP ─────────────────────────────── */
.area-strip { border-bottom: 1px solid var(--line); overflow: hidden; background: var(--bg); }
.area-marquee { display: flex; white-space: nowrap; font-family: var(--mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #252525; padding: 15px 0; animation: marquee 24s linear infinite; }
.area-marquee:hover { animation-play-state: paused; }
.area-marquee span { padding: 0 30px; }
.area-marquee .bullet { color: var(--accent); padding: 0 14px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── SECTIONS ───────────────────────────────── */
.section { border-bottom: 1px solid var(--line); padding: clamp(64px, 10vw, 126px) 0; }
.section-head { display: grid; grid-template-columns: 120px 1fr; gap: 22px; margin-bottom: clamp(34px, 5vw, 66px); align-items: end; }
.section-num { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--accent); }
.section-title { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(45px, 7vw, 86px); line-height: .95; letter-spacing: -.055em; color: var(--accent); }
.section-sub { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #2e2d2a; border-bottom: 1px solid #6e6b65; padding-bottom: 8px; margin-bottom: 28px; }
.text-block { margin-left: 0; max-width: 100%; }
.lead { font-size: clamp(20px, 2.6vw, 34px); line-height: 1.35; letter-spacing: -.035em; color: #242424; }
.lead + .lead { margin-top: 22px; }
.accent { font-family: var(--serif); font-style: italic; color: var(--accent); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 54px; }
.stat { padding: 18px 24px 18px 0; border-right: 1px solid var(--line); min-height: 90px; text-align: center; }
.stat:last-child { border-right: none; }
.stat-value { font-family: var(--serif); font-style: italic; font-size: clamp(36px, 5vw, 62px); line-height: 1; color: var(--accent); }
.stat-label { font-family: var(--mono); font-size: 10px; line-height: 1.45; letter-spacing: .06em; text-transform: uppercase; color: #706d68; margin-top: 8px; max-width: 150px; margin-left: auto; margin-right: auto; }

/* Experience */
.exp-list { border-top: 1px solid #3f3d39; }
.exp-item { border-bottom: 1px solid var(--line); transition: border-color .25s ease; }
.exp-item:hover { border-color: #3f3d39; }
.exp-item details { display: block; }
.exp-item summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 120px minmax(0, 1fr) 24px; gap: 22px; padding: 26px 0; align-items: start; }
.exp-item summary::-webkit-details-marker { display: none; }
.exp-toggle { font-family: var(--mono); font-size: 18px; line-height: 1; color: var(--accent); transition: transform .25s ease; }
.exp-item details[open] .exp-toggle { transform: rotate(45deg); }
.exp-date { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #77736d; }
.exp-date .year { font-family: var(--serif); font-style: italic; font-size: 30px; letter-spacing: -.05em; color: var(--accent); line-height: 1.1; text-transform: none; display: block; margin-bottom: 6px; }
.exp-title { font-family: var(--serif); font-size: clamp(25px, 3.1vw, 40px); line-height: 1.05; letter-spacing: -.05em; font-weight: 400; margin-bottom: 12px; }
.exp-title em { color: var(--accent); font-style: italic; }
.exp-place { font-family: var(--mono); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: #77736d; }
.exp-content { padding: 0 0 30px 142px; overflow: hidden; }
details[open] .exp-content { animation: slideDown .3s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.exp-bullets { display: grid; gap: 10px; max-width: 760px; }
.exp-bullet { font-size: 15px; line-height: 1.65; color: #333; position: relative; padding-left: 28px; }
.exp-bullet::before { content: '—'; position: absolute; left: 0; top: 0; color: var(--accent); }
.exp-note { margin-top: 24px; border-left: 1px solid var(--accent); padding: 4px 0 4px 18px; font-family: var(--serif); font-style: italic; font-size: 14px; color: #6c6862; }
.exp-note a { text-decoration: underline; text-underline-offset: 3px; }

/* Formation & tools */
.simple-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(30px, 5vw, 70px); }
.line-list { border-top: 1px solid var(--line); }
.line-item { display: flex; justify-content: space-between; gap: 24px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: #3d3b37; }
.line-item .meta { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #8b8780; white-space: nowrap; }
.software-line { font-size: clamp(22px, 3vw, 38px); line-height: 1.45; letter-spacing: -.035em; max-width: 930px; color: #2d2d2b; }
.mono-row { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #77736d; margin-top: 28px; display: flex; gap: 18px; flex-wrap: wrap; }
.mono-row a { text-decoration: underline; text-underline-offset: 3px; }

/* Distinctions */
.dist-list { border-top: 1px solid #3f3d39; }
.dist-item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 22px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.dist-year { font-family: var(--serif); font-style: italic; font-size: 26px; color: var(--accent); }
.dist-text { font-size: 15px; color: #333; line-height: 1.6; max-width: 800px; }
.dist-text a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; transition: text-decoration-color .2s; }
.dist-text a:hover { text-decoration-color: var(--accent); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(34px, 8vw, 110px); align-items: start; }
.contact-lead { font-size: clamp(22px, 3.2vw, 44px); line-height: 1.2; letter-spacing: -.05em; max-width: 620px; }
.contact-form { display: grid; gap: 20px; }
.form-row { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.form-label { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #aaa7a1; display: block; margin-bottom: 8px; }
.form-input, .form-textarea { width: 100%; background: transparent; border: none; outline: none; font-family: var(--sans); font-size: 16px; color: var(--ink); padding: 6px 0; }
.form-textarea { min-height: 100px; resize: vertical; }
.send { background: none; border: none; color: var(--ink); font: 500 15px var(--sans); justify-self: start; cursor: pointer; padding: 4px 0; }
.send::after { content: '→'; margin-left: 8px; }
.contact-lines { margin-top: 34px; border-top: 1px solid var(--line); padding-top: 18px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #6d6963; display: grid; gap: 6px; }

/* Footer */
.footer { height: 54px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--pad); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #807c75; }
.legal-footer-links { display: inline-flex; gap: 10px; align-items: center; margin-left: 12px; flex-wrap: wrap; justify-content: center; }
.legal-footer-links button { background: none; border: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; padding: 0; }
.legal-footer-links button:hover { text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }

/* Legal overlay */
.legal-overlay { position: fixed; inset: 0; z-index: 120; background: rgba(247, 247, 247, .98); display: none; overflow: auto; padding: calc(54px + 6vw) var(--pad) 6vw; }
.legal-overlay.open { display: block; }
.legal-panel { max-width: 860px; margin: 0 auto; border-top: 1px solid var(--ink); padding-top: 28px; }
.legal-close { position: fixed; top: 16px; right: var(--pad); background: none; border: none; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); cursor: pointer; }
.legal-panel h2 { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); font-size: clamp(42px, 7vw, 84px); line-height: 1; margin-bottom: 34px; letter-spacing: -.055em; }
.legal-panel h3 { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin: 28px 0 8px; color: #2e2d2a; }
.legal-panel p { font-size: 16px; line-height: 1.75; color: #3b3935; max-width: 720px; margin-bottom: 14px; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s ease; }
.reveal.shown { opacity: 1; transform: translateY(0); }
#app { transition: opacity .2s ease; }
#app.switching { opacity: 0; }

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */

@media screen and (min-width: 1400px) {
  :root { --max: 1360px; --pad: 56px; }
  .hero-name { font-size: clamp(120px, 10.5vw, 176px); max-width: 1180px; }
  .hero-copy { font-size: clamp(28px, 2.2vw, 38px); max-width: 880px; }
  .section { padding: 138px 0; }
  .section-title { font-size: clamp(74px, 6vw, 102px); }
  .lead { max-width: 960px; }
}

@media screen and (max-width: 1200px) {
  :root { --max: 1080px; --pad: clamp(28px, 4vw, 44px); }
  .hero-name { font-size: clamp(76px, 11vw, 128px); }
  .hero-copy { font-size: clamp(22px, 2.5vw, 30px); }
  .section-title { font-size: clamp(48px, 7vw, 78px); }
  .simple-grid { gap: 40px; }
  .top-nav { gap: clamp(14px, 2vw, 28px); }
}

@media screen and (max-width: 992px) {
  :root { --pad: 28px; }
  .topline {
    position: fixed;
    height: auto; min-height: 88px;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    row-gap: 12px;
    padding-top: 12px; padding-bottom: 8px;
    align-items: center;
  }
  .topline .left { grid-column: 1; grid-row: 1; min-width: 0; }
  .right-wrap { grid-column: 2; grid-row: 1; align-self: center; }
  .top-nav {
    position: static !important;
    grid-column: 1 / -1; grid-row: 2;
    width: 100%; justify-content: flex-start;
    overflow-x: auto; white-space: nowrap;
    padding: 0 0 8px !important;
    background: transparent !important;
    border-bottom: 0 !important;
  }
  main { padding-top: 88px !important; }
  .hero { min-height: calc(100vh - 88px); padding-top: 84px; padding-bottom: 56px; }
  .hero-name { font-size: clamp(64px, 13vw, 112px); line-height: .9; }
  .section { padding: 82px 0; }
  .section-head { grid-template-columns: 92px minmax(0, 1fr); gap: 20px; }
  .text-block { margin-left: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .exp-item summary { grid-template-columns: 92px minmax(0, 1fr) 24px; gap: 20px; }
  .exp-content { padding-left: 112px; }
  .dist-item { grid-template-columns: 92px minmax(0, 1fr); gap: 20px; }
  .contact-grid, .simple-grid { grid-template-columns: 1fr; gap: 44px; }
  .software-line { font-size: clamp(26px, 4vw, 38px); }
}

@media screen and (max-width: 768px) {
  :root { --pad: 22px; }
  .topline { font-size: 9px; letter-spacing: .06em; }
  .lang-switch { gap: 7px; margin-right: 10px; }
  .lang-btn { font-size: 9px; }
  .topline .right { display: none; }
  main { padding-top: 92px; }
  .hero { min-height: auto; padding: 80px 0 48px; }
  .hero-kicker { margin: 20px 0 16px; }
  .hero-copy { font-size: clamp(21px, 5vw, 30px); line-height: 1.35; }
  .hero-name { font-size: clamp(58px, 15vw, 100px); }
  .area-marquee { font-size: 11px; padding: 12px 0; }
  .area-marquee span { padding: 0 18px; }
  .section { padding: 70px 0; }
  .section-head { grid-template-columns: 1fr; gap: 12px; margin-bottom: 36px; }
  .section-num { font-size: 18px; }
  .section-title { font-size: clamp(44px, 11vw, 70px); }
  .text-block { margin-left: 0; }
  .lead { font-size: clamp(22px, 5.5vw, 32px); }
  .exp-item summary { grid-template-columns: minmax(0, 1fr) 24px; gap: 16px; padding: 22px 0; }
  .exp-date { grid-column: 1 / -1; order: -1; }
  .exp-date .year { font-size: 26px; margin-bottom: 4px; }
  .exp-title { font-size: clamp(28px, 7vw, 38px); }
  .exp-content { padding-left: 0; padding-bottom: 28px; }
  .exp-bullet { font-size: 14px; line-height: 1.6; }
  .exp-note { font-size: 13px; }
  .dist-item { grid-template-columns: 1fr; gap: 6px; }
  .dist-year { font-size: 24px; }
  .line-item { flex-direction: column; gap: 4px; }
  .line-item .meta { white-space: normal; }
  .contact-grid { gap: 34px; }
  .contact-lead { font-size: clamp(26px, 7vw, 42px); }
}

@media screen and (max-width: 576px) {
  :root { --pad: 16px; }
  .topline { min-height: 92px; grid-template-columns: 1fr auto; }
  .topline .left { gap: 8px; }
  #volText { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media screen and (max-width: 380px) {
  .hero-name { font-size: clamp(46px, 16vw, 64px); }
  .top-nav { gap: 14px; }
  #volText { max-width: 150px; }
  .section-title { font-size: 38px; }
}
