/* Óscar Sala Esteve — portfolio styles */

/* ---- Tokens ------------------------------------------------------------ */
:root {
  /* paper warm palette */
  --paper:   #f3eee5;
  --paper-2: #ebe3d3;
  --ink:     #14110d;
  --ink-2:   #2a261f;
  --muted:   #6b6253;
  --rule:    rgba(20, 17, 13, 0.14);
  --rule-2:  rgba(20, 17, 13, 0.28);
  --brass:   oklch(68% 0.10 78);
  --brass-2: oklch(54% 0.10 78);

  /* dark variant (set on body) */
  --bg: var(--paper);
  --fg: var(--ink);
  --fg-muted: var(--muted);
  --border: var(--rule);
  --border-strong: var(--rule-2);
  --accent: var(--brass-2);
  --card: #fff8eb;

  --max: 1320px;
  --pad: clamp(20px, 4vw, 56px);

  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display: "Fraunces", "Playfair Display", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

body.theme-dark {
  --bg: #0e0d0b;
  --fg: #f0ebe1;
  --fg-muted: #8b8275;
  --border: rgba(240, 235, 225, 0.14);
  --border-strong: rgba(240, 235, 225, 0.28);
  --accent: oklch(78% 0.10 78);
  --card: #16140f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* ---- Reveal ----------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---- Top bar ---------------------------------------------------------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding: 18px var(--pad);
  transition: background .35s ease, backdrop-filter .35s ease, border-color .35s ease, padding .35s ease;
  border-bottom: 1px solid transparent;
}
.topbar.is-scrolled {
  background: color-mix(in oklch, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-bottom-color: var(--border);
  padding: 12px var(--pad);
}
.topbar__inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 24px;
}
.topbar__brand {
  background: none; border: 0; padding: 0; color: var(--fg);
  display: flex; align-items: center; gap: 12px;
  font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
}
.topbar__brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  overflow: hidden;
}
.topbar__brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.topbar__brand-name { font-style: italic; }
.topbar__nav {
  display: flex; gap: 4px; justify-content: center;
}
.topbar__link {
  background: none; border: 0; padding: 8px 14px; color: var(--fg-muted);
  font-size: 13px; font-weight: 500; letter-spacing: 0.02em;
  position: relative; transition: color .2s;
}
.topbar__link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 1px; background: var(--fg); transform: scaleX(0); transform-origin: left;
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.topbar__link:hover, .topbar__link.is-active { color: var(--fg); }
.topbar__link.is-active::after, .topbar__link:hover::after { transform: scaleX(1); }
.topbar__lang { display: flex; gap: 2px; border: 1px solid var(--border); border-radius: 999px; padding: 2px; }
.lang-pill {
  background: none; border: 0; padding: 5px 10px; font-size: 11px; letter-spacing: 0.06em;
  font-family: var(--mono); color: var(--fg-muted); border-radius: 999px;
  transition: background .2s, color .2s;
}
.lang-pill.is-active { background: var(--fg); color: var(--bg); }

.topbar__menu-btn { display: none; }

@media (max-width: 880px) {
  .topbar__nav { display: none; }
  .topbar__inner { grid-template-columns: 1fr auto auto; }
  .topbar__menu-btn {
    display: flex; flex-direction: column; gap: 4px; background: none; border: 0; padding: 8px;
  }
  .topbar__menu-btn span { width: 22px; height: 1.5px; background: var(--fg); display: block; }
  .topbar__sheet {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--bg);
    border-bottom: 1px solid var(--border); padding: 16px var(--pad) 24px;
    display: flex; flex-direction: column; gap: 4px;
  }
  .topbar__sheet-link {
    background: none; border: 0; text-align: left; padding: 12px 0;
    border-bottom: 1px solid var(--border); font-size: 18px; color: var(--fg);
    font-family: var(--display); font-style: italic;
  }
  .topbar__sheet-lang { display: flex; gap: 6px; padding-top: 16px; }
}

/* ---- Hero ------------------------------------------------------------- */
.hero {
  min-height: 100vh; padding: 120px var(--pad) 80px;
  display: flex; align-items: center; position: relative;
  border-bottom: 1px solid var(--border);
}
.hero__grid {
  max-width: var(--max); margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 80px); align-items: center;
}
.hero__eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-muted); margin-bottom: 28px;
  opacity: 0; transform: translateY(8px); transition: opacity .8s, transform .8s;
}
.hero__eyebrow.is-loaded { opacity: 1; transform: none; }
.hero__line { width: 36px; height: 1px; background: var(--fg-muted); display: block; }

.hero__title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(56px, 11vw, 168px); line-height: 0.9; letter-spacing: -0.035em;
  margin: 0 0 32px; color: var(--fg);
}
.hero__title-line { display: block; opacity: 0; transform: translateY(28px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); }
.hero__title.is-loaded .hero__title-line { opacity: 1; transform: none; }
.hero__title.is-loaded .hero__title-line:nth-child(1) { transition-delay: .15s; }
.hero__title.is-loaded .hero__title-line:nth-child(2) { transition-delay: .3s; }
.hero__title.is-loaded .hero__title-line:nth-child(3) { transition-delay: .45s; }
.hero__title-line--it { font-style: italic; font-weight: 500; color: var(--accent); padding-left: clamp(20px, 4vw, 64px); }

.hero__sub {
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: clamp(18px, 2.4vw, 26px); line-height: 1.4; color: var(--fg);
  margin: 0 0 24px; max-width: 32ch;
  opacity: 0; transform: translateY(10px); transition: opacity 1s .55s, transform 1s .55s;
}
.hero__sub.is-loaded { opacity: 1; transform: none; }

.hero__meta {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-muted);
  opacity: 0; transition: opacity 1s .75s;
}
.hero__meta.is-loaded { opacity: 1; }
.hero__meta-dot { color: var(--accent); }

/* hero photo */
.hero__photo-wrap { position: relative; opacity: 0; transition: opacity 1.2s .3s; }
.hero__photo-wrap.is-loaded { opacity: 1; }
.hero__photo-frame {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--border);
}
.hero__photo {
  width: 100%; height: 100%; object-fit: cover; object-position: center 25%;
  filter: contrast(1.02) saturate(0.92);
  transition: transform 1.2s cubic-bezier(.2,.7,.2,1);
}
.hero__photo-wrap.is-loaded .hero__photo { animation: heroZoom 14s ease-out forwards; }
@keyframes heroZoom { from { transform: scale(1.06); } to { transform: scale(1); } }

.hero__photo-tag {
  position: absolute; left: 16px; bottom: 16px; right: 16px;
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.85); mix-blend-mode: difference;
}

.hero__scroll {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: none; border: 0; color: var(--fg-muted);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
}
.hero__scroll-arrow { animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

@media (max-width: 880px) {
  .hero { padding-top: 96px; }
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .hero__photo-wrap { order: -1; max-width: 380px; margin: 0 auto; }
  .hero__title-line--it { padding-left: 24px; }
  .hero__scroll { display: none; }
}

/* hero alt layout: photo as full-bleed background */
.hero--bleed { padding-top: 0; padding-bottom: 0; min-height: 100vh; }
.hero--bleed .hero__grid { grid-template-columns: 1fr; }
.hero--bleed .hero__photo-wrap { display: none; }
.hero--bleed::before {
  content: ""; position: absolute; inset: 0;
  background: url(assets/oscar-portrait.jpg) center 28% / cover no-repeat;
  filter: grayscale(0.3) contrast(1.05);
  z-index: 0;
}
.hero--bleed::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg) 0%, color-mix(in oklch, var(--bg) 70%, transparent) 50%, transparent 80%);
  z-index: 1;
}
.hero--bleed .hero__grid { position: relative; z-index: 2; }
.hero--bleed .hero__text { max-width: 720px; padding: 140px 0 80px; }
@media (max-width: 880px) {
  .hero--bleed::after { background: linear-gradient(180deg, color-mix(in oklch, var(--bg) 40%, transparent) 0%, var(--bg) 80%); }
}

/* ---- Section base ----------------------------------------------------- */
.section { padding: clamp(80px, 10vw, 140px) var(--pad); border-bottom: 1px solid var(--border); }
.section__inner { max-width: var(--max); margin: 0 auto; }
.section__label {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-muted); margin-bottom: 40px;
}
.section__num {
  font-weight: 500; padding: 4px 8px;
  border: 1px solid var(--border-strong); border-radius: 2px;
}
.section__sub {
  font-family: var(--display); font-style: italic; font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1.35; color: var(--fg); margin: 0 0 64px; max-width: 32ch;
}

/* ---- Bio -------------------------------------------------------------- */
.section__inner--bio {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(40px, 6vw, 100px);
  align-items: start;
}
.section__inner--bio .section__label { grid-column: 1; margin-bottom: 0; }
.bio__pull {
  grid-column: 1; font-family: var(--display); font-weight: 400;
  font-size: clamp(28px, 4vw, 52px); line-height: 1.1; letter-spacing: -0.02em;
  color: var(--fg); margin-top: 32px;
}
.bio__body { grid-column: 2; grid-row: 1 / span 2; }
.bio__para {
  font-size: 17px; line-height: 1.65; color: var(--ink-2); margin: 0 0 22px; max-width: 60ch;
  text-wrap: pretty;
}
body.theme-dark .bio__para { color: #cfc8b9; }
@media (max-width: 880px) {
  .section__inner--bio { grid-template-columns: 1fr; }
  .bio__body { grid-column: 1; grid-row: auto; }
}

/* ---- Media ------------------------------------------------------------ */
.media__grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 3vw, 36px);
}
.video-card { }
.video-card__btn {
  background: none; border: 0; padding: 0; width: 100%; text-align: left; color: var(--fg);
  display: block;
}
.video-card__thumb-wrap {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--ink); border: 1px solid var(--border);
}
.video-card__thumb {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.4s cubic-bezier(.2,.7,.2,1), filter .4s;
  filter: grayscale(0.15) contrast(1.05);
}
.video-card__btn:hover .video-card__thumb { transform: scale(1.04); filter: grayscale(0) contrast(1.05); }
.video-card__overlay {
  position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.45));
  pointer-events: none;
}
.video-card__play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff;
  opacity: 0.92; transition: opacity .3s, transform .5s cubic-bezier(.2,.7,.2,1);
}
.video-card__btn:hover .video-card__play { opacity: 1; transform: scale(1.06); }
.video-card__corner {
  position: absolute; top: 14px; left: 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; color: #fff;
  background: rgba(0,0,0,0.4); padding: 4px 8px; backdrop-filter: blur(8px);
}
.video-card__meta { padding: 18px 0 0; display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.video-card__title { font-family: var(--display); font-style: italic; font-size: 22px; }
.video-card__caption {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-muted);
}
@media (max-width: 720px) {
  .media__grid { grid-template-columns: 1fr; }
  .video-card__meta { flex-direction: column; gap: 4px; }
}

/* lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 5vw;
  animation: fadeIn .35s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox__frame {
  width: 100%; max-width: 1280px; aspect-ratio: 16 / 9; background: #000;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.lightbox__frame iframe { width: 100%; height: 100%; border: 0; }
.lightbox__close {
  position: absolute; top: 24px; right: 28px; background: none; border: 0;
  color: #fff; font-size: 36px; line-height: 1; padding: 8px 14px;
}

/* ---- Awards ----------------------------------------------------------- */
.awards { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border); }
.award {
  display: grid; grid-template-columns: 100px 1fr auto; gap: 24px;
  padding: 28px 0; border-bottom: 1px solid var(--border); align-items: baseline;
  transition: padding .35s, background .35s;
}
.award:hover { padding-left: 16px; padding-right: 16px; background: color-mix(in oklch, var(--accent) 6%, transparent); }
.award__year {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em;
  color: var(--fg-muted); font-weight: 500;
}
.award__main { display: flex; flex-direction: column; gap: 4px; }
.award__placement {
  font-family: var(--display); font-style: italic; font-size: 14px;
  color: var(--accent);
}
.award__title {
  font-family: var(--display); font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 500; line-height: 1.25; color: var(--fg); letter-spacing: -0.01em;
}
.award__where {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-muted);
}
@media (max-width: 720px) {
  .award { grid-template-columns: 60px 1fr; }
  .award__where { grid-column: 2; }
}

/* ---- Education -------------------------------------------------------- */
.edu { border-top: 1px solid var(--border); margin-bottom: 64px; }
.edu__row {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px;
  padding: 24px 0; border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.edu__degree { font-family: var(--display); font-size: 19px; font-weight: 500; color: var(--fg); letter-spacing: -0.005em; }
.edu__where { font-size: 14px; color: var(--fg-muted); }
.edu__with { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--fg-muted); }
@media (max-width: 720px) {
  .edu__row { grid-template-columns: 1fr; gap: 4px; }
}

.masterclasses {
  padding: 32px 0 0; border-top: 1px solid var(--border-strong);
  display: grid; grid-template-columns: 200px 1fr; gap: 32px;
}
.masterclasses__label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-muted);
}
.masterclasses__list {
  font-family: var(--display); font-size: clamp(18px, 2.2vw, 24px); line-height: 1.4;
  font-style: italic; color: var(--fg);
  text-wrap: balance;
}
.masterclasses__sep { color: var(--accent); font-style: normal; padding: 0 4px; }
@media (max-width: 720px) { .masterclasses { grid-template-columns: 1fr; gap: 12px; } }

/* ---- Teaching --------------------------------------------------------- */
.section--teaching { background: var(--card); }
.section__inner--teaching { max-width: 1000px; }
.teaching__title {
  font-family: var(--display); font-weight: 400; font-style: italic;
  font-size: clamp(32px, 5vw, 64px); line-height: 1.1; letter-spacing: -0.025em;
  color: var(--fg); margin: 0 0 32px;
}
.teaching__body {
  font-size: 18px; line-height: 1.65; color: var(--ink-2); max-width: 65ch; margin: 0 0 40px;
  text-wrap: pretty;
}
body.theme-dark .teaching__body { color: #cfc8b9; }
.teaching__creds { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 48px; }
.teaching__cred {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 999px;
  color: var(--fg);
}
.teaching__cred-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cta {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--fg); color: var(--bg); text-decoration: none;
  padding: 18px 28px; border-radius: 999px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  transition: gap .25s, transform .25s;
}
.cta:hover { gap: 22px; }
.cta__arrow { transition: transform .25s; }
.cta:hover .cta__arrow { transform: translateX(4px); }

/* ---- Contact ---------------------------------------------------------- */
.section--contact { background: var(--ink); color: #f0ebe1; padding-bottom: 0; border-bottom: 0; }
.section--contact .section__num { border-color: rgba(240,235,225,0.25); color: rgba(240,235,225,0.7); }
.section--contact .section__name { color: rgba(240,235,225,0.7); }
.section__inner--contact { padding-bottom: 80px; }
.contact__title {
  font-family: var(--display); font-weight: 400; font-style: italic;
  font-size: clamp(36px, 5vw, 64px); line-height: 1.1; letter-spacing: -0.025em;
  color: #f0ebe1; margin: 0 0 64px; max-width: 18ch;
}
.contact__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
  padding: 32px 0; border-top: 1px solid rgba(240,235,225,0.16);
  border-bottom: 1px solid rgba(240,235,225,0.16);
  margin-bottom: 64px;
}
.contact__col-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(240,235,225,0.55); margin-bottom: 16px;
}
.contact__col-value {
  display: block; color: #f0ebe1; text-decoration: none;
  font-family: var(--display); font-size: 18px; line-height: 1.5;
  border-bottom: 1px solid transparent; padding-bottom: 2px; margin-bottom: 8px; width: max-content;
  transition: border-color .25s, color .25s;
}
.contact__col-value:hover { border-bottom-color: var(--accent); color: var(--accent); }
@media (max-width: 720px) { .contact__grid { grid-template-columns: 1fr; gap: 24px; } }

.contact__big-link {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  font-family: var(--display); font-size: clamp(28px, 5vw, 56px); font-weight: 400; font-style: italic;
  color: #f0ebe1; text-decoration: none; letter-spacing: -0.02em; line-height: 1.1;
  padding: 24px 0; border-top: 1px solid rgba(240,235,225,0.16);
  border-bottom: 1px solid rgba(240,235,225,0.16);
  transition: color .25s, padding .35s;
  flex-wrap: wrap;
}
.contact__big-link:hover { color: var(--accent); padding-left: 16px; }
.contact__big-arrow { font-size: 0.7em; transition: transform .35s; }
.contact__big-link:hover .contact__big-arrow { transform: translate(8px, -8px); }

.footer { padding: 40px var(--pad); background: var(--ink); color: rgba(240,235,225,0.55); }
.footer__inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
}
.footer__brand { font-family: var(--display); font-style: italic; font-size: 16px; color: #f0ebe1; margin-bottom: 4px; letter-spacing: 0; }
.footer__sub { font-family: var(--mono); font-size: 11px; }
.footer__col--right { text-align: right; }
.footer__col--right > div { margin-bottom: 4px; }
@media (max-width: 720px) {
  .footer__col--right { text-align: left; }
}
