/*
  Ilan Reyes — fullstack developer portfolio (portfolio5)
  Direction from the fresh study studies/2026-10-02-fullstack.md:
  lead Pablo Míguez (dark, character fill, pinned cream/ink card track),
  borrow Alphane Labs (colour-coded isometric line drawing in an inset panel).

  Palette is layer-coded: ink and cream swap roles card by card; the only
  chroma is four stroke colours, each meaning one layer of the stack.
*/

:root {
  --ink: #0a0a0a;
  --ink-2: #131313;
  --ink-3: #1f1f1f;
  --cream: #fefaee;
  --grey: #818180;
  --c08: rgb(254 250 238 / 0.08);
  --c16: rgb(254 250 238 / 0.16);
  --c32: rgb(254 250 238 / 0.32);
  --c64: rgb(254 250 238 / 0.64);

  /* the four layers — never used as decoration, only to mean a layer */
  --ui: #f880c8;
  --api: #ff7d38;
  --data: #8fd356;
  --infra: #3fb6ff;

  --display: "Science Gothic", "Arial Black", sans-serif;
  --body: "Onest", system-ui, sans-serif;
  --pad: 32px;
  --ease: cubic-bezier(0.65, 0.05, 0, 1); /* Pablo's --cubic-default */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

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

html {
  background: var(--ink);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

[tabindex="-1"]:focus {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 50;
  padding: 10px 14px;
  background: var(--cream);
  color: var(--ink);
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

.eyebrow {
  display: flex;
  gap: 14px;
  margin: 0;
  color: var(--grey);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eyebrow span {
  color: var(--cream);
}

/* ---------------- Bar ---------------- */
.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 26px var(--pad);
  background: linear-gradient(var(--ink) 30%, rgb(10 10 10 / 0));
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.wordmark {
  justify-self: start;
  font-family: var(--display);
  font-size: 16px;
  font-stretch: 150%;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 28px;
}

.nav a,
.contact-links a {
  position: relative;
  text-decoration: none;
}

.nav a span {
  margin-right: 4px;
  color: var(--grey);
}

.nav a::after,
.contact-links a::after,
.contact-mail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}

.nav a:hover::after,
.nav a:focus-visible::after,
.nav a[aria-current="true"]::after,
.contact-links a:hover::after,
.contact-mail:hover::after,
.contact-mail:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.clock {
  justify-self: end;
  margin: 0;
}

.clock span {
  color: var(--grey);
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
}

.dither {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.hero-title {
  position: absolute;
  top: 104px;
  left: var(--pad);
  margin: 0;
  font-family: var(--display);
  font-size: clamp(64px, 14.2vw, 214px);
  font-stretch: 150%;
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.hero-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.04em;
}

.hero-line .ch {
  display: inline-block;
}

.hero-meta {
  position: absolute;
  top: 116px;
  right: var(--pad);
  width: min(300px, 24vw);
}

.hero-role {
  margin: 0 0 14px;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.hero-status {
  margin: 0;
  color: var(--grey);
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero-status strong {
  color: var(--cream);
  font-weight: 500;
}

/* a ring of words around a vertical axis: Pablo's curved role marquee */
.cylinder {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4vh;
  height: clamp(70px, 9vw, 130px);
  perspective: 1500px;
  perspective-origin: 50% 50%;
  pointer-events: none;
}

.cylinder {
  /* fade the ring's edges, where words turn side-on */
  -webkit-mask-image: linear-gradient(90deg, transparent 2%, #000 18%, #000 82%, transparent 98%);
  mask-image: linear-gradient(90deg, transparent 2%, #000 18%, #000 82%, transparent 98%);
}

.cylinder-ring {
  position: absolute;
  left: 50%;
  top: 0;
  transform-style: preserve-3d;
}

.cyl-item {
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0.32em;
  font-size: clamp(54px, 8vw, 115px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  white-space: nowrap;
  backface-visibility: hidden;
}

.cyl-dot {
  width: 0.16em;
  height: 0.16em;
  border-radius: 50%;
  flex: none;
}

/* ---------------- Statement ---------------- */
.statement {
  padding: 24vh var(--pad) 22vh;
}

.statement-text,
.contact-title {
  margin: 0;
  font-family: var(--display);
  text-transform: uppercase;
}

.statement-text {
  max-width: 1500px;
  font-size: clamp(30px, 4.8vw, 69px);
  font-weight: 650;
  line-height: 1.16;
  letter-spacing: -0.03em;
}

.word {
  display: inline-block;
  white-space: nowrap;
}

/* ---------------- Stack ---------------- */
.stack {
  padding: 0 38px;
}

.stack-panel {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) 1.15fr;
  gap: 32px;
  height: calc(100vh - 76px);
  min-height: 600px;
  margin-top: 38px;
  padding: 44px 48px;
  border: 1px solid var(--c08);
  border-radius: 24px;
  background: var(--ink-2);
  overflow: hidden;
}

.stack-copy {
  display: flex;
  flex-direction: column;
}

.stack-title {
  margin: 22px 0 0;
  font-family: var(--display);
  font-size: clamp(38px, 4.4vw, 70px);
  font-stretch: 125%;
  font-weight: 750;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.layers {
  display: grid;
  gap: 18px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.layer {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 4px 14px;
  padding-top: 16px;
  border-top: 1px solid var(--c16);
  transition: opacity 0.4s var(--ease);
}

.layer.is-dim {
  opacity: 0.28;
}

.layer-swatch {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border: 1.5px solid var(--layer);
  border-radius: 2px;
}

.layer-name {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.layer-name em {
  margin-left: 8px;
  color: var(--grey);
  font-style: normal;
  font-weight: 400;
}

.layer-desc {
  grid-column: 2;
  margin: 0;
  color: var(--c64);
  font-size: 15px;
  line-height: 1.4;
}

.stack-figure {
  position: relative;
  min-height: 0;
}

.iso {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.iso path {
  fill: none;
  stroke-width: 1.3;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.iso .slab-fill {
  stroke: none;
  fill: var(--ink-2);
}

.iso-label {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stack-hud {
  position: absolute;
  right: 0;
  bottom: 0;
  margin: 0;
  color: var(--grey);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stack-hud-n,
.stack-hud-k {
  color: var(--cream);
}

/* ---------------- Work ---------------- */
.work-pin {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding-top: 112px;
  overflow: hidden;
}

.work-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px 24px;
  padding: 0 var(--pad) 28px;
}

.work-head .eyebrow {
  grid-column: 1 / -1;
}

.work-title,
.log-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(34px, 4vw, 60px);
  font-stretch: 125%;
  font-weight: 750;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.work-count {
  margin: 0;
  color: var(--grey);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.work-count-n {
  color: var(--cream);
}

.track {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0 var(--pad) 32px;
  list-style: none;
  will-change: transform;
}

.card {
  display: flex;
  flex: none;
  flex-direction: column;
  width: clamp(300px, 42vw, 600px);
  padding: 34px 40px 32px;
  background: var(--ink-3);
  color: var(--cream);
}

.card:nth-child(odd) {
  background: var(--cream);
  color: var(--ink);
  --muted: rgb(10 10 10 / 0.62);
  --rule: rgb(10 10 10 / 0.16);
}

.card {
  --muted: var(--c64);
  --rule: var(--c16);
}

.card-top {
  display: flex;
  justify-content: space-between;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.card-year {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.02em;
}

.card-title {
  margin: 34px 0 18px;
  font-size: clamp(36px, 4.4vw, 68px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.card-desc {
  max-width: 34ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.4;
  letter-spacing: -0.03em;
}

.card-stack-fig {
  align-self: flex-end;
  width: min(62%, 300px);
  max-height: 38%;
  margin: auto 0 20px;
  overflow: hidden;
}

.card-stack-fig path {
  fill: none;
  stroke-width: 1.2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.card-stack-fig .mini-fill {
  stroke: none;
  fill: var(--ink-3);
}

.card:nth-child(odd) .card-stack-fig .mini-fill {
  fill: var(--cream);
}

.card-foot {
  display: grid;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.card-layers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-layers li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.card-layers li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--layer);
}

.card-layers li.is-off {
  opacity: 0.3;
}

.card-layers li.is-off::before {
  background: none;
  border: 1px solid currentColor;
}

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.card-stack {
  color: var(--muted);
  font-size: 14px;
}

.card-link {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.card-link span {
  display: inline-block;
  transition: transform 0.35s var(--ease);
}

.card-link:hover span,
.card-link:focus-visible span {
  transform: translateX(4px);
}

/* ---------------- Log ---------------- */
.log {
  padding: 24vh var(--pad) 10vh;
}

.log-title {
  margin: 18px 0 48px;
}

.log-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--c16);
}

/* each row inverts on hover: cream floods up from the rule, ink text */
.log-row {
  position: relative;
  display: grid;
  grid-template-columns: 170px 1.2fr 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 26px 16px;
  border-top: 1px solid var(--c16);
  isolation: isolate;
  transition: color 0.4s var(--ease);
}

.log-row::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--cream);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.45s var(--ease);
}

.log-row:hover,
.log-row:focus-within {
  color: var(--ink);
}

.log-row:hover::before,
.log-row:focus-within::before {
  transform: scaleY(1);
}

.log-when {
  color: var(--grey);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.log-row:hover .log-when,
.log-row:hover .log-stack {
  color: rgb(10 10 10 / 0.62);
}

.log-role {
  margin: 0;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.log-role span {
  color: var(--grey);
}

.log-row:hover .log-role span {
  color: rgb(10 10 10 / 0.5);
}

.log-stack {
  margin: 0;
  color: var(--c64);
  font-size: 15px;
}

/* ---------------- Contact ---------------- */
.contact {
  padding: 22vh var(--pad) 12vh;
}

.contact-title {
  margin: 22px 0 40px;
  font-size: clamp(56px, 11.4vw, 176px);
  font-stretch: 150%;
  font-weight: 800;
  line-height: 0.85;
  letter-spacing: -0.04em;
}

.contact-mail {
  position: relative;
  display: inline-block;
  font-size: clamp(24px, 3.4vw, 48px);
  font-weight: 400;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px var(--pad);
  border-top: 1px solid var(--c16);
  color: var(--grey);
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ---------------- Static layouts: phones, and reduced motion everywhere ---------------- */
@media (max-width: 899px) {
  :root {
    --pad: 20px;
  }

  .nav {
    display: none;
  }

  .bar {
    grid-template-columns: 1fr auto;
    padding: 18px var(--pad);
  }

  .hero-title {
    top: 96px;
    font-size: clamp(44px, 15.5vw, 120px);
  }

  .hero-line {
    white-space: nowrap;
  }

  .dither {
    opacity: 0.7;
  }

  .hero-meta {
    top: auto;
    bottom: calc(4vh + clamp(70px, 9vw, 130px) + 28px);
    left: var(--pad);
    right: var(--pad);
    width: auto;
  }

  .stack {
    padding: 0 12px;
  }

  .stack-panel {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    padding: 28px 22px;
  }

  .stack-figure {
    aspect-ratio: 1 / 1.05;
    order: -1;
  }

  .layers {
    margin-top: 28px;
  }

  .log-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 899px) {
  .work-pin {
    height: auto;
    padding-top: 12vh;
  }
}

html.is-static .work-pin {
  height: auto;
  padding-top: 12vh;
}

@media (max-width: 899px) {
  .track {
    flex-direction: column;
    padding-bottom: 0;
  }

  .card {
    width: 100%;
    min-height: 0;
  }

  .card-title {
    margin-top: 24px;
  }
}

html.is-static .track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  padding-bottom: 0;
}

html.is-static .card {
  width: auto;
  min-height: 460px;
}
