/* ============================================================
   Marc Rodriguez Limpangog — portfolio
   Plain CSS. Dark-first, tactile brutalism, one accent.
   ============================================================ */

:root {
  /* dark base ~L*8 (Material-grade, not near-black) + lightness elevation ramp */
  --bg:        #12171f;
  --bg-2:      #1a212c;          /* cards  (~+4% L) */
  --bg-3:      #232c39;          /* hover / elevated */
  --text:      #e9edf3;          /* off-white, never pure */
  --text-dim:  #aab4c5;
  --text-mut:  #7d8799;          /* AA on cards too */
  --accent:    #5eead4;          /* mint/teal — single accent */
  --accent-ink:#06241f;
  --line:      rgba(255,255,255,.10);
  --line-2:    rgba(255,255,255,.06);

  --font:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: clamp(.78rem, .76rem + .12vw, .85rem);
  --step-0:  clamp(1rem, .96rem + .2vw, 1.08rem);
  --step-1:  clamp(1.2rem, 1.1rem + .5vw, 1.45rem);
  --step-2:  clamp(1.6rem, 1.35rem + 1.1vw, 2.2rem);
  --step-3:  clamp(2rem, 1.5rem + 2.2vw, 3.1rem);
  --step-4:  clamp(2.6rem, 1.8rem + 4vw, 4.6rem);

  --maxw: 1240px;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --r: 4px;             /* tight radii — not 2xl */
}

[data-theme="light"] {
  --bg:        #f7f7f4;
  --bg-2:      #ffffff;
  --bg-3:      #f0f0ec;
  --text:      #14181f;
  --text-dim:  #4a5160;
  --text-mut:  #555d6b;          /* AA on light surfaces */
  --accent:    #0f766e;
  --accent-ink:#ffffff;
  --line:      rgba(0,0,0,.14);
  --line-2:    rgba(0,0,0,.08);
}

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

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

body {
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--accent-ink); }

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

.mono { font-family: var(--mono); font-feature-settings: "ss01"; }

/* grain overlay — green-UX, CSS not heavy images */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* skip link */
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: .7rem 1rem; border-radius: var(--r); font-weight: 600;
  transition: top .2s;
}
.skip-link:focus { top: 1rem; }

/* focus — brutal & visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ===================== LAYOUT ===================== */
.layout {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: grid;
  gap: clamp(2rem, 5vw, 5rem);
}
@media (min-width: 920px) {
  .layout {
    grid-template-columns: minmax(330px, 40%) 1fr;
    /* no align-items:start — the sidebar column must stretch to the full
       row height so its sticky inner has room to stay pinned while scrolling */
  }
}

/* ===================== SIDEBAR ===================== */
.side__inner {
  padding-block: clamp(2.5rem, 6vw, 5rem) 2rem;
  display: flex; flex-direction: column;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}
@media (min-width: 920px) {
  .side__inner {
    position: sticky; top: 0;
    min-height: 100vh; min-height: 100dvh;
    justify-content: space-between;
    padding-bottom: clamp(2rem, 5vh, 4rem);
  }
}

.kicker {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
  display: flex; align-items: center; gap: .55rem;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .dot { animation: ping 2.4s ease-out infinite; }
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70%,100% { box-shadow: 0 0 0 7px transparent; }
}

.name {
  font-size: var(--step-4);
  line-height: .98;
  font-weight: 800;
  letter-spacing: -.03em;
}
.name__last { display: block; color: var(--text-dim); }

.role {
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
}

.tagline { color: var(--text-dim); max-width: 42ch; }
.loc { color: var(--text-mut); font-size: var(--step--1); }

/* nav */
.nav { display: none; }
@media (min-width: 920px) { .nav { display: block; } }
.nav ul { list-style: none; padding: 0; display: grid; gap: .15rem; }
.nav a {
  display: flex; align-items: center; gap: 1rem;
  padding: .5rem 0;
  color: var(--text-mut);
  font-weight: 500;
  transition: color .25s, gap .25s;
}
.nav__num {
  font-size: var(--step--1);
  letter-spacing: .1em;
  width: 2.4rem;
  border-bottom: 1px solid var(--line);
  transition: width .3s, border-color .3s, color .3s;
}
.nav a:hover, .nav a:focus-visible, .nav a.is-active { color: var(--text); }
.nav a:hover .nav__num,
.nav a.is-active .nav__num {
  width: 3.6rem; border-color: var(--accent); color: var(--accent);
}

/* buttons */
.btn {
  --bw: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: .6rem;
  min-height: 44px;
  padding: .7rem 1.2rem;
  font-weight: 600; font-size: var(--step-0);
  border: var(--bw) solid var(--line);
  border-radius: var(--r);
  background: transparent; color: var(--text);
  cursor: pointer;
  transition: transform .2s, background .25s, border-color .25s, color .25s;
  will-change: transform;
}
.btn--primary {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent);
}
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--lg { padding: 1rem 1.6rem; font-size: var(--step-1); }
.btn .mono { font-size: var(--step--1); opacity: .8; }

.side__actions { display: flex; flex-wrap: wrap; gap: .7rem; }

.side__meta {
  display: flex; align-items: center; gap: .5rem;
  padding-top: 1.25rem; border-top: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.iconlink {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  font-family: var(--mono); font-size: var(--step--1);
  color: var(--text-mut);
  border: 1px solid var(--line-2); border-radius: var(--r);
  transition: color .2s, border-color .2s, transform .2s;
}
.iconlink:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.spacer { flex: 1; }

.lang { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.lang button {
  min-height: 44px; padding: 0 .8rem;
  font-family: var(--mono); font-size: var(--step--1); font-weight: 600;
  background: transparent; color: var(--text-mut);
  border: 0; cursor: pointer;
  transition: background .2s, color .2s;
}
.lang button + button { border-left: 1px solid var(--line-2); }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.lang button:hover[aria-pressed="false"] { color: var(--text); }

.theme {
  min-width: 44px; min-height: 44px;
  background: transparent; color: var(--text-mut);
  border: 1px solid var(--line-2); border-radius: var(--r);
  cursor: pointer; font-size: 1.1rem;
  transition: color .2s, border-color .2s, rotate .4s;
}
.theme:hover { color: var(--accent); border-color: var(--accent); rotate: 180deg; }

/* ===================== MAIN ===================== */
.main {
  padding-block: clamp(2rem, 6vw, 6rem);
  display: grid;
  gap: clamp(3.5rem, 9vw, 7rem);
  min-width: 0;
}
.section { scroll-margin-top: 2rem; }

.kicker.mono {
  color: var(--accent);
  margin-bottom: 1rem;
  display: flex; gap: .6rem;
}
.kicker__n { color: var(--text-mut); }

.section__h {
  font-size: var(--step-2);
  font-weight: 700; letter-spacing: -.02em; line-height: 1.12;
  max-width: 20ch;
  margin-bottom: 1.6rem;
}
.section__h--big { font-size: var(--step-3); max-width: 16ch; }

.prose { display: grid; gap: 1rem; color: var(--text-dim); max-width: 62ch; }
.prose strong { color: var(--text); font-weight: 600; }

/* enfoque */
.enfoque {
  list-style: none; padding: 0; margin-top: 1.8rem;
  display: grid; gap: .65rem;
  max-width: 60ch;
}
.enfoque li { display: flex; gap: .7rem; color: var(--text-dim); }
.enfoque__m { color: var(--accent); }

/* ===================== BENTO ===================== */
.bento {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
}
@media (min-width: 620px) { .bento { grid-template-columns: repeat(4, 1fr); } }

.card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.3rem;
  transition: transform .25s, border-color .25s;
}
.card::before {           /* cursor spotlight */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(220px circle at var(--mx,50%) var(--my,50%),
              color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
@media (prefers-reduced-motion: no-preference) {
  .card:hover { transform: translateY(-4px); }
}
.card:hover::before { opacity: 1; }

.card--stat { display: flex; flex-direction: column; gap: .35rem; }
.stat__n {
  font-size: var(--step-3); font-weight: 800; line-height: 1;
  letter-spacing: -.02em; color: var(--accent);
}
.stat__u { font-size: var(--step-0); margin-left: .15rem; color: var(--text-dim); font-weight: 500; }
.stat__c { font-size: var(--step--1); color: var(--text-dim); }

.card--stack { grid-column: 1 / -1; }
.card__label {
  font-size: var(--step--1); text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-mut); margin-bottom: .9rem;
}

/* chips */
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chips li {
  font-family: var(--mono); font-size: var(--step--1);
  padding: .3rem .6rem;
  border: 1px solid var(--line-2); border-radius: var(--r);
  color: var(--text-dim);
  background: color-mix(in srgb, var(--text) 4%, transparent);
}
/* chips are static labels, not interactive — no hover affordance */

/* ===================== TIMELINE ===================== */
.timeline { list-style: none; padding: 0; display: grid; gap: .5rem; }
.job {
  display: grid; gap: .4rem;
  padding: 1.5rem;
  border: 1px solid transparent; border-radius: var(--r);
  transition: background .3s, border-color .3s, opacity .3s;
}
@media (min-width: 720px) {
  .job { grid-template-columns: 9rem 1fr; gap: 1.5rem; }
}
.job:hover { background: var(--bg-2); border-color: var(--line); }
/* dim siblings on hover — "La Playa" effect */
@media (hover: hover) and (min-width: 720px) {
  .timeline:hover .job { opacity: .5; }
  .timeline:hover .job:hover { opacity: 1; }
}
.job__period { font-size: var(--step--1); color: var(--text-mut); padding-top: .2rem; }
.job__title { font-size: var(--step-1); font-weight: 700; letter-spacing: -.01em; }
.job__at { color: var(--accent); font-weight: 600; }
.job__meta { font-size: var(--step--1); color: var(--text-mut); margin-top: .1rem; }
.job__lead { color: var(--text-dim); margin: .7rem 0; max-width: 60ch; }
.job__list { list-style: none; padding: 0; display: grid; gap: .55rem; max-width: 64ch; }
.job__list li { position: relative; padding-left: 1.4rem; color: var(--text-dim); font-size: var(--step-0); }
.job__list li::before {
  content: "▹" / ""; position: absolute; left: 0; top: 0;
  color: var(--accent); font-family: var(--mono);
}

/* ===================== SKILLS ===================== */
.skills {
  display: grid; gap: .75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .skills { grid-template-columns: repeat(2, 1fr); } }
.skillgroup {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.3rem;
}
.skillgroup__h {
  font-size: var(--step--1); text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent); margin-bottom: .9rem; font-weight: 600;
}

/* education */
.edu { margin-top: 2.5rem; }
.edu__h {
  font-size: var(--step--1); text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-mut); margin-bottom: 1rem;
}
.edu__list { list-style: none; padding: 0; display: grid; gap: .1rem; }
.edu__list li {
  display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem;
  padding: .7rem 0; border-bottom: 1px solid var(--line-2);
  color: var(--text-dim);
}
.edu__y { color: var(--accent); font-size: var(--step--1); padding-top: .15rem; }

/* ===================== PROJECTS ===================== */
.projects { display: grid; gap: .75rem; }
@media (min-width: 700px) { .projects { grid-template-columns: repeat(2, 1fr); } }
.card--proj { display: grid; gap: .8rem; align-content: start; }
.proj__t { font-size: var(--step-1); font-weight: 700; }
.proj__d { color: var(--text-dim); font-size: var(--step-0); }

/* ===================== CONTACT ===================== */
.section--contact { padding-block: 2rem; }
.contact__lead { color: var(--text-dim); max-width: 48ch; margin-bottom: 2rem; }
.contact__actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 2.5rem; }
.langs {
  list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 1.2rem;
  color: var(--text-mut); font-size: var(--step--1);
}

/* footer */
.foot {
  border-top: 1px solid var(--line-2);
  padding-top: 2rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem;
  color: var(--text-mut); font-size: var(--step--1);
}

/* visually-hidden (SR-only live region) */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ===================== SCROLL REVEAL ===================== */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 30%;
    }
  }
  @keyframes reveal {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: none; }
  }
}
