/* ============================================================
   ADRIÁN HOJAS — portfolio v4
   Copy of surya-aditya.com structure, with Adrián's content.
   One font (Anton), all caps. Black / white / lime #74DA57.
   ============================================================ */

:root {
  --black: #000;
  --white: #fff;
  --lime: #74da57;
  --grey: #999;
  --ink: #222;
  --font: "Anton", "Arial Narrow", "Helvetica Neue", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font-family: inherit; }

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

:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- page / footer reveal ---------- */
.page {
  position: relative;
  z-index: 1;
  margin-bottom: 100svh; /* footer (fixed, 100svh) reveals underneath */
  background: var(--black);
}

/* ---------- grain ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ---------- loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--black);
  color: var(--lime);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transition: opacity .45s ease, visibility .45s ease;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-text { font-size: 13px; letter-spacing: .18em; margin: 0; }
.loader-strip {
  display: flex;
  gap: .5rem;
  width: max-content;
}
.loader-strip img {
  width: 140px;
  height: 105px;
  object-fit: cover;
}
@media (prefers-reduced-motion: no-preference) {
  .loader-strip.sweep {
    animation: loader-sweep .95s cubic-bezier(.65, 0, .35, 1) both;
  }
  @keyframes loader-sweep {
    from { transform: translateX(-120vw); }
    to { transform: translateX(120vw); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .loader { display: none; }
}

/* ---------- hero ---------- */
.hero {
  background: var(--black);
  color: var(--white);
  /* Generous top padding: the Á accent rises above the caps, and with
     a tight line-height it must never meet the viewport edge. */
  padding: clamp(1.5rem, 2.5vw, 2.5rem) clamp(1rem, 1.5vw, 1.5rem) 0;
}
.hero-name {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: clamp(2.75rem, 1rem + 11vw, 22rem);
  /* Room above the caps for the Á accent. No overflow:hidden here:
     it clipped the accent in the live check even with padding-top,
     and there is no entrance animation on the name that needs it —
     the loader covers the entrance. The accent now has the hero's
     top padding above it as well. */
  padding-top: .3em;
  line-height: .55;
  white-space: nowrap;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.hero-name > span { display: inline-block; }
.hero-name .accent { color: var(--lime); }

/* ---------- info strip ---------- */
.info-strip {
  display: grid;
  grid-template-columns: 1.6fr 1fr auto;
  gap: .5rem 1.5rem;
  align-items: start;
  border-top: 1px solid rgba(255, 255, 255, .35);
  border-bottom: 1px solid rgba(255, 255, 255, .35);
  padding: .6rem 0;
  margin-top: 1rem;
  font-size: 13px;
  letter-spacing: .04em;
  line-height: 1.5;
  text-transform: uppercase;
}
.info-strip a { text-decoration: none; }
.info-strip a:hover,
.info-strip a:focus-visible { color: var(--lime); text-decoration: underline; }
.info-strip .nav { text-align: center; }
.info-strip .copy { text-align: right; }
.info-strip .nav > * + *::before { content: " / "; }
.info-strip button.linklike {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.info-strip button.linklike:hover,
.info-strip button.linklike:focus-visible { color: var(--lime); text-decoration: underline; }

.hero-space { height: clamp(5rem, 16vh, 15rem); }

/* ---------- intro (photo that grows on scroll) ---------- */
.intro { background: var(--black); color: var(--white); }

/* Fallback: plain full-width photo, texts stacked. */
.intro-sticky { position: static; }
.intro-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 3rem 1.5rem;
}
.intro-text {
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  line-height: 1.35;
  letter-spacing: .02em;
  text-transform: uppercase;
  max-width: 34ch;
}
.intro-text--right { justify-self: end; text-align: left; }
.intro-text p { margin: 0 0 .8rem; }
.intro-text p:last-child { margin-bottom: 0; }
.intro-center { text-align: center; }
.intro-mono { font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1; margin-bottom: 1rem; }
.intro-text .more {
  display: inline-block;
  margin-top: .8rem;
  color: var(--lime);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.intro-photo { width: 100%; height: 72vh; margin: 0; overflow: hidden; }
.intro-photo img { width: 100%; height: 100%; object-fit: cover; }
.intro-caption {
  color: var(--lime);
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  line-height: 1.35;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin: 1.5rem;
}

/* Enhanced: scroll-driven growth (motion opt-in, feature-detected). */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
    html { timeline-scope: --intro; }
    .intro { view-timeline: --intro block; height: 220vh; }
    .intro-sticky {
      position: sticky;
      top: 0;
      height: 100vh;
      overflow: hidden;
    }
    .intro-grid {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      gap: 2rem;
      height: 100%;
      padding: 0 2rem;
    }
    .intro-text { position: relative; z-index: 1; }
    .intro-mono {
      animation: intro-fade auto linear both;
      animation-timeline: --intro;
      animation-range: entry 0% cover 35%;
    }
    .intro-photo {
      position: relative;
      z-index: 1;
      width: min(22vw, 260px);
      height: auto;
      aspect-ratio: 3 / 4;
      /* animation-timeline / animation-range AFTER the shorthand. */
      animation: intro-grow auto linear both;
      animation-timeline: --intro;
      animation-range: entry 0% cover 55%;
    }
    @keyframes intro-grow {
      from { scale: .3; }
      to { scale: 9; }
    }
    .intro-text {
      animation: intro-fade auto linear both;
      animation-timeline: --intro;
      animation-range: entry 0% cover 35%;
    }
    @keyframes intro-fade {
      from { opacity: 1; }
      to { opacity: 0; }
    }
    .intro-caption {
      position: absolute;
      left: 2rem;
      bottom: 2rem;
      z-index: 2;
      margin: 0;
      max-width: 30ch;
      opacity: 0;
      animation: intro-caption auto linear both;
      animation-timeline: --intro;
      animation-range: cover 55% cover 100%;
    }
    @keyframes intro-caption {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    /* Mobile: stack the intro (3 squeezed columns collide at 375px). */
    @media (max-width: 700px) {
      .intro-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        align-content: center;
        gap: 1.25rem;
      }
      .intro-text { text-align: center; max-width: 32ch; }
      .intro-text--right { justify-self: center; }
      .intro-photo { width: min(58vw, 220px); }
      .intro-caption { left: 1rem; right: 1rem; bottom: 1.5rem; max-width: none; }
    }
  }
}
@media (max-width: 700px) {
  .intro-grid { padding: 2rem 1rem; }
  .intro-text { font-size: .95rem; }
}

/* ---------- projects list ---------- */
.projects {
  background: var(--white);
  color: var(--black);
  padding: 4rem 0 6rem;
  scroll-margin-top: 0;
}
.projects-head {
  padding: 0 1.5rem;
  margin: 0 0 2rem;
  font-size: 13px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.work-row {
  display: block;
  text-decoration: none;
  color: var(--black);
  padding: 1.25rem 1.5rem 1.1rem;
  border-top: 1px solid var(--black);
}
.work-row:last-of-type { border-bottom: 1px solid var(--black); }
.work-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.work-code {
  color: var(--grey);
  font-size: clamp(3.25rem, 10vw, 9rem);
  line-height: .8;
  letter-spacing: 0;
}
.work-right { display: flex; align-items: baseline; gap: 1rem; }
.work-initials {
  font-size: clamp(3.25rem, 10vw, 9rem);
  line-height: .8;
  letter-spacing: 0;
}
.work-arrow {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: .8;
  opacity: 0;
  transform: translateX(-.4em);
  transition: opacity .2s ease, transform .2s ease;
}
.work-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .9rem;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, .2);
  padding-top: .6rem;
}
.work-strip .sep { opacity: .4; }
@media (hover: hover) and (pointer: fine) {
  .work-row:hover { background: var(--black); color: var(--white); }
  .work-row:hover .work-arrow { opacity: 1; transform: translateX(0); }
}
.work-preview {
  position: fixed;
  left: 0;
  top: 0;
  /* Landscape 4:3: the mockups are 1600x1200 browser windows, so a
     portrait box with cover cropped their sides. Contain shows the
     whole mockup. */
  width: 520px;
  height: 390px;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
  background: var(--black);
  opacity: 0;
  transition: opacity .18s ease;
}
.work-preview.on { opacity: 1; }
.work-preview img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- about block ---------- */
.about-block {
  background: var(--white);
  color: var(--black);
  padding: 5rem 1.5rem;
  display: grid;
  grid-template-columns: 220px 1fr 3rem;
  gap: 2rem;
  align-items: start;
}
.about-block-photo { width: 220px; aspect-ratio: 3 / 4; object-fit: cover; }
.about-block-text { max-width: 46ch; }
.about-block-text p {
  margin: 0 0 1rem;
  font-size: clamp(1.1rem, 1.8vw, 1.6rem);
  line-height: 1.35;
  text-transform: uppercase;
}
.about-block-text .more {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.back-to-top {
  justify-self: end;
  writing-mode: vertical-rl;
  background: none;
  border: 0;
  padding: 0;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  color: inherit;
}
.back-to-top:hover { text-decoration: underline; }
@media (max-width: 700px) {
  .about-block { grid-template-columns: 1fr 3rem; }
  .about-block-photo { grid-column: 1; width: 160px; }
  .about-block-text { grid-column: 1; }
  .back-to-top { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------- footer (fixed, reveals under the page) ---------- */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100svh;
  z-index: 0;
  background: var(--lime);
  color: var(--black);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.footer-top {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1rem 1.5rem;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(0, 0, 0, .25);
}
.footer-top a { text-decoration: underline; }
.footer-top a:hover { text-decoration: none; }
.footer-top button.linklike {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.footer-top button.linklike:hover { text-decoration: none; }
.footer-mono {
  margin: auto 0 0;
  /* Sized by width so "AH" spans nearly the whole footer like
     Surya's "SA"; at 38vw it left a large empty green band. */
  font-size: clamp(10rem, 68vw, 90rem);
  line-height: .78;
  letter-spacing: -.01em;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  transform: translateY(16%);
  user-select: none;
}
@media (max-width: 700px) {
  .footer-top { grid-template-columns: 1fr; gap: .75rem; }
  .footer-mono { font-size: 62vw; }
}

/* ---------- about dialog ---------- */
#aboutDialog {
  border: 0;
  padding: 0;
  margin: 0 0 0 auto;
  width: min(50vw, 960px);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--white);
  color: var(--black);
  overflow-y: auto;
  overscroll-behavior: contain;
}
#aboutDialog::backdrop {
  background: rgba(0, 0, 0, .55);
  overscroll-behavior: contain;
}
@media (prefers-reduced-motion: no-preference) {
  #aboutDialog {
    transform: translateX(102%);
    transition: transform .4s cubic-bezier(.22, 1, .36, 1), display .4s, overlay .4s;
    transition-behavior: allow-discrete;
  }
  #aboutDialog[open] { transform: translateX(0); }
  @starting-style {
    #aboutDialog[open] { transform: translateX(102%); }
  }
}
@media (max-width: 700px) {
  #aboutDialog { width: 100vw; }
}
.about-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, .15);
}
.about-bar .mono { font-size: 2rem; line-height: 1; }
.about-close {
  background: none;
  border: 0;
  padding: .25rem 0;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  color: inherit;
}
.about-close:hover { text-decoration: underline; }
.about-inner { padding: 1.5rem; }
.about-photo-small { width: 160px; aspect-ratio: 3 / 4; object-fit: cover; }
.about-headline {
  margin: 1.5rem 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.15;
  text-transform: uppercase;
}
.about-label {
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 2rem 0 .75rem;
  border-top: 1px solid rgba(0, 0, 0, .2);
  padding-top: .6rem;
}
.about-cols { columns: 2; column-gap: 2rem; }
.about-cols p {
  margin: 0 0 1rem;
  font-size: 14px;
  line-height: 1.6;
  text-transform: uppercase;
  break-inside: avoid;
}
.about-cols a { text-decoration: underline; }
.about-photo-big { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; margin-top: 1rem; }
.about-list { margin: 0; font-size: 14px; line-height: 1.7; text-transform: uppercase; }
.about-list a { text-decoration: underline; }
@media (max-width: 700px) {
  .about-cols { columns: 1; }
}

/* ---------- custom cursor label ---------- */
.cursor-label {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10001;
  pointer-events: none;
  background: var(--black);
  color: var(--white);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .35rem .6rem;
  white-space: nowrap;
  opacity: 0;
  transform: translate(16px, 16px);
}
.cursor-label.on { opacity: 1; }

/* ---------- project pages ---------- */
.work-page {
  display: grid;
  grid-template-columns: 1fr 460px;
  min-height: 100vh;
  background: var(--white);
  color: var(--black);
}
.work-gallery { min-width: 0; }
.work-gallery img { width: 100%; height: auto; }
.work-panel {
  background: var(--black);
  color: var(--white);
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}
.work-panel-initials {
  font-size: clamp(6rem, 13vw, 12rem);
  line-height: .8;
  margin: 1rem 0;
}
.work-panel-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .9rem;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-top: 1px solid rgba(255, 255, 255, .35);
  border-bottom: 1px solid rgba(255, 255, 255, .35);
  padding: .6rem 0;
}
.work-panel-strip a { text-decoration: underline; }
.work-panel-strip a:hover { color: var(--lime); }
.work-panel-strip .sep { opacity: .4; }
.work-panel-label {
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 1.5rem 0 .75rem;
}
.work-panel-info {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  text-transform: uppercase;
}
.work-panel-info a { text-decoration: underline; }
.work-panel-info a:hover { color: var(--lime); }
@media (max-width: 900px) {
  .work-page { grid-template-columns: 1fr; }
  .work-panel {
    position: static;
    height: auto;
    order: -1;
  }
  .work-panel-initials { font-size: clamp(4rem, 18vw, 7rem); }
}

/* ---------- small screens: info strip stacks ---------- */
@media (max-width: 700px) {
  .info-strip { grid-template-columns: 1fr; gap: .35rem; }
  .info-strip .nav,
  .info-strip .copy { text-align: left; }
}
