/* ==========================================================================
   Kevin Bolaños — Portfolio
   Theme tokens: switch --accent to try a colored version (e.g. #e01e37).
   ========================================================================== */
:root {
  --bg: #0a0a0a;
  --bg-2: #121212;
  --fg: #f5f5f4;
  --muted: #8f8f8f;
  --faint: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #e7e7e7;

  --serif: "Baskervville", "Libre Baskerville", "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }

/* Subtle film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, figure { margin: 0; }
em { font-style: italic; }

::selection { background: var(--fg); color: var(--bg); }

.container {
  width: min(1280px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.btn:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn--light { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn--light:hover { background: transparent; color: var(--fg); }

/* ==========================================================================
   Intro curtain
   ========================================================================== */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #000;
  transition: transform 1.1s var(--ease-in-out);
}
.intro__name {
  display: block;
  overflow: hidden;
  font-family: var(--serif);
  font-size: clamp(44px, 9vw, 140px);
  line-height: 1.05;
  padding-bottom: 0.08em;
}
.intro__name > span {
  display: block;
  transform: translateY(105%);
  animation: rise 1s var(--ease) 0.15s forwards;
}
.intro-done .intro { transform: translateY(-100%); }
.intro-skip .intro { display: none; }

@keyframes rise { to { transform: translateY(0); } }

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 22px var(--gutter);
  mix-blend-mode: difference;
  color: #fff;
}
.nav__list { display: flex; gap: clamp(18px, 3vw, 36px); }

.roll {
  position: relative;
  display: inline-block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}
.roll > span,
.roll::after {
  display: block;
  transition: transform 0.5s var(--ease);
}
.roll::after {
  content: attr(data-text);
  position: absolute;
  inset: 100% 0 auto 0;
}
.roll:hover > span,
.roll:hover::after { transform: translateY(-100%); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background: radial-gradient(ellipse 60% 70% at 50% 55%, #1e1e1e 0%, #0a0a0a 70%);
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: -2;
  will-change: transform;
}
.hero__img {
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: cover;
  filter: grayscale(1) contrast(1.18) brightness(0.5);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 24%, #000 76%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0%, #000 24%, #000 76%, transparent 100%);
  transform: scale(1.12);
  transition: transform 2.4s var(--ease);
}
.intro-done .hero__img,
.intro-skip .hero__img { transform: scale(1); }

.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(10, 10, 10, 0.8) 0%, rgba(10, 10, 10, 0.35) 30%, transparent 50%),
    linear-gradient(to top, rgba(10, 10, 10, 0.92) 0%, rgba(10, 10, 10, 0.3) 32%, transparent 55%);
}

/* Name: fitted to the full width by script.js, drawn as particles on a canvas */
.hero__title {
  position: absolute;
  top: clamp(60px, 8.5vh, 92px);
  left: 0;
  right: 0;
  padding: 0 var(--gutter);
  text-align: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 13.5vw; /* fallback before JS sizes it */
  line-height: 1;
  letter-spacing: -0.04em;
  will-change: transform, opacity;
}
.hero__title-inner { position: relative; display: inline-block; }
.hero__title-text { display: block; white-space: nowrap; }
.hero__title-canvas { position: absolute; pointer-events: none; }
.has-canvas .hero__title-text { color: transparent; }

.hero__bottom {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(24px, 5vh, 48px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
}
.hero__subtitle {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 4.2vw, 68px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero__subtitle em { font-style: normal; color: rgba(255, 255, 255, 0.62); }
.hero__tags-sep { margin-top: 6px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.3); justify-self: start; }
.hero__tags {
  display: grid;
  gap: 4px;
  font-size: clamp(14px, 1.15vw, 18px);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
}
.hero__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 22px;
  text-align: right;
}
.hero__tagline { font-size: clamp(14px, 1.1vw, 17px); color: rgba(255, 255, 255, 0.72); line-height: 1.5; }
.hero__scroll {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.hero__scroll-line {
  position: relative;
  width: 56px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  animation: scan 2.4s var(--ease-in-out) infinite;
}
@keyframes scan {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

.reveal-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: calc(0.55s + var(--d, 0s));
}
.intro-done .reveal-up,
.intro-skip .reveal-up { opacity: 1; transform: none; }

/* ==========================================================================
   Scroll reveals
   ========================================================================== */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.fade-in.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   About
   ========================================================================== */
.about { padding: clamp(110px, 18vh, 200px) 0; }
.about__grid {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 2.2fr;
  gap: clamp(40px, 7vw, 120px);
}
.about__side { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }
.about__figure {
  width: min(240px, 100%);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-2);
}
.about__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  filter: grayscale(1) contrast(1.05) brightness(0.9);
  transform: scale(1.35);
  transform-origin: 50% 40%;
  transition: transform 1.2s var(--ease);
}
.about__figure:hover img { transform: scale(1.42); }

.about__text {
  font-size: clamp(28px, 3.6vw, 52px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.about__text + .about__text { margin-top: 0.9em; }
.about__text .w {
  color: rgba(255, 255, 255, 0.16);
  transition: color 0.35s linear;
}
.about__text .w.lit { color: var(--fg); }

.about__sign { display: flex; align-items: center; gap: 14px; margin-top: 56px; }
.about__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 42%;
  filter: grayscale(1);
}
.about__sign-name { font-size: 14px; font-weight: 600; }
.about__sign-role { font-size: 13px; color: var(--muted); }

/* ==========================================================================
   Projects
   ========================================================================== */
.projects__head { padding-bottom: clamp(56px, 10vh, 110px); }
.section-title {
  margin-top: 20px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 5.8vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.section-title em, .contact__title em { color: var(--muted); }

.project {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 96px 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(255, 255, 255, 0.045), transparent 70%),
    var(--bg);
  border-top: 1px solid var(--line);
}
.project[style*="--bg"] { background-color: var(--bg); }

.project__marquee {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-58%);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.project__track {
  display: inline-flex;
  animation: marquee 48s linear infinite;
}
.project__track--rev { animation-direction: reverse; }
.project__track span {
  font-family: var(--serif);
  font-size: clamp(110px, 19vw, 320px);
  line-height: 1;
  padding-right: 0.35em;
  color: rgba(255, 255, 255, 0.075);
}
@keyframes marquee { to { transform: translateX(-50%); } }

.project__inner {
  position: relative;
  z-index: 1;
  width: min(580px, 100% - 2 * var(--gutter));
}

.project__card {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0c0c0c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
  clip-path: inset(10% 10% 10% 10%);
  transition: clip-path 1.4s var(--ease);
}
.project.is-in .project__card { clip-path: inset(0 0 0 0); }

.project__card > * {
  transform: scale(1.08);
  transition: transform 1.6s var(--ease);
}
.project.is-in .project__card > * { transform: scale(1); }

.viz { width: 100%; height: 100%; display: block; }
.viz-dash { stroke-dasharray: 4 5; animation: dash 1.8s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -18; } }
.viz-line {
  stroke: var(--accent);
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  transition: stroke-dashoffset 2.2s var(--ease) 0.4s;
}
.project.is-in .viz-line { stroke-dashoffset: 0; }

/* Terminal visual */
.term { height: 100%; display: flex; flex-direction: column; background: #0b0b0b; }
.term__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}
.term__bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.term__bar span { margin-left: 10px; }
.term__body {
  flex: 1;
  margin: 0;
  padding: clamp(14px, 3vw, 24px);
  overflow: hidden;
  font-family: var(--mono);
  font-size: clamp(9px, 2.3vw, 12.5px);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.85);
}
.t-dim { color: rgba(255, 255, 255, 0.38); }
.t-ok { color: #fff; }
.t-hi { color: var(--accent); font-weight: 500; }
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  vertical-align: -0.15em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.project__meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-top: 22px;
}
.project__title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.project__desc { margin-top: 6px; max-width: 40ch; font-size: 14px; color: rgba(255, 255, 255, 0.62); }
.project__stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.project__stack li {
  padding: 4px 9px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}
.project__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1px solid var(--faint);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}
.project__status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: status-pulse 2s ease-in-out infinite;
}
@keyframes status-pulse { 50% { opacity: 0.25; } }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  padding: clamp(120px, 22vh, 220px) 0;
  border-top: 1px solid var(--line);
  text-align: center;
}
.contact__title {
  margin: 24px 0 44px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(46px, 7.6vw, 132px);
  line-height: 0.92;
  letter-spacing: -0.015em;
}
.contact__social {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.contact__social a { color: rgba(255, 255, 255, 0.7); transition: color 0.3s; }
.contact__social a:hover { color: #fff; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { border-top: 1px solid var(--line); padding-top: 48px; overflow: hidden; }
.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.footer__links a { color: rgba(255, 255, 255, 0.7); transition: color 0.3s; }
.footer__links a:hover { color: #fff; }
.footer__giant {
  margin-top: 56px;
  font-family: var(--serif);
  font-size: 14.5vw;
  line-height: 0.78;
  text-align: center;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.06);
  transform: translateY(0.12em);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-aspect-ratio: 4/5) {
  /* Tall/portrait viewports: let the photo fill the screen */
  .hero__img {
    width: 100%;
    object-position: 50% 30%;
    -webkit-mask-image: none;
            mask-image: none;
  }
}

@media (max-width: 760px) {
  .nav { padding-top: 18px; }
  .nav__list { gap: 20px; }

  .hero__title { top: 64px; }
  .hero__bottom { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hero__aside { align-items: flex-start; text-align: left; }
  .hero__tagline { display: none; }
  .hero__tags { grid-template-columns: repeat(2, auto); column-gap: 24px; font-size: 14px; }
  .hero__tags-sep { grid-column: 1 / -1; }

  .about__grid { grid-template-columns: 1fr; }
  .about__side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .about__side .eyebrow { width: 100%; }
  .about__figure { width: 120px; }

  .project { min-height: auto; padding: 88px 0; }
  .project__meta { flex-direction: column; gap: 10px; }

}

/* ==========================================================================
   Pointer: a small dot replaces the system cursor on mouse devices
   ========================================================================== */
.pointer-dot {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity 0.3s, width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease);
  will-change: transform;
}
.pointer-dot.is-visible { opacity: 1; }
.pointer-dot.is-hover { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
.pointer-dot.is-down { width: 6px; height: 6px; margin: -3px 0 0 -3px; }
html.has-dot, html.has-dot * { cursor: none !important; }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .project__track { animation: none; }
}
