/* ==========================================================================
   Itzel Soto: personal career site
   Mobile-first. No frameworks, no web fonts (system fonts load instantly).
   ========================================================================== */

:root {
  /* Palette: light ground, dark ink, one accent (all pairs meet WCAG AA) */
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1a1917;
  --ink-muted: #57534d;
  --line: #e4e0d8;
  --accent: #a63d17;        /* rust: 6.1:1 on --bg */
  --accent-ink: #ffffff;    /* text on accent: 6.4:1 */
  --accent-soft: #f6e9e3;

  /* Type */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Spacing & shape */
  --gutter: 1.25rem;
  --radius: 0.75rem;
  --max: 68rem;
  --header-h: 3.5rem;
}

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1, h2, h3 { margin: 0; line-height: 1.15; }
p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: var(--accent); text-underline-offset: 0.18em; }

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

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px));
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: 0.5rem;
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* Anything still to be filled in. Search the HTML for "CONFIRM" or the
   UPPER_CASE tokens. Remove the class once the real content is in. */
.placeholder {
  background: #fff6d6;
  outline: 1px dashed #b08900;
  outline-offset: 1px;
  color: #5c4700;
  border-radius: 4px;
  padding-inline: 0.25em;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgb(251 250 247 / 0.92);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}

.nav__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav__links { display: flex; }

.nav__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.5rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 0.5rem;
}
.nav__links a:hover { background: var(--accent-soft); color: var(--accent); }

/* Very narrow phones (e.g. iPhone SE): give the four links the full width */
@media (max-width: 23em) {
  .nav__brand { display: none; }
  .nav { justify-content: center; }
}

@media (min-width: 40em) {
  .nav__links { gap: 0.25rem; }
  .nav__links a { padding-inline: 0.65rem; font-size: 0.95rem; }
}

/* Keep section headings clear of the sticky header when jumping via nav */
section[id] { scroll-margin-top: calc(var(--header-h) + 0.5rem); }

/* ---------- Hero ---------- */
.hero { padding-block: 2.5rem 3rem; }

.hero__intro {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 40em) {
  .hero__intro { flex-direction: row; align-items: center; gap: 2rem; }
}

/* Profile photo */
.avatar {
  flex: none;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent);
  background: var(--accent-soft);
}

@media (min-width: 40em) {
  .avatar { width: 9rem; height: 9rem; }
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__name {
  margin-top: 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 12vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.hero__headline {
  margin-top: 0.5rem;
  font-size: clamp(1.25rem, 5vw, 1.625rem);
  font-weight: 600;
  color: var(--ink);
}

.hero__lede {
  margin-top: 1.25rem;
  max-width: 38rem;
  color: var(--ink-muted);
  text-align: justify;
  hyphens: auto;          /* avoids wide gaps between words on narrow screens */
  -webkit-hyphens: auto;
}

/* ---------- Buttons ---------- */
/* Phones: all three buttons on one row, with text that scales down with the
   screen width. On the narrowest phones a label may wrap onto two lines. */
.actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 1.75rem;
}

.actions .btn {
  flex: 1 1 auto;
  min-width: 0;
  padding-inline: 0.5rem;
  font-size: clamp(0.75rem, 3.3vw, 1rem);
  line-height: 1.2;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--ink); color: var(--bg); }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

@media (min-width: 40em) {
  .actions { flex-wrap: wrap; gap: 0.75rem; }
  .actions .btn { flex: 0 0 auto; padding-inline: 1.25rem; }
}

/* ---------- Quick facts ---------- */
.facts {
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.facts dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.facts dd { margin-top: 0.15rem; font-size: 0.975rem; line-height: 1.45; }

@media (min-width: 40em) {
  .facts { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1.25rem 2rem; }
}

/* ---------- Sections ---------- */
.section { padding-block: 3rem; border-top: 1px solid var(--line); }

.section__title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section__num {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ---------- Project cards ---------- */
.cards { display: grid; gap: 1.25rem; }

@media (min-width: 60em) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  transition: box-shadow 0.15s ease;
}
.card:hover { box-shadow: 0 6px 24px rgb(26 25 23 / 0.07); }

.card__tag {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.card__title {
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
}

.card__impact {
  margin-top: 0.875rem;
  padding: 0.6rem 0.8rem;
  background: var(--accent-soft);
  border-radius: 0.5rem;
  color: var(--accent);
  font-weight: 700;
  line-height: 1.35;
}

.card__body { display: grid; gap: 0.9rem; margin-top: 1.25rem; }

.card__body dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.card__body dd { margin-top: 0.15rem; }

.card__more {
  margin-top: auto;
  padding-top: 1.25rem;
}

.card__more summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
}
.card__more summary::-webkit-details-marker { display: none; }
.card__more summary::after { content: "+"; font-size: 1.25rem; line-height: 1; }
.card__more[open] summary::after { content: "−"; }
.card__more summary:hover { text-decoration: underline; text-underline-offset: 0.18em; }

.card__more p { margin-top: 0.75rem; color: var(--ink-muted); font-size: 0.975rem; }

/* ---------- Experience timeline ---------- */
.timeline {
  margin: 0;
  padding: 0 0 0 1.25rem;
  list-style: none;
  border-left: 2px solid var(--line);
}

.timeline__item { position: relative; max-width: 44rem; }
.timeline__item + .timeline__item { margin-top: 2rem; }

/* Dot on the line */
.timeline__item::before {
  content: "";
  position: absolute;
  left: calc(-1.25rem - 6px);
  top: 0.45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
}

.timeline__when {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.timeline__role {
  margin-top: 0.25rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.timeline__org { margin-top: 0.15rem; margin-bottom: 0.5rem; color: var(--accent); font-weight: 600; }

.timeline__points { display: grid; gap: 0.4rem; }
.timeline__points li { position: relative; padding-left: 1rem; }
.timeline__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 0.4rem;
  height: 2px;
  background: var(--ink-muted);
}

/* ---------- Chips (tools & skills) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.35rem; }

.chips li {
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.875rem;
  line-height: 1.5;
}
.chips li.placeholder { border-color: transparent; }

/* ---------- Skills ---------- */
.skills { display: grid; gap: 1.75rem; }

@media (min-width: 40em) {
  .skills { grid-template-columns: repeat(2, 1fr); gap: 2rem 2.5rem; }
}
@media (min-width: 64em) {
  .skills { grid-template-columns: repeat(3, 1fr); }
}

.skills__group h3 {
  font-size: 1rem;
  font-weight: 700;
}

/* ---------- Contact ---------- */
.contact__lede { max-width: 36rem; color: var(--ink-muted); margin-bottom: 1.5rem; }

.contact { display: grid; gap: 0.75rem; }

@media (min-width: 40em) {
  .contact { grid-template-columns: repeat(2, 1fr); }
}

.contact__link {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-height: 48px;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.contact__link:hover { border-color: var(--accent); background: var(--accent-soft); }

.contact__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.contact__value { font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-block: 2rem calc(2rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.875rem;
}

/* ---------- Print: a clean one-pager if someone prints the site ---------- */
@media print {
  .site-header, .skip-link, .actions { display: none; }
  body { background: #fff; font-size: 11pt; }
  .card { break-inside: avoid; border-top-width: 1px; }
  a { color: inherit; }
}
