/* francisca.cr — shared styles for the English pages */

:root {
  --bg: #18181b;
  --fg: #d4d4d8;
  --strong: #f4f4f5;
  --muted: #8b8b94;
  --rule: #2c2c31;
  --accent: #ff85a2;
  --accent-soft: rgba(255, 133, 162, 0.45);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 42rem;
  --label: 7.5rem;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fefbec;
    --fg: #3f3f46;
    --strong: #18181b;
    --muted: #6b6b73;
    --rule: #efe8cf;
    --accent: #c2185b;
    --accent-soft: rgba(194, 24, 91, 0.35);

    color-scheme: light;
  }
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.page {
  max-width: var(--measure);
  margin: 0 0 0 clamp(0rem, 8vw, 9rem);
  padding: 2.5rem 1.5rem 3rem;
}

/* Links: text colour with an accent underline, accent on hover */
a {
  color: var(--strong);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

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

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-bottom: 1.25rem;
  margin-bottom: 3.5rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.875rem;
}

.site-name {
  color: var(--strong);
  text-decoration: none;
  font-weight: 500;
}

.site-name::before {
  content: "~/";
  color: var(--accent);
}

.site-header-right {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--strong);
}

.site-nav a[aria-current="page"]::before {
  content: "> ";
  color: var(--accent);
}

/* Headings */
h1,
h2,
h3 {
  color: var(--strong);
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.5rem;
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h1 .prompt {
  color: var(--accent);
}

h2 {
  margin: 3rem 0 1rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

h3 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}

p {
  margin: 0 0 1.1rem;
  text-wrap: pretty;
}

strong {
  color: var(--strong);
  font-weight: 600;
}

.lede {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--strong);
}

.muted {
  color: var(--muted);
}

/* Typing cursor on the homepage greeting */
.typed::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 0.15em;
  vertical-align: -0.15em;
  background: var(--accent);
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Label / content rows (homepage sections) */
.rows {
  margin: 2.5rem 0 0;
  padding: 0;
}

.row {
  display: grid;
  grid-template-columns: var(--label) 1fr;
  gap: 0 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
}

.row dt {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.9rem;
  color: var(--muted);
}

.row dd {
  margin: 0;
}

.row dd p:last-child {
  margin-bottom: 0;
}

/* Dated lists (talks, press) */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: var(--label) 1fr;
  gap: 0 1.5rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
}

.timeline .when {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.75rem;
  color: var(--muted);
}

.timeline .title {
  display: block;
  color: var(--strong);
  font-weight: 500;
}

.timeline .meta {
  display: block;
  font-size: 0.9375rem;
  color: var(--muted);
}

.tag {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0 0.4rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: 0.1em;
}

/* Figures */
figure {
  margin: 2rem 0;
}

figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

figure.small img {
  max-width: 18rem;
}

figcaption {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.social {
  display: flex;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  color: var(--muted);
  font-size: 1rem;
  text-decoration: none;
}

/* Thin divider between the text nav and the icons */
.site-header .social {
  padding-left: 1.25rem;
  border-left: 1px solid var(--rule);
}

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

@media (max-width: 600px) {
  body {
    font-size: 0.9375rem;
  }

  .page {
    margin-left: 0;
    padding: 1.5rem 1.25rem 2.5rem;
  }

  .site-header .social {
    padding-left: 0;
    border-left: 0;
  }

  .site-header {
    margin-bottom: 2.5rem;
  }

  h1 {
    font-size: 1.4rem;
  }

  .lede {
    font-size: 1rem;
  }

  .row,
  .timeline li {
    grid-template-columns: 1fr;
  }

  .row dt,
  .timeline .when {
    line-height: 1.6;
    margin-bottom: 0.25rem;
  }
}

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

/* Long-form text (research page): justified, with hyphenation so lines stay evenly spaced */
.prose p {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Narrow columns get gappy when justified, so phones stay left-aligned */
@media (max-width: 600px) {
  .prose p {
    text-align: left;
  }
}
