/* Julian D. Santamaria — personal site
   Layout: one centered column (max 1120px); header nav, sections stacked with generous gaps. */

:root {
  --bg: #fcfcfb;
  --fg: #111316;
  --text: #33373d;
  --muted: #5c6068;
  --rule: #e3e4e6;
  --border: #c9cbd0;
  --link: #2f43c0;
  --link-hover: #1c2a85;
  --conf: #3557d6;
  --conf-text: #2a47b8;
  --journal: #2e9e5b;
  --journal-text: #ffffff;
  --topic-1: #d9534f;
  --topic-2: #2e9e5b;
  --topic-3: #3557d6;
  --topic-4: #c9a227;
  --btn-bg: #111316;
  --btn-fg: #ffffff;

  --font-display: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Literata", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --wrap: 1120px;
  --gutter: 32px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111316;
    --fg: #edeef0;
    --text: #c9ccd2;
    --muted: #9a9ea6;
    --rule: #2a2d33;
    --border: #3a3e45;
    --link: #8fa0ff;
    --link-hover: #b7c2ff;
    --conf: #6f86f0;
    --conf-text: #9fb0ff;
    --journal: #3dba70;
    --journal-text: #0c1a12;
    --topic-1: #f07571;
    --topic-2: #3dba70;
    --topic-3: #6f86f0;
    --topic-4: #e0bd45;
    --btn-bg: #edeef0;
    --btn-fg: #111316;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111316;
  --fg: #edeef0;
  --text: #c9ccd2;
  --muted: #9a9ea6;
  --rule: #2a2d33;
  --border: #3a3e45;
  --link: #8fa0ff;
  --link-hover: #b7c2ff;
  --conf: #6f86f0;
  --conf-text: #9fb0ff;
  --journal: #3dba70;
  --journal-text: #0c1a12;
  --topic-1: #f07571;
  --topic-2: #3dba70;
  --topic-3: #6f86f0;
  --topic-4: #e0bd45;
  --btn-bg: #edeef0;
  --btn-fg: #111316;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  text-wrap: balance;
  margin: 0;
}

p {
  margin: 0;
}

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  padding-block: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}
.brand:hover {
  color: var(--fg);
}
.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex: 0 0 18px;
  background: conic-gradient(#e5484d, #f5a524, #3fb65f, #1fb5c0, #3d63dd, #8e4ec6, #e5484d);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}
.nav a {
  color: var(--fg);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
}
.nav a:hover {
  background: var(--rule);
  color: var(--fg);
}
.nav a[aria-current="page"] {
  background: var(--btn-bg);
  color: var(--btn-fg);
}

/* ---------- Main ---------- */

main.wrap {
  padding-block: 64px 96px;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.spectrum {
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, #e5484d, #f5a524, #c9c22a, #3fb65f, #1fb5c0, #3d63dd, #8e4ec6, #e5484d);
  background: linear-gradient(90deg in oklch longer hue, oklch(0.7 0.15 25), oklch(0.7 0.15 25));
}
.spectrum.thin {
  height: 3px;
}

.label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.more {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

/* Hero (home) */

.hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.hero h1 {
  font-weight: 800;
  font-size: clamp(52px, 9vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.intro {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 64px;
  align-items: flex-start;
  margin-top: -32px;
}
.intro-text {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.intro-text p {
  max-width: 62ch;
  font-size: 18px;
  color: var(--text);
}
.intro-photo {
  flex: 1 1 240px;
  max-width: 300px;
  margin: 0;
}
.intro-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 2px;
}
.intro-photo figcaption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* Buttons */

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
  text-decoration: none;
  padding: 0 17px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.btn:hover {
  color: var(--fg);
  border-color: var(--fg);
}
.btn.primary {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-fg);
}
.btn.primary:hover {
  color: var(--btn-fg);
  opacity: 0.88;
}

/* Research topics */

.topics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
}
.topic {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 3px solid var(--topic-color, var(--topic-1));
  padding-top: 16px;
}
.topic h3 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}
.topic p {
  max-width: 70ch;
  font-size: 15px;
  color: var(--text);
}
.topic-1 { --topic-color: var(--topic-1); }
.topic-2 { --topic-color: var(--topic-2); }
.topic-3 { --topic-color: var(--topic-3); }

/* Publications */

.pubs {
  display: flex;
  flex-direction: column;
}
.pub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}
.pub:last-child {
  border-bottom: 1px solid var(--rule);
}
.pub-venue {
  flex: 0 0 120px;
}
.pub-body {
  flex: 999 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pub-title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
}
.pub-authors,
.pub-where {
  font-size: 15px;
  color: var(--muted);
}
.pub-authors strong {
  color: var(--fg);
  font-weight: 600;
}
.pub-where em {
  font-style: italic;
}
.pub-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--topic-1);
}
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  padding-top: 4px;
}
.pub-links button {
  font: inherit;
  color: var(--link);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.pub-links button:hover {
  color: var(--link-hover);
}
.pub-extra {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text);
}
.pub-extra pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}

.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border: 1.5px solid var(--conf);
  color: var(--conf-text);
  border-radius: 999px;
  white-space: nowrap;
}
.chip.journal {
  background: var(--journal);
  border-color: var(--journal);
  color: var(--journal-text);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1.5px solid var(--conf);
}
.legend i.journal {
  background: var(--journal);
  border-color: var(--journal);
}

.year {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
  padding-top: 24px;
  padding-bottom: 4px;
}

/* News */

.news {
  display: flex;
  flex-direction: column;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.news li {
  display: flex;
  gap: 16px;
  align-items: baseline;
}
.news .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 12px;
  background: var(--dot, var(--topic-3));
}
.news time {
  flex: 0 0 80px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.news span:last-child {
  min-width: 0;
}

/* Inner pages */

.page-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.page-head h1 {
  font-weight: 800;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1;
  letter-spacing: -0.03em;
}
.page-head p {
  max-width: 62ch;
  color: var(--text);
}

.entries {
  display: flex;
  flex-direction: column;
}
.entry {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 32px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}
.entry:last-child {
  border-bottom: 1px solid var(--rule);
}
.entry-when {
  flex: 0 0 170px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  padding-top: 3px;
}
.entry-body {
  flex: 999 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.entry-body h3 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}
.entry-body .where {
  font-size: 15px;
  color: var(--muted);
}
.entry-body p {
  font-size: 15px;
  color: var(--text);
}

.project {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}
.project:last-child {
  border-bottom: 1px solid var(--rule);
}
.project h3 {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
}
.project p {
  max-width: 70ch;
  font-size: 16px;
  color: var(--text);
}
.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px 32px;
}
.skills h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.skills p {
  font-size: 15px;
  color: var(--text);
}

/* ---------- Footer ---------- */

.site-footer .wrap {
  padding-block: 0 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.footer-row nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-row a {
  color: var(--muted);
}
.footer-row a:hover {
  color: var(--fg);
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  :root {
    --gutter: 20px;
  }
  body {
    font-size: 16px;
  }
  main.wrap {
    padding-block: 40px 72px;
    gap: 64px;
  }
  .intro {
    margin-top: -16px;
  }
  .intro-photo {
    max-width: 220px;
  }
  .nav a {
    padding: 6px 11px;
  }
  .entry-when {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
