/* ------------------------------------------------------------------
   this is my art — portfolio of Ricardo Ruiz Freire
   Fraunces (display serif) + Inter (UI/body). Warm paper, ink, terracotta.
------------------------------------------------------------------- */
:root {
  --bg: #faf6ef;
  --surface: #ffffff;
  --surface-2: #f2ebdf;
  --ink: #1d1a17;
  --ink-2: #56504a;
  --line: #e4dccd;
  --accent: #b23a1e;       /* terracotta / Northeast earth */
  --accent-ink: #ffffff;
  --accent-2: #14585a;     /* deep sea green */
  --tint: #f6e4dc;
  --shadow: 0 1px 2px rgba(29,26,23,.06), 0 8px 24px rgba(29,26,23,.06);
  --radius: 14px;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110f;
    --surface: #1d1916;
    --surface-2: #26211d;
    --ink: #f3ece1;
    --ink-2: #b9b0a3;
    --line: #342d27;
    --accent: #ee8a6b;
    --accent-ink: #1d1916;
    --accent-2: #6fc0bd;
    --tint: #2f2019;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }

/* Header ----------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { display: block; width: 38px; height: 38px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.brand-text small { font-size: 12px; color: var(--ink-2); letter-spacing: .04em; }
.nav { display: flex; flex-wrap: wrap; gap: 2px 4px; }
.nav a { padding: 6px 11px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--tint); color: var(--accent); }

/* Headings & text ---------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 2em 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); font-weight: 700; margin-top: 0; }
h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); }
h3 { font-size: 1.25rem; }
p, ul, ol { margin: 0 0 1.1em; }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
blockquote { margin: 1.5em 0; padding: .2em 1.2em; border-left: 3px solid var(--accent); color: var(--ink-2); font-family: var(--serif); font-size: 1.1em; }
small { font-size: .85em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 5px; font-size: .9em; }

.page { max-width: 760px; margin: 0 auto; padding: 56px 0 72px; }
.page.has-cards { max-width: none; }
.page-head { margin-bottom: 2rem; }
.page.has-cards .page-head { max-width: 760px; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 600; color: var(--accent); margin: 0 0 .6rem; }
.lede { font-family: var(--serif); font-size: 1.3rem; line-height: 1.5; color: var(--ink-2); margin-top: .8rem; }
.page img { max-width: 100%; height: auto; border-radius: 10px; box-shadow: var(--shadow); margin: .4em 0; }
.page iframe { max-width: 100%; border: 0; border-radius: 10px; margin: .4em 0; aspect-ratio: 16 / 9; height: auto; width: 100%; }
.page > h2:first-child, .page > .page-head + h2 { margin-top: 0; }

/* Facts / meta strips ------------------------------------------------ */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 1.6rem 0 2rem; }
.facts div { background: var(--surface); padding: 14px 16px; }
.facts dt, .facts .k { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); font-weight: 600; display: block; }
.facts dd, .facts .v { margin: 2px 0 0; font-weight: 500; display: block; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; font-size: 15px; margin: 4px 8px 4px 0; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.cover { float: right; width: min(240px, 42%); margin: 0 0 1rem 1.5rem; }

/* Cards ------------------------------------------------------------- */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 1.5rem 0 2.5rem; }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.card-media { display: block; aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; border-radius: 0; box-shadow: none; }
.card-media.contain img { object-fit: contain; padding: 10px; }
.card-media.no-img { background: linear-gradient(135deg, var(--tint), var(--surface-2)); position: relative; }
.card-media.no-img::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 55%); }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.tag { align-self: flex-start; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 12%, transparent); padding: 3px 9px; border-radius: 999px; }
.card-title { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; line-height: 1.25; }
.card-text { color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.card-meta { margin-top: auto; padding-top: 8px; font-size: 13px; color: var(--ink-2); }

/* Plain lists on card-less pages become tidy rows */
.page:not(.has-cards) > ul:not(.plain) { padding-left: 1.2em; }

/* Entry blocks (texts, lectures, awards) ----------------------------- */
.page.has-entries h2 { padding-top: 1.4em; border-top: 1px solid var(--line); margin-top: 2em; }
.page.has-entries h2:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.page.has-entries hr { display: none; }

/* Home ---------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: 1.35fr .65fr; gap: 56px; align-items: center; padding: 72px 0 48px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: .35em; }
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 600; }
.hero .lede { margin: 0 0 1.4rem; }
.hero-aside { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); }
.hero-aside h2 { font-size: .8rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--ink-2); margin: 0 0 .8rem; }
.hero-aside ul { list-style: none; padding: 0; margin: 0; }
.hero-aside li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.hero-aside li:first-child { border-top: 0; padding-top: 0; }
.hero-aside li span { display: block; color: var(--ink-2); font-size: 13px; }
.section { padding: 24px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 1.5rem; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; font-size: 15px; text-decoration: none; }
.prose { max-width: 760px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; margin: 1rem 0 3rem; }
.cols h3 { margin-top: 0; font-size: 1.1rem; }
.cols ul { padding-left: 1.1em; }
.cols li { margin-bottom: .4em; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin: 1.2rem 0 2rem; }
.pillar { background: var(--surface-2); border-radius: var(--radius); padding: 20px; }
.pillar h3 { margin: 0 0 .3em; font-size: 1.1rem; }
.pillar p { margin: 0; font-size: 15px; color: var(--ink-2); }

/* Footer --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 32px 0 48px; color: var(--ink-2); font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.footer-inner .links { display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
  body { font-size: 16px; }
  .page { padding-top: 36px; }
  .cover { float: none; display: block; margin: 0 0 1.2rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer { display: none; } }
