/* ============================================================
   Jorge Sáez Gómez — portfolio
   Direction: Evergreen base, Cayenne & Yellow Green.
   cayenne = raw input  ·  yellow green = resolved/structured output.
   Two chromatic accents on a deep evergreen base. Contrast pole is clarity.
   Palette: Evergreen #002626 · Dark Teal #0E4749 · Cayenne #E55812 ·
            Yellow Green #95C623 · Soft Linen #EFE7DA.
   (--amber / --moss keep their names for legacy references.)
   ============================================================ */

:root {
  --bg:        #002626;                 /* Evergreen */
  --bg-elev:   #0e4749;                 /* Dark Teal */
  --bg-elev-2: #155a5c;
  --ink:       #efe7da;                 /* Soft Linen */
  --ink-dim:   #9fb0aa;
  --ink-faint: #6d817b;
  --amber:     #e55812;                 /* Cayenne */
  --amber-soft: rgba(229, 88, 18, 0.14);
  --moss:      #95c623;                 /* Yellow Green */
  --moss-soft: rgba(149, 198, 35, 0.16);
  --line:      rgba(239, 231, 218, 0.10);
  --line-strong: rgba(239, 231, 218, 0.18);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --maxw: 1080px;
  --pad: clamp(1.25rem, 5vw, 4rem);
}

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

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

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

/* subtle scanline atmosphere, very faint */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.013) 0px,
    rgba(255, 255, 255, 0.013) 1px,
    transparent 1px,
    transparent 3px
  );
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--amber);
  color: #002626;
  padding: 0.6rem 1rem;
  font-family: var(--font-mono);
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

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

/* ---------------- sticky header ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 1.15rem var(--pad);
  border-bottom: 1px solid var(--line);
  background: rgba(0, 38, 38, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mark { display: flex; align-items: center; gap: 0.6rem; }
.mark-face {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line-strong);
  filter: grayscale(15%);
}
.mark-name {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.topbar-right { display: flex; align-items: center; gap: 0.9rem; }
.status {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 0 var(--moss);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(149, 198, 35, 0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(149, 198, 35, 0); }
  100% { box-shadow: 0 0 0 0 rgba(149, 198, 35, 0); }
}
@media (prefers-reduced-motion: reduce) { .status-dot { animation: none; } }
.topbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  color: var(--ink-dim);
  transition: color 0.2s, background 0.2s;
}
.topbar-icon svg { width: 19px; height: 19px; display: block; }
.topbar-icon:hover { color: var(--amber); background: rgba(255, 255, 255, 0.06); }

/* ---------------- shared layout ---------------- */
main { position: relative; z-index: 1; }

.eyebrow, .section-tag, .stack-label, .marker-k {
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.block {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7.5rem) var(--pad) 0;
}
.block--tight { padding-top: clamp(3rem, 6vw, 5rem); }

.block-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-tag {
  font-size: 0.82rem;
  color: var(--amber);
  margin-bottom: 0.9rem;
}
.block-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

/* ---------------- hero ---------------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--pad) clamp(2rem, 5vw, 3.5rem);
}

/* first block of the Fun / Thoughts panels: match the hero's tighter top */
.tab-panel > .block:first-child { padding-top: clamp(1.5rem, 4vw, 3rem); }

/* photo + text sit side-by-side on desktop */
.hero-intro {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.hero-text { display: flex; flex-direction: column; }

.hero-photo {
  flex-shrink: 0;
  width: clamp(170px, 24vw, 260px);
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  margin-top: 0.4rem;
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(15%);
}
@media (max-width: 560px) {
  .hero-intro {
    grid-template-columns: 1fr;
  }
  .hero-photo {
    width: clamp(150px, 50vw, 200px);
    margin-top: 0.75rem;
  }
}
.eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--ink-dim);
  margin-bottom: 1.5rem;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 1.1rem + 4.6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 16ch;
}
.hl-cyan { color: var(--amber); }
.hero-sub {
  margin-top: 1.6rem;
  max-width: 56ch;
  color: var(--ink-dim);
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.18rem);
  line-height: 1.6;
}

/* readouts */
.readout {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-elev);
}
.readout-cell {
  padding: 1.1rem clamp(0.9rem, 2vw, 1.5rem);
  border-right: 1px solid var(--line);
}
.readout-cell:last-child { border-right: none; }
.readout-cell dt {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}
.readout-cell dd {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2.1rem);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.readout-cell .unit {
  font-size: 0.55em;
  color: var(--amber);
  margin-left: 0.1em;
}
@media (max-width: 640px) {
  .readout { grid-template-columns: 1fr 1fr; }
  .readout-cell:nth-child(2) { border-right: none; }
  .readout-cell:nth-child(1),
  .readout-cell:nth-child(2) { border-bottom: 1px solid var(--line); }
}

/* availability line (moved into the eyebrow) */
.hero-avail {
  margin-left: auto;
  font-size: 0.8rem;
}

/* hero cta */
.hero-cta {
  margin-top: clamp(1.4rem, 2.5vw, 1.8rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  padding: 0.85rem 1.5rem;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--amber);
  color: #002626;
  font-weight: 500;
}
.btn-primary:hover { background: #f26a28; }
.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn-lg { padding: 1rem 2rem; font-size: 0.9rem; }

/* ---------------- tabs (centered in header) ---------------- */
/* sits between the name and the social icons as a normal flex item, so
   justify-content: space-between on .topbar keeps it roughly centered
   on wide screens while letting it wrap naturally instead of being
   forced onto its own row once space gets tight */
.tabnav {
  display: flex;
  gap: clamp(0.9rem, 2.5vw, 2rem);
}
.tab-btn {
  position: relative;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 0.25rem 0.1rem;
  cursor: pointer;
  transition: color 0.2s;
}
.tab-btn::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px;
  background: var(--amber);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.is-active { color: var(--amber); }
.tab-btn.is-active::after { transform: scaleX(1); }

.tab-panel[hidden] { display: none; }

/* ---------------- offers ---------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.card {
  background: var(--bg-elev);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: background 0.25s;
}
.card:hover { background: var(--bg-elev-2); }
.card-no {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--amber);
  border: 1px solid var(--amber-soft);
  background: var(--amber-soft);
  width: 1.9rem; height: 1.9rem;
  display: grid; place-items: center;
  border-radius: 4px;
}
.card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.card p { color: var(--ink-dim); font-size: 0.95rem; }
.tag-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.4rem;
}
.tag-row li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.2rem 0.5rem;
}
.offers-note {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--ink-dim);
  line-height: 1.6;
}
@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; }
}

/* ---------------- fun ---------------- */
.fun-item-h {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.fun-lede {
  margin-top: 0.9rem;
  max-width: 62ch;
  color: var(--ink-dim);
  line-height: 1.7;
}

.photo-grid {
  margin-top: clamp(1.5rem, 3vw, 2.2rem);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 2.5vw, 1.75rem);
}
.photo-figure { display: flex; flex-direction: column; gap: 0.7rem; }
.photo-frame {
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
}
/* full colour here — the reef is the point, so no grayscale like .hero-photo */
.photo-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* the seahorse is tiny in frame — crop in a little so it reads at grid size */
.photo-frame img.crop-in {
  transform: scale(1.25);
  transform-origin: 47% 50%;
}
.photo-caption {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
  line-height: 1.5;
}
@media (max-width: 760px) {
  .photo-grid { grid-template-columns: 1fr; }
}

/* ---------------- work ---------------- */
.work-list { display: flex; flex-direction: column; }
.work {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1.6rem, 3vw, 2.4rem) 0;
  border-top: 1px solid var(--line);
}
.work:last-child { border-bottom: 1px solid var(--line); }
.work-meta { display: flex; flex-direction: column; gap: 0.35rem; }
.work-role {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}
.work-org {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--amber);
}
.work-org a {
  border-bottom: 1px solid var(--amber-soft);
  transition: border-color 0.2s;
}
.work-org a:hover { border-bottom-color: currentColor; }
.work-years {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
}
.work-body h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 0.9rem + 0.9vw, 1.5rem);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.work-body p { color: var(--ink-dim); font-size: 0.97rem; }
.work-flow {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.work-flow .in { color: var(--amber); }
.work-flow .out { color: var(--moss); }
.work-flow .arrow { color: var(--ink-faint); }
@media (max-width: 680px) {
  .work { grid-template-columns: 1fr; gap: 1rem; }
}

/* ---------------- markers ---------------- */
.markers { list-style: none; display: flex; flex-direction: column; }
.markers li {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: clamp(1rem, 3vw, 2rem);
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.markers li:last-child { border-bottom: 1px solid var(--line); }
.marker-k {
  font-size: 0.82rem;
  color: var(--amber);
}
.marker-v { color: var(--ink-dim); font-size: 0.97rem; }
.cite {
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.2s, border-color 0.2s;
}
.cite:hover { color: var(--amber); border-bottom-color: currentColor; }
@media (max-width: 600px) {
  .markers li { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* ---------------- press ---------------- */
/* outlet name is the scannable unit here, so it carries the display face */
.press-list { list-style: none; display: flex; flex-direction: column; }
.press-item {
  display: grid;
  grid-template-columns: minmax(0, 16rem) 1fr;
  gap: clamp(1rem, 3vw, 2rem);
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.press-item:last-child { border-bottom: 1px solid var(--line); }
.press-outlet {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.2s, border-color 0.2s;
}
.press-outlet:hover { color: var(--amber); border-bottom-color: currentColor; }
.press-meta {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.press-desc { color: var(--ink-dim); font-size: 0.97rem; }
@media (max-width: 600px) {
  .press-item { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ---------------- stack ---------------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.stack-label {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.stack-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.stack-col li {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
}
.stack-col li::before {
  content: "› ";
  color: var(--amber);
  opacity: 0.5;
}
@media (max-width: 720px) { .stack-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .stack-grid { grid-template-columns: 1fr; } }

/* ---------------- contact ---------------- */
.contact {
  max-width: var(--maxw);
  margin: clamp(5rem, 10vw, 8rem) auto 0;
  padding: clamp(3rem, 6vw, 5rem) var(--pad);
  border-top: 1px solid var(--line-strong);
  text-align: center;
}
.contact .section-tag { color: var(--amber); }
.contact-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 1.1rem + 3vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 1rem 0 1.3rem;
}
.contact-sub {
  max-width: 52ch;
  margin: 0 auto 2rem;
  color: var(--ink-dim);
}
.contact-links {
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-dim);
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  align-items: center;
}
.contact-links a { transition: color 0.2s; }
.contact-links a:hover { color: var(--amber); }

/* ---------------- blog post ---------------- */
.post-back {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.2rem);
}
.post-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.post-body { max-width: 62ch; color: var(--ink-dim); }
.post-body p { margin-top: 1.1rem; }
.post-body p:first-child { margin-top: 0; }
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.1em 0.4em;
}

/* ---------------- footer ---------------- */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem var(--pad) 3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
}
.license-link {
  border-bottom: 1px solid currentColor;
  transition: color 0.2s;
}
.license-link:hover { color: var(--amber); }

/* ---------------- reveal animation ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
