/* ============================================================
   Luis Rosario — Portfolio
   Minimal & clean · dark theme
   ============================================================ */

/* Self-hosted Inter (variable, latin subset) — no render-blocking third-party fonts */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Self-hosted JetBrains Mono (latin subset) — used for UI chrome: nav, labels, tags, metadata */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* color — warm desaturated palette (design system) */
  --bg:            #14110f;  /* warm charcoal page base */
  --bg-soft:       #1a1511;  /* surface raised */
  --surface:       #221c17;  /* cards, pills, nav */
  --border:        #2e2620;  /* warm dividers, outlines */
  --border-strong: #3a3128;  /* stronger warm border */
  --text:          #e8e2d9;  /* warm off-white */
  --text-muted:    #a89d8d;  /* captions, secondary copy */
  --text-faint:    #8f8475;  /* faint metadata */
  --accent:        #c8a96e;  /* muted amber/olive */
  --accent-soft:   rgba(200, 169, 110, 0.14);

  /* warm semantic trio (building / analyzing / breaking) */
  --warm-build:    #c8a96e;  /* amber */
  --warm-analyze:  #b7a98a;  /* olive-tan */
  --warm-break:    #cc8b52;  /* attention orange */

  /* type */
  --font-sans:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', ui-serif, serif;
  --font-mono:  'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;

  /* layout */
  --maxw:    1120px;
  --gutter:  clamp(1.25rem, 5vw, 4rem);

  /* motion */
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
  --dur:      0.7s;
}

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

* { margin: 0; }

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- background glow ---------- */
.bg-glow {
  position: fixed;
  top: -20vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 90vw);
  height: 700px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

main { position: relative; z-index: 1; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(4rem, 12vh, 9rem) var(--gutter) 0;
  max-width: var(--maxw);
  margin-inline: auto;
}

.hero__inner { width: 100%; }

.hero__tagline {
  color: var(--text);
  font-size: clamp(1rem, 0.9rem + 0.7vw, 1.4rem);
  font-weight: 500;
  max-width: 44ch;
  letter-spacing: 0.01em;
  text-shadow: 0 0 26px rgba(200, 169, 110, 0.14);
}

/* rotating word — fixed-width slot so trailing text never jumps */
.rotator {
  display: inline-block;
  min-width: 8.5ch;
  text-align: center;
}

.rotator__word {
  display: inline-block;
  font-weight: 700;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.rotator__word.is-out {
  opacity: 0;
  transform: translateY(-0.3em);
}

.rotator__word.is-build   { color: var(--warm-build);   text-shadow: 0 0 18px rgba(200, 169, 110, 0.55), 0 0 44px rgba(200, 169, 110, 0.30); }
.rotator__word.is-analyze { color: var(--warm-analyze); text-shadow: 0 0 18px rgba(183, 169, 138, 0.50), 0 0 44px rgba(183, 169, 138, 0.28); }
.rotator__word.is-break   { color: var(--warm-break);   text-shadow: 0 0 18px rgba(204, 139, 82, 0.60), 0 0 44px rgba(204, 139, 82, 0.34); }

/* visually hidden, available to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.hero__name {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 8vw + 1rem, 7.5rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-top: 0.5rem;
  background: linear-gradient(180deg, #e8e2d9 0%, #b7a98a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 4vh, 2.75rem);
}

.social {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.85rem;
  transition: border-color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              transform 0.25s var(--ease);
}

.social:hover {
  border-color: var(--border-strong);
  background: var(--bg-soft);
  transform: translateY(-2px);
}

.social__icon { width: 18px; height: 18px; }

/* scroll cue */
.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: auto;
  margin-bottom: clamp(2rem, 6vh, 3.5rem);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.3s var(--ease);
}

.scroll-cue:hover { color: var(--text-muted); }

.scroll-cue svg {
  width: 18px;
  height: 18px;
  animation: bob 2.2s var(--ease) infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(5px); }
}

/* ============================================================
   ABOUT
   ============================================================ */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.about {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(3rem, 9vh, 6rem) var(--gutter);
}

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.about__text p {
  color: var(--text-muted);
  font-size: clamp(1.02rem, 0.97rem + 0.3vw, 1.18rem);
  margin-bottom: 1.1rem;
  max-width: 60ch;
}

.about__text .about__lead {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 1.05rem + 1.1vw, 2rem);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

.about__text a {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.about__text a:hover { border-color: var(--accent); color: var(--accent); }

.about__aside {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about__avatar {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  margin: 0;
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  transition: transform 0.45s var(--ease);
}

.about__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about__avatar:hover { transform: translateY(-4px); }

/* subtle gradient ring (enhancement; degrades gracefully) */
.about__avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, var(--accent), transparent 55%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.about__tools-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.tags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tags li {
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text);
}

/* subtle qualifier inside a tag, e.g. "Arabic · learning" */
.tag__note {
  color: var(--text-faint);
  font-size: 0.85em;
  letter-spacing: 0.04em;
}
.tag__note::before { content: "· "; }

/* "targeting" certs: dashed outline reads as in-progress, not yet earned */
.tags--targeting li {
  background: transparent;
  border-style: dashed;
  border-color: var(--border-strong);
  color: var(--accent);
}

/* ============================================================
   PROJECTS
   ============================================================ */
.work {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(3rem, 8vh, 6rem) var(--gutter) clamp(4rem, 10vh, 7rem);
}

.projects {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(2.5rem, 6vh, 4.5rem) 0;
  border-top: 1px solid var(--border);
}

.project:last-child { border-bottom: 1px solid var(--border); }

/* media */
.project__media {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 16 / 10;
}

.project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.project:hover .project__media img { transform: scale(1.04); }

/* body */
.project__meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.project__index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent);
}

/* number colored to match the project type */
.index--building  { color: var(--warm-build);   text-shadow: 0 0 14px rgba(200, 169, 110, 0.40); }
.index--analyzing { color: var(--warm-analyze); text-shadow: 0 0 14px rgba(183, 169, 138, 0.38); }
.index--breaking  { color: var(--warm-break);   text-shadow: 0 0 14px rgba(204, 139, 82, 0.42); }

.project__tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  border: 1px solid;
}

.tag--building {
  color: var(--warm-build);
  border-color: rgba(200, 169, 110, 0.4);
  background: rgba(200, 169, 110, 0.10);
  box-shadow: 0 0 18px rgba(200, 169, 110, 0.20);
}

.tag--analyzing {
  color: var(--warm-analyze);
  border-color: rgba(183, 169, 138, 0.4);
  background: rgba(183, 169, 138, 0.10);
  box-shadow: 0 0 18px rgba(183, 169, 138, 0.18);
}

.tag--breaking {
  color: var(--warm-break);
  border-color: rgba(204, 139, 82, 0.4);
  background: rgba(204, 139, 82, 0.10);
  box-shadow: 0 0 18px rgba(204, 139, 82, 0.20);
}

.project__name {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.project__desc {
  color: var(--text-muted);
  margin-top: 0.9rem;
  max-width: 46ch;
}

.project__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.project__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text);
  position: relative;
}

.project__link svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
.project__link:hover svg { transform: translate(3px, -3px); }

/* underline reveal */
.project__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.project__link:hover::after { transform: scaleX(1); }

.project__link--muted { color: var(--text-muted); font-weight: 500; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 2.5rem var(--gutter) 3.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.footer__link { transition: color 0.3s var(--ease); }
.footer__link:hover { color: var(--text); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
/* hidden state applies ONLY when JS is active (html.js), so a no-JS
   visitor sees all content immediately instead of a blank page. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* staggered hero reveals (driven by data-reveal-delay) */
[data-reveal-delay="1"] { transition-delay: 0.08s; }
[data-reveal-delay="2"] { transition-delay: 0.16s; }
[data-reveal-delay="3"] { transition-delay: 0.24s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  .about__grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }
  .project {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .project__media { order: -1; }
}

/* ============================================================
   ACCESSIBILITY — 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;
  }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
}
