/* robertomastrangelo.com - one stylesheet, no framework, no web fonts, no JavaScript.
   Independent of the benchmark's styling: nothing here is shared with asr-bench. */

:root {
  --bg: #f7f3ec;
  --surface: #fbf8f3;
  --ink: #1f1c18;
  --ink-soft: #4f483f;
  --rule: #ddd4c6;
  --accent: #a23c1c;
  --accent-ink: #ffffff;
  --focus: #1d4f91;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 38rem;
  --wrap: 68rem;
  --gutter: 1rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1b18;
    --surface: #25221e;
    --ink: #f1ebe1;
    --ink-soft: #c9c1b5;
    --rule: #3d3832;
    --accent: #e8906a;
    --accent-ink: #1d1b18;
    --focus: #8fb8ff;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;          /* 17px on phones */
  line-height: 1.6;
}
@media (min-width: 48rem) {
  body { font-size: 1.125rem; }  /* 18px on desktop */
}

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

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
@media (min-width: 48rem) { :root { --gutter: 2rem; } }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--ink);
  color: var(--bg);
  padding: .5rem .9rem;
  z-index: 10;
}
.skip:focus { top: .75rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding-block: 1rem;
}
.identity {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: .005em;
}
.nav {
  list-style: none;
  display: flex;
  gap: .25rem 1.25rem;
  margin: 0;
  padding: 0;
}
.nav a {
  display: inline-block;
  padding: .35rem 0;
  text-decoration: none;
  color: var(--ink-soft);
}
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .3em; }

/* Labels and the h1 (shown on the privacy and 404 pages; hidden on the homepage) */
.eyebrow, .section-label, .project-kind {
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}
.eyebrow { color: var(--accent); }

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: -.015em;
  margin: .6rem 0 0;
}



/* Sections */
/* The rule sits on the content edge, not across the gutter padding. */
.section { padding-block: 3rem; position: relative; }
.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  border-top: 1px solid var(--rule);
}
@media (min-width: 48rem) { .section { padding-block: 4.5rem; } }
.section-label { margin-bottom: 1.75rem; }

/* The first section sits right under the header, whose border already separates it. */
.section-top { padding-top: 2.5rem; }
.section-top::before { display: none; }
@media (min-width: 48rem) { .section-top { padding-top: 3.5rem; } }

/* Projects: the featured card spans the width; later cards fill two columns */
.projects { display: grid; gap: 2rem; }
@media (min-width: 48rem) { .projects { grid-template-columns: 1fr 1fr; } }
.project {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}
.project-featured { grid-column: 1 / -1; }
@media (min-width: 60rem) {
  .project-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: stretch;
  }
}
.project-figure {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 60rem) {
  .project-featured .project-figure { border-bottom: 0; border-right: 1px solid var(--rule); padding: 1.75rem; }
}
.project-figure img { width: 100%; }
.project-figure figcaption {
  font-size: .875rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-top: .9rem;
}
.project-body { padding: 1.5rem 1.25rem 1.75rem; }
@media (min-width: 60rem) { .project-featured .project-body { padding: 2.25rem 2.25rem 2.5rem; } }
.project h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.15;
  margin: .5rem 0 1rem;
}
.project-body p { margin: 0 0 1rem; max-width: var(--measure); }
.project-body p:last-child { margin-bottom: 0; }

.text-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
}
.text-link:hover { text-decoration-thickness: 2px; }

/* About */
.about { display: grid; gap: 1.75rem; align-items: start; }
@media (min-width: 48rem) { .about { grid-template-columns: 11rem minmax(0, 1fr); gap: 3rem; } }
.portrait {
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
}
@media (min-width: 48rem) { .portrait { width: 11rem; height: 11rem; } }
.about-text p { margin: 0 0 1rem; max-width: var(--measure); }
.about-text p:last-child { margin-bottom: 0; }

/* Other activities, contact */
.other p, .contact-text { margin: 0; max-width: var(--measure); }
.other .muted { margin-top: .4rem; }
.muted { color: var(--ink-soft); font-size: .95em; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  font-size: .9rem;
  color: var(--ink-soft);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 2rem;
  padding-block: 1.75rem 2.25rem;
}
.footer-row p { margin: 0; }

/* Plain pages (privacy, 404) */
.page { padding-block: 3.5rem 4.5rem; }
.page h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.page p, .page li { max-width: var(--measure); }
.page h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  margin: 2.25rem 0 .5rem;
}
.page ul { padding-left: 1.2rem; }
/* Read by screen readers and search engines, not shown. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
