/* ============================================================
   Olaia Irigoyen — temporary portfolio
   Plain CSS · minimal editorial (sidebar layout)
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Colours */
  --bg: #ffffff;            /* clean white */
  --ink: #111110;           /* almost black */
  --ink-soft: #6b6a64;      /* muted text / labels */
  --rule: #e6e4dd;          /* thin divider lines */
  --accent: #2eab60;        /* Framer status green */
  --focus: #111110;

  /* Typography */
  --font-sans: "Switzer", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Fragment Mono preset (matched to Framer) */
  --fs-mono: 13px;
  --ls-mono: -0.52px;
  --lh-mono: 14.3px;
  --fs-body: clamp(0.98rem, 0.94rem + 0.2vw, 1.08rem);
  --fs-title: clamp(1.4rem, 1rem + 1.6vw, 2.1rem);
  --fs-hero: clamp(2.8rem, 1rem + 8vw, 7.5rem);

  /* Layout */
  --sidebar-w: 210px;
  --pad-x: clamp(1.25rem, 0.5rem + 3vw, 4rem);
  --pad-y: clamp(1.5rem, 1rem + 2vw, 2.75rem);
}

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

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;

  /* Very subtle paper noise (inline SVG, no extra request) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.022'/%3E%3C/svg%3E");
}

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

a,
a:link,
a:visited,
a:hover,
a:active {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

dl, dt, dd {
  margin: 0;
  padding: 0;
}

.muted { color: var(--ink-soft); }

.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;
}

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--bg);
  padding: 0.6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

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

/* ---------- Mono label utility (Framer Fragment Mono preset) ---------- */
.eyebrow,
.topbar,
.block-num,
.block-label,
.mini-meta dt,
.footer-note,
.cv-date,
.copy-mail .copy-tip,
.skip-link {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 400;
  letter-spacing: var(--ls-mono);
  line-height: var(--lh-mono);
  text-transform: uppercase;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100dvh;
  width: 100%;
  overflow-x: clip;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  padding: var(--pad-y) 1.25rem;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  line-height: 0;
}
.brand-logo {
  display: block;
  width: 38px;
  height: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
}
.sidebar-nav a {
  color: var(--ink);
  width: fit-content;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.sidebar-nav a:hover { border-color: var(--ink); }

.sidebar-cta { margin-top: auto; display: grid; gap: 0.6rem; justify-items: start; }
.sidebar-cta .muted { line-height: 1.4; font-size: 0.9rem; }
.sidebar-cta .link-arrow { width: fit-content; max-width: 100%; }

.sidebar-social {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.9rem;
}
.sidebar-social a { color: var(--ink-soft); border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.sidebar-social a:hover { color: var(--ink); border-color: var(--ink); }

.sidebar-foot { line-height: 1.5; font-size: 0.78rem; }

/* ---------- Content ---------- */
.content {
  padding: var(--pad-y) var(--pad-x) 0;
  min-width: 0;
}

/* Top status bar layout (type comes from shared mono preset) */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: clamp(3rem, 2rem + 6vw, 8rem);
  color: #000;
}
.topbar-loc {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.topbar-sep {
  opacity: 0.85;
  line-height: 1;
}
.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  color: #000;
}

.status-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}
.status-dot::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.28;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(1); opacity: 0.35; }
  70%  { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-bottom: clamp(3rem, 2rem + 6vw, 8rem);
  max-width: 20ch;
  max-width: min(100%, 1100px);
}
.eyebrow {
  color: var(--ink-soft);
  margin-bottom: clamp(1.25rem, 0.8rem + 2vw, 2.5rem);
}
.hero-title {
  font-weight: 600;
  font-size: var(--fs-hero);
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.75rem);
  will-change: transform;
}
.hero-title span { display: block; }
.hero-title span:last-child { color: var(--ink-soft); }

.hero-statement {
  font-size: var(--fs-title);
  line-height: 1.2;
  letter-spacing: -0.01em;
  max-width: 26ch;
  margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  font-weight: 500;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.2rem, 0.8rem + 2vw, 2.5rem);
  align-items: baseline;
}

/* Editorial typographic links (animated underline + arrow) */
.link-arrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  width: fit-content;
  font-size: 1.02rem;
  color: inherit;
  text-decoration: none;
  padding-bottom: 3px;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.35s ease;
}
.link-arrow:hover,
.link-arrow:focus-visible { background-size: 100% 1px; }
.link-arrow .arrow { display: inline-block; transition: transform 0.25s ease; }
.link-arrow:hover .arrow,
.link-arrow:focus-visible .arrow { transform: translate(2px, -2px); }
.hero-links .link-arrow { font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem); }
.link-primary { background-size: 100% 1px; } /* primary starts underlined */

/* Email copy button (looks like a link, no mailto) */
button.link-arrow {
  appearance: none;
  background-color: transparent;
  border: 0;
  padding: 0 0 3px;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.copy-mail .copy-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  transform: translateX(-50%) translateY(4px);
  padding: 0.3rem 0.5rem;
  background: var(--ink);
  color: var(--bg);
  white-space: nowrap;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.copy-mail .copy-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
}
.copy-mail:hover .copy-tip,
.copy-mail:focus-visible .copy-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.copy-mail.is-copied .copy-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Subtle icons — only used on Contact CTAs */
.contact-list .link-ico {
  width: 0.9em;
  height: 0.9em;
  flex: 0 0 auto;
  opacity: 0.7;
  transition: opacity 0.25s ease;
}
.contact-list a:hover .link-ico,
.contact-list a:focus-visible .link-ico { opacity: 1; }

/* ============================================================
   CONTENT BLOCKS  (001 / 002 / 003)
   ============================================================ */
.block {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 3fr);
  grid-template-areas:
    "num label"
    "num body";
  column-gap: var(--pad-x);
  row-gap: 0.75rem;
  align-items: start;
  padding: clamp(2rem, 1.5rem + 3vw, 4rem) 0;
  border-top: 1px solid var(--rule);
}
.block-head {
  display: contents;
}
.block-num {
  grid-area: num;
  color: var(--ink-soft);
}
.block-label {
  grid-area: label;
  text-align: left;
  color: var(--ink-soft);
}
.block-body {
  grid-area: body;
  min-width: 0;
}

.block-title {
  font-weight: 500;
  font-size: var(--fs-title);
  line-height: 1.25;
  letter-spacing: -0.015em;
  max-width: 30ch;
}

.about-grid {
  margin-top: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--pad-x);
}
.about-grid > p { max-width: 40ch; }

.mini-meta { display: grid; gap: 1.25rem; }
.mini-meta dt { color: var(--ink-soft); margin-bottom: 0.35rem; }
.mini-meta dd { max-width: 42ch; }

.inline-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.inline-link:hover {
  color: var(--ink-soft);
  border-color: var(--ink-soft);
}

/* Focus list */
.focus-list {
  display: grid;
  gap: 0;
}
.focus-list li {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  column-gap: 1.25rem;
  align-items: baseline;
  padding: clamp(0.6rem, 0.4rem + 0.6vw, 1rem) 0;
  border-bottom: 1px solid var(--rule);
  font-size: clamp(1.15rem, 0.9rem + 1.2vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.focus-list li:first-child { border-top: 1px solid var(--rule); }
.focus-idx {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 400;
  letter-spacing: var(--ls-mono);
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: right;
  /* Sit on the same optical baseline as the large label */
  transform: translateY(-0.08em);
}

/* CV / Résumé */
.cv-title { margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.cv-list { display: grid; }
.cv-row {
  display: grid;
  /* Fixed date column so the org + role columns start at the same x on every row */
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) clamp(96px, 12vw, 150px);
  align-items: center;
  gap: 1.5rem;
  padding: clamp(0.7rem, 0.5rem + 0.5vw, 1.05rem) 0;
  border-bottom: 1px solid var(--rule);
}
.cv-row:first-child { border-top: 1px solid var(--rule); }

.cv-org {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  min-width: 0;
}
.cv-logo {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: contain;
}
.cv-role { color: var(--ink-soft); min-width: 0; }
.cv-date {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
  color: var(--ink-soft);
}

/* Contact */
.contact-title { margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1rem, 0.5rem + 2.5vw, 3rem) clamp(1.5rem, 0.5rem + 3vw, 3.5rem);
  font-size: clamp(1.1rem, 0.9rem + 0.8vw, 1.5rem);
}
.contact-list .link-arrow { font-size: inherit; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem) 0 var(--pad-y);
  display: grid;
  gap: 0.85rem;
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 1rem 1.5rem;
}
.footer-name,
.footer-meta,
.footer-copy {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
}
.footer-name {
  font-weight: 600;
  justify-self: start;
}
.footer-meta {
  color: var(--ink-soft);
  justify-self: center;
  text-align: center;
}
.footer-copy {
  color: var(--ink-soft);
  justify-self: end;
  text-align: right;
}
.footer-note {
  color: var(--ink-soft);
  margin: 0;
}

/* ============================================================
   ENTRANCE ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--d, 0) * 70ms);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet / small laptop: narrower sidebar */
@media (max-width: 1100px) {
  :root { --sidebar-w: 180px; }
  .block {
    grid-template-columns: minmax(100px, 0.9fr) minmax(0, 3fr);
    gap: 1.25rem;
  }
}

/* Tablet portrait / large phones landscape */
@media (max-width: 820px) {
  :root {
    --pad-x: clamp(1.1rem, 4vw, 1.75rem);
    --pad-y: 1.25rem;
    --fs-hero: clamp(2.6rem, 11vw, 4.5rem);
    --fs-title: clamp(1.25rem, 0.95rem + 1.5vw, 1.7rem);
  }

  .layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  /* Compact sticky mobile header */
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 0.85rem var(--pad-x);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(8px);
  }
  .brand { margin-right: auto; }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.85rem 1.1rem;
    order: 3;
    width: 100%;
    padding-top: 0.55rem;
    border-top: 1px solid var(--rule);
    font-size: 0.9rem;
  }
  .sidebar-nav a {
    padding: 0.2rem 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .sidebar-cta {
    margin-top: 0;
    order: 2;
  }
  .sidebar-cta .muted { display: none; }
  .sidebar-social,
  .sidebar-foot { display: none; }

  .content {
    padding: 1.5rem var(--pad-x) 0;
  }

  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.55rem 1rem;
    padding-bottom: clamp(2rem, 8vw, 3.5rem);
  }
  .topbar-loc {
    flex-wrap: wrap;
    max-width: 100%;
  }
  .topbar-status {
    flex-shrink: 1;
  }

  .hero {
    padding-bottom: clamp(2.5rem, 10vw, 4rem);
  }
  .hero-statement {
    max-width: none;
  }
  .hero-links {
    gap: 1rem 1.5rem;
  }

  .block {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "num label"
      "body body";
    column-gap: 0.75rem;
    row-gap: 0.75rem;
    padding: clamp(1.75rem, 6vw, 2.75rem) 0;
  }
  .block-title {
    max-width: none;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* CV rows: company + date on one line, role beneath */
  .cv-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 0.35rem 0.85rem;
  }
  .cv-org {
    min-width: 0;
  }
  .cv-org img,
  .cv-logo {
    flex-shrink: 0;
  }
  .cv-role {
    grid-column: 1 / -1;
    word-break: break-word;
  }
  .cv-date {
    white-space: nowrap;
  }

  .contact-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }
  .contact-list .link-arrow,
  .hero-links .link-arrow,
  .sidebar-cta .link-arrow {
    min-height: 44px;
  }

  .focus-list li {
    font-size: clamp(1.1rem, 4.5vw, 1.5rem);
    gap: 0.9rem;
  }

  .site-footer {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Small phones */
@media (max-width: 520px) {
  :root {
    --fs-mono: 12px;
    --lh-mono: 13.2px;
    --fs-hero: clamp(2.35rem, 12.5vw, 3.4rem);
  }

  .sidebar-nav {
    gap: 0.65rem 0.95rem;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .hero-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .cv-org {
    font-size: 0.95rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .footer-name,
  .footer-meta,
  .footer-copy {
    justify-self: start;
    text-align: left;
  }
}

/* Very small screens: prevent any horizontal scroll */
@media (max-width: 360px) {
  :root {
    --pad-x: 1rem;
    --fs-hero: 2.15rem;
  }
  .brand-logo { width: 34px; }
  .topbar-status { white-space: normal; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
