/* Agustín Gutiérrez — personal website.
   Source Serif for text, Source Sans for the name, headings and links.
   One accent color: the dark blue used in Agustin's papers ("ChadBlue"). */

:root {
  --text: #222222;
  --muted: #5f6368;
  --accent: #1a1a80;      /* ChadBlue, rgb(.1,.1,.5) */
  --rule: #dcdcdc;
  --bg: #ffffff;
  --width: 960px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

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

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 24px;
  padding-top: 28px;
  padding-bottom: 18px;
}
.site-name {
  font-family: var(--sans);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.site-name:hover { text-decoration: none; }
.site-nav { font-family: var(--sans); font-size: 16px; }
.site-nav a { color: var(--muted); margin-left: 24px; }
.site-nav a:first-child { margin-left: 0; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* ---------- Layout ---------- */
main.wrap { padding-top: 44px; padding-bottom: 56px; }
section + section { margin-top: 48px; }

h2 {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 22px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

/* ---------- About ---------- */
.about {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}
.photo {
  width: 168px;
  height: auto;
  flex-shrink: 0;
  border-radius: 6px;
}
.intro { margin: 0 0 20px; font-size: 18px; }
.contact {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 18px;
  margin: 0;
  font-size: 16px;
}
.contact dt {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.contact dd { margin: 0; }

/* ---------- Papers ---------- */
.paper { margin: 0 0 24px; }
.paper:last-child { margin-bottom: 0; }
.paper h3 {
  font-family: var(--serif);
  font-size: 17.5px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 2px;
}
.meta {
  margin: 0;
  font-size: 15.5px;
  color: var(--muted);
}
.meta a { white-space: nowrap; color: var(--muted); text-decoration: underline; text-decoration-color: #c4c4c4; text-underline-offset: 2px; }
.meta a:hover { color: var(--accent); text-decoration-color: currentColor; }

/* Links under a paper, on one line; "Abstract" is a toggle in the same row. */
.paper-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 18px;
  margin-top: 4px;
  font-family: var(--sans);
  font-size: 15px;
}
.paper-links details { display: inline-block; }
.paper-links summary {
  cursor: pointer;
  list-style: none;
  color: var(--accent);
}
.paper-links summary::-webkit-details-marker { display: none; }
.paper-links summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 4px;
  font-size: 0.85em;
  transition: transform 0.15s ease;
}
.paper-links details[open] summary::before { transform: rotate(90deg); }
.paper-links summary:hover { text-decoration: underline; text-underline-offset: 2px; }

/* The abstract starts hidden (HTML "hidden" attribute); a short script in
   index.html shows it while the "Abstract" toggle is open. */
.abstract {
  max-width: 46em;          /* keep long abstracts at a readable line length */
  margin: 10px 0 0;
  padding-left: 14px;
  border-left: 2px solid var(--rule);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
}
.abstract[hidden] { display: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  padding: 18px 0 32px;
}

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .header-inner { padding-top: 20px; padding-bottom: 12px; }
  .site-name { font-size: 22px; }
  .site-nav a { display: inline-block; padding: 6px 0; margin-left: 20px; }
  main.wrap { padding-top: 26px; }
  section + section { margin-top: 40px; }

  /* Small photo beside the intro; contact list underneath, full width. */
  .about {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 18px 16px;
    align-items: start;
  }
  .about-text { display: contents; }
  .photo { width: 92px; border-radius: 5px; }
  .intro { margin: 0; font-size: 16px; line-height: 1.55; }
  .contact { grid-column: 1 / -1; font-size: 15.5px; gap: 6px 16px; }

  /* Paper titles and links: comfortable to read and to tap. */
  .paper { margin-bottom: 26px; }
  .paper h3 { font-size: 17px; }
  .paper-links { gap: 0 18px; margin-top: 2px; }
  .paper-links a, .paper-links summary { display: inline-block; padding: 6px 0; }
  .abstract { font-size: 15px; padding-left: 12px; }
}
