/* ============ tokens ============ */
:root{
  --black:      #0b0b0d;
  --black-soft: #1a1a1d;
  --white:      #ffffff;
  --off-white:  #f4f3ef;
  --orange:     #ff5a1f;
  --orange-deep:#c23e10;
  --blue:       #1e3fe0;
  --blue-deep:  #12297f;

  --sidebar-w: 260px;

  --font-display:'Bricolage Grotesque', system-ui, sans-serif;
  --font-body:'Space Grotesk', system-ui, sans-serif;
}

*{ margin:0; padding:0; box-sizing:border-box; }

html{ scroll-behavior:smooth; }

body{
  background:var(--black);
  color:var(--off-white);
  font-family:var(--font-body);
  overflow-x:hidden;
}

a{ color:inherit; text-decoration:none; }

::selection{ background:var(--orange); color:var(--black); }

:focus-visible{
  outline:3px solid var(--orange);
  outline-offset:4px;
}

/* ============ accessibility: skip link ============ */
.skip-link{
  position:fixed; top:-100%; left:1rem;
  background:var(--orange); color:var(--black);
  padding:.75rem 1.25rem; border-radius:4px;
  font-size:.9rem; z-index:500;
  transition:top .2s ease;
}
.skip-link:focus{ top:1rem; }

/* ============ grain (static, pure CSS, no JS) ============ */
.grain{
  position:fixed; inset:0;
  z-index:150;
  pointer-events:none;
  opacity:.05;
  mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ sidebar ============ */
.sidebar{
  position:fixed;
  top:0; left:0; bottom:0;
  width:var(--sidebar-w);
  background:var(--black);
  border-right:1px solid rgba(244,243,239,.1);
  display:flex; flex-direction:column;
  padding:2rem 1.75rem;
  z-index:100;
}

.sidebar-mark{
  font-family:var(--font-display);
  font-weight:800;
  font-size:1.1rem;
  line-height:1.15;
  letter-spacing:-.01em;
}

.sidebar-nav{
  margin-top:3rem;
  display:flex; flex-direction:column;
  gap:.15rem;
  flex:1;
}

.sidebar-group-label{
  font-size:.72rem;
  letter-spacing:.04em;
  color:rgba(244,243,239,.45);
  margin:1.5rem 0 .5rem;
}
.sidebar-group-label:first-child{ margin-top:0; }

.sidebar-nav a{
  display:flex; align-items:baseline; gap:.6rem;
  font-size:.95rem;
  padding:.45rem 0;
  color:var(--off-white);
  border-left:2px solid transparent;
  padding-left:.75rem;
  margin-left:-.75rem;
  transition:color .2s ease, border-color .2s ease;
}
.sidebar-nav a span{
  font-family:var(--font-body);
  font-size:.75rem;
  color:var(--orange);
  min-width:1.2rem;
}
.sidebar-nav a:hover,
.sidebar-nav a:focus-visible{
  color:var(--orange);
  border-left-color:var(--orange);
}

.social-links,
.footer-socials{
  display:flex;
  align-items:center;
  gap:.75rem;
}
.social-links{ margin-top:1.5rem; }
.social-links a,
.footer-socials a{
  display:grid;
  place-items:center;
  color:var(--off-white);
  transition:color .2s ease, transform .2s ease;
}
.social-links a:hover,
.social-links a:focus-visible,
.footer-socials a:hover,
.footer-socials a:focus-visible{
  color:var(--orange);
  transform:translateY(-2px);
}
.social-links svg,
.footer-socials svg{
  width:1.5rem;
  height:1.5rem;
  fill:none;
  stroke:currentColor;
  stroke-linecap:round;
  stroke-linejoin:round;
  stroke-width:1.7;
}
.social-links svg circle:last-child{ fill:currentColor; stroke:none; }

.sidebar-cta{
  display:inline-block;
  margin-top:1.5rem;
  font-size:.9rem;
  color:var(--black);
  background:var(--orange);
  padding:.75rem 1rem;
  border-radius:4px;
  text-align:center;
  transition:background .2s ease;
}
.sidebar-cta:hover{ background:var(--white); }

/* content offset so it never sits under the fixed sidebar */
main, footer{ margin-left:var(--sidebar-w); }

/* ============ hero ============ */
.hero{
  min-height:100svh;
  display:flex; flex-direction:column; justify-content:center;
  padding:0 clamp(1.5rem, 5vw, 4rem);
  position:relative;
  scroll-margin-top:1rem;
}
.hero-eyebrow{
  font-size:.85rem;
  color:var(--orange);
  margin-bottom:1rem;
}
.hero-title{
  font-family:var(--font-display);
  font-weight:800;
  font-size:clamp(3rem, 9vw, 8rem);
  line-height:.9;
  letter-spacing:-.02em;
}
.hero-sub{
  margin-top:1.75rem;
  max-width:34ch;
  font-size:clamp(1.05rem, 2vw, 1.3rem);
  color:var(--off-white);
  opacity:.75;
}
.hero-blob{
  position:absolute;
  width:min(60vw,520px); height:min(60vw,520px);
  right:clamp(0vw,2vw,6vw); top:12%;
  background:
    radial-gradient(circle at 30% 30%, var(--orange), transparent 60%),
    radial-gradient(circle at 70% 70%, var(--blue), transparent 60%);
  filter:blur(70px);
  opacity:.45;
  border-radius:50%;
  pointer-events:none;
  z-index:-1;
}

/* ============ projects ============ */
.projects{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem;
  padding:clamp(3rem,6vw,5rem) clamp(1.5rem,5vw,4rem);
  max-width:1400px;
  margin:0 auto;
}
.projects-heading{
  grid-column:1 / -1;
  margin:0;
  margin-bottom:clamp(1.5rem,3vw,2.5rem);
  color:var(--off-white);
  font-family:var(--font-display);
  font-size:clamp(1.8rem,4vw,3rem);
  line-height:.95;
  max-width:14ch;
  justify-self:center;
  text-align:center;
}
.project{
  min-width:0;
  display:block;
  padding:1rem;
  border-radius:8px;
  scroll-margin-top:1rem;
  transition:transform .25s ease, box-shadow .25s ease;
}
.project:hover,
.project:focus-within{
  transform:scale(1.015);
  box-shadow:0 1rem 2rem rgba(0,0,0,.22);
}
.project--orange{ background:var(--orange); color:var(--black); }
.project--blue{ background:var(--blue); color:var(--off-white); }
.project--offwhite{ background:var(--off-white); color:var(--black); }
.project--black{ background:var(--black); color:var(--off-white); }

/* subtle acknowledgement when a project is the current anchor target */
.project:target{ box-shadow:inset 6px 0 0 var(--orange); }
.project--orange:target{ box-shadow:inset 6px 0 0 var(--black); }

.project-inner{
  display:block;
}

.project-poster{
  aspect-ratio:16 / 9;
  border-radius:10px;
  position:relative;
  overflow:hidden;
  background:
    radial-gradient(circle at 25% 20%, rgba(255,255,255,.5), transparent 45%),
    radial-gradient(circle at 75% 80%, rgba(0,0,0,.35), transparent 55%),
    linear-gradient(135deg, rgba(0,0,0,.25), rgba(255,255,255,.15));
}
.project-poster img,
.project-poster video{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.project-poster .poster-label{
  position:absolute; bottom:.75rem; left:.75rem;
  font-size:.7rem;
  letter-spacing:.03em;
  color:var(--white);
  opacity:.85;
}

/* progressive enhancement: scroll-linked "develop" reveal, pure CSS, no JS.
   Browsers without support simply show the full-color poster above. */
@supports (animation-timeline: view()) {
  .project-poster{
    filter:grayscale(1) blur(10px) brightness(.55) contrast(.9);
    animation:develop linear forwards;
    animation-timeline:view();
    animation-range:entry 0% cover 45%;
  }
  @keyframes develop{
    to{ filter:grayscale(0) blur(0) brightness(1) contrast(1); }
  }
}

.project-index{ font-size:.72rem; margin-top:1rem; margin-bottom:.35rem; opacity:.7; }
.project-title{
  font-family:var(--font-display);
  font-weight:800;
  font-size:clamp(1.5rem, 3vw, 2.5rem);
  line-height:.95;
  letter-spacing:-.01em;
}
.project-desc{
  margin-top:.7rem;
  max-width:42ch;
  font-size:.88rem;
  line-height:1.45;
}
.project-meta{
  display:flex; flex-wrap:wrap; gap:.5rem 1.5rem;
  margin-top:1rem;
  font-size:.75rem;
}
.project-meta div span{ display:block; opacity:.65; font-size:.65rem; margin-bottom:.15rem; }

@media (max-width:860px){
  .projects{ gap:.75rem; }
  .project{ padding:.75rem; }
}

@media (max-width:560px){
  .projects{ grid-template-columns:1fr; }
}

/* ============ about ============ */
.about{
  min-height:100svh;
  display:flex; align-items:center;
  padding:clamp(5rem,10vh,6rem) clamp(1.5rem, 5vw, 4rem);
  background:var(--off-white);
  color:var(--black);
  scroll-margin-top:1rem;
}
.about-inner{
  max-width:1200px; margin:0 auto;
  display:grid; grid-template-columns:1.3fr .7fr; gap:clamp(2rem,6vw,5rem);
  align-items:start;
}
.about-label{ font-size:1.05rem; color:var(--orange-deep); margin-bottom:1rem; }
.about-quote{
  font-family:var(--font-display);
  font-weight:600;
  font-size:clamp(1.6rem,3.2vw,2.6rem);
  line-height:1.25;
  letter-spacing:-.01em;
}
.about-body{ margin-top:1.75rem; font-size:1.02rem; line-height:1.7; max-width:56ch; opacity:.85; }
.about-shape{
  aspect-ratio:3/4;
  border-radius:10px;
  background:
    radial-gradient(circle at 30% 25%, var(--orange), transparent 55%),
    radial-gradient(circle at 75% 70%, var(--blue), transparent 55%),
    var(--black);
}
@media (max-width:860px){ .about-inner{ grid-template-columns:1fr; } }

/* ============ académico ============ */
.academico{
  padding:clamp(5rem,10vh,6rem) clamp(1.5rem, 5vw, 4rem);
  background:var(--off-white);
  color:var(--black);
  scroll-margin-top:1rem;
}
.academico-inner{ max-width:960px; margin:0 auto; }

.academico-head{
  display:flex; align-items:center; gap:1.5rem;
  margin-bottom:2.5rem;
}
.academico-avatar{
  width:88px; height:88px;
  border-radius:50%;
  overflow:hidden;
  flex:0 0 auto;
  background:linear-gradient(135deg, var(--orange), var(--blue));
}
.academico-avatar img{
  width:100%; height:100%;
  object-fit:cover;
  display:block;
}
.academico-role{
  font-family:var(--font-display);
  font-weight:700;
  font-size:clamp(1.3rem, 2.6vw, 1.8rem);
  letter-spacing:-.01em;
}

.pill-nav{
  display:flex; flex-wrap:wrap; align-items:center; gap:.6rem;
  margin-bottom:1rem;
}
.pill-nav-label{
  font-size:.75rem;
  color:var(--orange-deep);
  margin-right:.4rem;
}
.pill-nav a{
  font-size:.85rem;
  padding:.4rem .9rem;
  border-radius:999px;
  border:1px solid rgba(11,11,13,.2);
  transition:background .2s ease, border-color .2s ease, color .2s ease;
}
.pill-nav a:hover,
.pill-nav a:focus-visible{
  background:var(--black);
  border-color:var(--black);
  color:var(--white);
}
.pill-nav a[aria-current="page"]{
  background:var(--orange);
  border-color:var(--orange);
  color:var(--black);
}

.foja, .uni-data, .tema{ margin-top:2.75rem; }
.foja-title{
  font-family:var(--font-display);
  font-weight:700;
  font-size:clamp(1.2rem, 2.4vw, 1.5rem);
  margin-bottom:1rem;
}
.foja-subtitle{
  font-family:var(--font-display);
  font-weight:600;
  font-size:1rem;
  margin:1.75rem 0 .75rem;
}
.foja p{ font-size:.95rem; line-height:1.6; opacity:.85; }

.plain-list{ list-style:none; font-size:.9rem; line-height:1.8; opacity:.85; }
.plain-list.two-col{
  columns:2; column-gap:2.5rem;
}
@media (max-width:640px){ .plain-list.two-col{ columns:1; } }

.years-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(200px,1fr));
  gap:1.5rem 2rem;
}
.year-block{
  border-top:2px solid var(--orange);
  padding-top:.75rem;
}
.year-num{
  display:block;
  font-family:var(--font-display);
  font-weight:800;
  font-size:1.6rem;
  margin-bottom:.5rem;
  letter-spacing:-.01em;
}
.year-block ul{
  list-style:none;
  font-size:.85rem;
  line-height:1.6;
  opacity:.85;
}
.year-block b{ font-weight:600; opacity:.65; }

.tema-text{
  font-size:1.05rem;
  line-height:1.6;
  max-width:60ch;
  opacity:.85;
}

/* ============ contact ============ */
.contact{
  min-height:65svh;
  display:flex; flex-direction:column; justify-content:center;
  padding:clamp(4rem,10vh,5rem) clamp(1.5rem, 5vw, 4rem) 2rem;
  background:var(--black);
  color:var(--off-white);
  scroll-margin-top:1rem;
}
.contact-label{ font-size:1.05rem; color:var(--blue); margin-bottom:1rem; }
/* blue reads dim on black; lift it for contrast */
.contact-label{ color:#7d93ff; }
.contact-title{
  font-family:var(--font-display);
  font-weight:800;
  font-size:clamp(2.2rem, 7vw, 5.4rem);
  line-height:.95;
  letter-spacing:-.02em;
}
.contact-email{
  display:inline-block;
  margin-top:1.75rem;
  font-size:clamp(1.05rem,1.8vw,1.3rem);
  border-bottom:2px solid var(--orange);
  padding-bottom:.2rem;
  width:fit-content;
  transition:color .2s ease, border-color .2s ease;
}
.contact-email:hover{ color:var(--orange); }

.marquee{
  margin-top:clamp(2.5rem,7vh,4rem);
  overflow:hidden;
  border-top:1px solid rgba(244,243,239,.2);
  border-bottom:1px solid rgba(244,243,239,.2);
  padding:.9rem 0;
}
.marquee-track{
  display:flex; gap:2rem; width:max-content;
  animation:marquee 24s linear infinite;
  font-size:.9rem;
  opacity:.7;
}
.marquee-track span:nth-child(4n+2){ color:var(--orange); opacity:1; }
@keyframes marquee{
  from{ transform:translateX(0); }
  to{ transform:translateX(-50%); }
}

footer{
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:.5rem;
  padding:1.5rem clamp(1.5rem, 5vw, 4rem) 2rem;
  background:var(--black);
  color:var(--off-white);
  font-size:.8rem;
  opacity:.55;
}

.disclaimer{
  padding:0 clamp(1.5rem, 5vw, 4rem) 2rem;
  margin-left:var(--sidebar-w);
  background:var(--black);
  color:var(--off-white);
  font-size:.72rem;
  line-height:1.5;
  opacity:.4;
  max-width:70ch;
}

/* ============ responsive: sidebar becomes a top bar ============ */
@media (max-width:900px){
  .sidebar{
    position:static;
    width:100%;
    flex-direction:row;
    align-items:center;
    padding:1.1rem 1.25rem;
    border-right:none;
    border-bottom:1px solid rgba(244,243,239,.1);
  }
  .sidebar-mark{ font-size:.95rem; line-height:1.1; flex:0 0 auto; margin-right:1.5rem; }
  .sidebar-nav{
    margin-top:0;
    flex-direction:row;
    overflow-x:auto;
    gap:0;
    flex:1;
  }
  .sidebar-group-label{ display:none; }
  .sidebar-nav a{
    flex:0 0 auto;
    border-left:none;
    border-bottom:2px solid transparent;
    margin-left:0;
    padding:.4rem .75rem;
    white-space:nowrap;
  }
  .sidebar-nav a:hover, .sidebar-nav a:focus-visible{ border-left-color:transparent; border-bottom-color:var(--orange); }
  .sidebar-cta{ display:none; }
  main, footer, .disclaimer{ margin-left:0; }

  .hero, .project, .about, .academico, .contact{ scroll-margin-top:4.5rem; }

  .academico-head{ flex-direction:column; align-items:flex-start; gap:1rem; }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  .marquee-track{ animation:none; }
  .project,
  .social-links a,
  .footer-socials a{ transition:none; }
  .project:hover,
  .project:focus-within,
  .social-links a:hover,
  .social-links a:focus-visible,
  .footer-socials a:hover,
  .footer-socials a:focus-visible{ transform:none; }
  @supports (animation-timeline: view()){
    .project-poster{ animation:none; filter:none; }
  }
}