/* =============================================================================
   Marko Padilla — portfolio stylesheet
   
   Single file for all pages (index, about, projects, current, contact).
   Palette: background #FAF8F3, text #1A1A1A, accent blue #1957CC.
   
   Layout note: body + main.container use a column flexbox with min-height
   100dvh; .site-footer has margin-top: auto so the footer sits at the bottom
   of the viewport when content is short. See "Layout" and "Site footer".
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Design tokens — change here to retone the whole site
   ----------------------------------------------------------------------------- */
:root {
  /* Core palette */
  --bg: #faf8f3;
  --text: #1a1a1a;
  --accent: #1957cc;

  /* Derived text + borders (keep contrast on cream background) */
  --text-muted: rgba(26, 26, 26, 0.75);
  --text-dim: rgba(26, 26, 26, 0.55);
  --rule: rgba(26, 26, 26, 0.15);
  --surface: #ffffff;

  /* Font stacks (loaded in each HTML file from Google Fonts) */
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* -----------------------------------------------------------------------------
   Global reset — border-box sizing; strip default margins (we set per block)
   ----------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

/* Smooth anchor scrolling; min-height helps percentage sizing in old engines */
html {
  scroll-behavior: smooth;
  min-height: 100%;
}

/* Base typography + sticky-footer column: body fills at least the viewport */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  font-size: 16px;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Default links inherit body color; accent links use .link-accent */
a {
  color: inherit;
  text-decoration: none;
}

/* Remove bullets globally; .now-block ul etc. opt back in where needed */
ul {
  list-style: none;
}

/* ---------- Layout ----------------------------------------------------------
   main.container wraps each page. Flex column + min-height pins footer down.
   -------------------------------------------------------------------------- */

.container {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 28px 40px;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
}

/* ---------- Navigation ----------------------------------------------------
   Top bar: brand left, links right. .active = current page (set in HTML).
   -------------------------------------------------------------------------- */

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 56px;
  font-size: 14px;
  font-weight: 500;
}

.site-nav .brand {
  color: var(--text);
  font-weight: 600;
}

.site-nav ul {
  display: flex;
  gap: 30px;
}

.site-nav a {
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--accent);
}

.site-nav a.active {
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 3px;
}

/* ---------- Typography ------------------------------------------------------
   .display = home hero name; .page-title = inner page H1; .eyebrow = small caps
   labels; .lead = serif intro paragraphs; .subtitle = projects blurb.
   -------------------------------------------------------------------------- */

h1.display {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 9vw, 3.85rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text);
}

h1.page-title {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--text);
}

h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
}

.lead {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2.5vw, 1.28rem);
  line-height: 1.62;
  margin: 22px 0 0;
  max-width: 36rem;
  font-weight: 400;
  color: var(--text);
}

.subtitle {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 500px;
  margin-bottom: 36px;
  line-height: 1.6;
}

/* ---------- Buttons & inline links ---------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  background: var(--text);
  color: var(--bg);
  border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.15s;
}

.btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-row {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-top: 28px;
  flex-wrap: wrap;
}

.link-accent {
  font-family: var(--font-sans);
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.15s;
}

.link-accent:hover {
  opacity: 0.7;
}

/* ---------- Section divider (home: rule above featured project) ----------- */

.section-divider {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
}

/* ---------- Featured project (home only) ----------------------------------
   Grid: index number (same style as projects) | title + copy | year, baseline.
   -------------------------------------------------------------------------- */

.featured-project {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 18px 24px;
  align-items: baseline;
}

.featured-project h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3.5vw, 1.65rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text);
}

.featured-project p {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.62;
  max-width: 32rem;
  color: var(--text);
  font-weight: 400;
}

.tag-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 12px;
  border: 1px solid var(--rule);
  border-radius: 100px;
  color: var(--text);
  background: transparent;
}

.year {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

/* ---------- Projects page -------------------------------------------------
   Filters toggle .active; rows use data-category + .is-hidden (see JS).
   .project may be <a> or <div>; both use the same grid.
   -------------------------------------------------------------------------- */

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.filter {
  font-size: 11px;
  padding: 5px 13px;
  border: 0.5px solid var(--text);
  border-radius: 100px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: background 0.15s, color 0.15s;
}

.filter:hover {
  background: var(--rule);
}

.filter.active {
  background: var(--text);
  color: var(--bg);
}

.project-list {
  border-top: 1px solid var(--rule);
}

.project {
  display: grid;
  grid-template-columns: 40px 1fr 90px;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  transition: background 0.15s;
  color: inherit;
}

.project:hover {
  background: rgba(26, 26, 26, 0.025);
}

/* Applied by projects.html filter script when category does not match */
.project.is-hidden {
  display: none;
}

.project-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

.project h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--text);
}

.project p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 6px;
  max-width: 480px;
}

.project .stack {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.project-meta {
  text-align: right;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}

/* Rows with screenshot galleries (e.g. Blueprint) */
.project--with-gallery {
  align-items: start;
}

.project--with-gallery .project-meta {
  padding-top: 4px;
}

.project-main {
  min-width: 0;
}

.project-gallery {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.project-gallery figure {
  margin: 0;
}

.project-gallery img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  border: 0.5px solid var(--rule);
}

.project-gallery figcaption {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.4;
  font-family: var(--font-sans);
}

/* ---------- About page ----------------------------------------------------
   Two columns: narrow sidebar meta, wide prose. No photo (per site owner).
   -------------------------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 40px;
}

/* Reserved if you add a headshot later */
.about-sidebar img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 18px;
  display: block;
}

.meta-block {
  font-size: 12px;
  line-height: 1.6;
}

.meta-label {
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.meta-value {
  margin-bottom: 12px;
  color: var(--text);
}

.prose p {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.65;
  margin-bottom: 16px;
}

.prose-footer {
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  margin-top: 10px;
}

.prose-footer p {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  margin: 10px 0 0;
  color: var(--text);
}

/* ---------- Skills section (about.html) -----------------------------------
   Four cards; --card-accent colors the top stripe (accent vs text rotation).
   -------------------------------------------------------------------------- */

.skills-section {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}

.skills-section > h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.skills-intro {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 0 18px;
  line-height: 1.6;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.skill-card {
  --card-accent: var(--accent);
  background: var(--surface);
  border: 0.5px solid var(--rule);
  border-radius: 8px;
  padding: 16px 16px 12px;
  border-top: 3px solid var(--card-accent);
}

.skill-card--lang {
  --card-accent: var(--accent);
}

.skill-card--web {
  --card-accent: var(--text);
}

.skill-card--data {
  --card-accent: var(--accent);
}

.skill-card--tools {
  --card-accent: var(--text);
}

.skill-card-heading {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 12px;
  color: var(--text);
}

.skill-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.skill-items > li {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 0.5px solid var(--rule);
}

.skill-items > li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.skill-name {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-sans);
}

.skill-note {
  margin: 0 !important;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  font-family: var(--font-sans);
}

/* ---------- Current work page (current.html) ------------------------------
   "Now" style: callout, two-column grids, small meta footer line.
   -------------------------------------------------------------------------- */

.status-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  margin-bottom: 26px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
}

.status-callout strong {
  color: var(--accent);
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.now-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 26px;
}

.now-block .eyebrow {
  margin-bottom: 10px;
}

.now-block ul {
  list-style: disc;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.75;
}

.now-block p {
  font-size: 14px;
  line-height: 1.7;
}

.now-block p em {
  font-style: italic;
}

/* Small layout helpers used only on current.html */
.now-updated {
  display: block;
  margin-bottom: 28px;
}

.now-lead {
  font-size: 17px;
  margin: 0 0 28px;
}

.contact-lead {
  margin: 14px 0 36px;
}

/* ---------- Contact page --------------------------------------------------
   Label/value grid + blue availability strip (inverted button).
   -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px 28px;
  font-size: 15px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
  margin-top: 8px;
}

.contact-grid .eyebrow {
  align-self: center;
}

.contact-grid a.link-accent {
  text-decoration: none;
}

.contact-grid a.link-accent:hover {
  text-decoration: underline;
}

.availability {
  margin-top: 26px;
  padding: 18px 24px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.availability-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 500;
  opacity: 0.85;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.availability-text {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.3;
}

.availability .btn {
  background: var(--bg);
  color: var(--accent);
  white-space: nowrap;
}

.availability .btn:hover {
  opacity: 0.92;
}

/* ---------- Library page (library.html) -----------------------------------
   Sections: now reading, bookshelf, learning links, notes list. Reuses .eyebrow,
   .section-head, .link-accent from shared styles.
   -------------------------------------------------------------------------- */

.library-section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.library-section.first {
  margin-top: 32px;
  padding-top: 0;
  border-top: none;
}

.library-section .eyebrow {
  margin-bottom: 18px;
}

/* Short gray line under section eyebrow (Bookshelf / Learning) */
.section-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: -10px 0 16px;
  line-height: 1.5;
}

/* --- Now reading: in-progress books --- */

.now-reading-item {
  margin-bottom: 24px;
}

.now-reading-item:last-child {
  margin-bottom: 0;
}

.now-reading-item h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
  color: var(--text);
}

.book-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.book-note {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.55;
  max-width: 540px;
  color: var(--text);
}

/* --- Bookshelf: finished books, year in first column --- */

.shelf-list {
  border-top: 1px solid var(--rule);
}

.shelf-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.shelf-row:last-child {
  border-bottom: none;
}

.shelf-year {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

.shelf-title {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--text);
}

.shelf-author {
  opacity: 0.7;
}

.shelf-take {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.55;
}

/* --- Learning: external resources as rows --- */

.resource-list {
  border-top: 1px solid var(--rule);
}

.resource-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  transition: background 0.15s;
  color: inherit;
}

.resource-row:last-child {
  border-bottom: none;
}

.resource-row:hover {
  background: rgba(26, 26, 26, 0.025);
}

.resource-row:hover .resource-name {
  color: var(--accent);
}

.resource-name {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  transition: color 0.15s;
}

.resource-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* --- Notes: dated rows (set href when you add posts) --- */

.notes-list {
  border-top: 1px solid var(--rule);
}

.notes-row {
  display: grid;
  grid-template-columns: 70px 1fr 30px;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  transition: background 0.15s;
  color: inherit;
}

.notes-row:last-child {
  border-bottom: none;
}

.notes-row:hover {
  background: rgba(26, 26, 26, 0.025);
}

.notes-row:hover .note-arrow {
  transform: translateX(4px);
}

.note-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.note-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.note-summary {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

.note-summary code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(26, 26, 26, 0.06);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--text);
}

.note-arrow {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  text-align: right;
  transition: transform 0.15s;
}

/* ---------- Site footer ---------------------------------------------------
   margin-top: auto consumes free space in .container flex column = sticky foot
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-dim);
}

.site-footer p {
  margin: 0;
}

/*
 * projects.html places an inline <script> after the footer inside <main>.
 * display:none removes it from the flex layout (script would otherwise sit
 * as a flex item below the footer). The script still runs when parsed.
 */
main.container > script {
  display: none;
}

/* ---------- Responsive ----------------------------------------------------
   Breakpoint ~640px: stack grids, shrink display type, stack availability CTA
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .container {
    padding: 28px 22px 64px;
  }

  .site-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 48px;
  }

  .site-nav ul {
    flex-wrap: wrap;
    gap: 20px;
  }

  h1.display {
    font-size: clamp(2.35rem, 10vw, 3.25rem);
  }

  h1.page-title {
    font-size: clamp(1.85rem, 7vw, 2.35rem);
  }

  .lead {
    font-size: 1.05rem;
  }

  .featured-project {
    grid-template-columns: 28px 1fr;
    gap: 14px 16px;
  }

  .featured-project .project-num {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    padding-top: 0.2rem;
  }

  .featured-project > div {
    grid-column: 2;
    grid-row: 1;
  }

  .featured-project .year {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }

  .about-grid,
  .now-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .project {
    grid-template-columns: 28px 1fr;
  }

  .project-meta {
    grid-column: 2;
    text-align: left;
  }

  .availability {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-row {
    flex-wrap: wrap;
    gap: 16px;
  }

  /* Library: stack year / name / date columns on small screens */
  .shelf-row,
  .resource-row,
  .notes-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .notes-row .note-arrow {
    display: none;
  }
}
