/* danielaguayo.com
   Tokens from design/README.md ("Ownership — autoridad serena").
   Dark mode is not defined in the brand system; it is derived here in the same warm hue family. */

/* Self-hosted variable fonts (SIL OFL, see assets/fonts/OFL-*.txt) */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/work-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/work-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #241F1B;
  --muted: #5A5148;
  --muted-2: #7A7166;
  --accent: #A2572D;
  --surface: #FAF6F0;
  --surface-alt: #FFFFFF;
  --neutral-200: #E4D9C9;

  --display: "Fraunces", Georgia, serif;
  --text: "Work Sans", system-ui, -apple-system, sans-serif;

  --space-2: 8px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-14: 56px;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-full: 999px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F1E9DF;
    --muted: #C4B8AA;
    --muted-2: #9D9184;
    --accent: #DE9366;
    --surface: #1A1613;
    --surface-alt: #221D19;
    --neutral-200: #3A312A;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ink: #F1E9DF;
  --muted: #C4B8AA;
  --muted-2: #9D9184;
  --accent: #DE9366;
  --surface: #1A1613;
  --surface-alt: #221D19;
  --neutral-200: #3A312A;
  color-scheme: dark;
}

/* Base */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--space-6); }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 16px/1.7 var(--text);
}
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
p { margin: 0 0 var(--space-4); }
strong { font-weight: 600; }

.skip-link { position: absolute; left: -999px; top: var(--space-2); background: var(--surface-alt); padding: var(--space-2) var(--space-4); border: 1px solid var(--accent); border-radius: var(--radius-sm); z-index: 10; }
.skip-link:focus { left: var(--space-4); }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 var(--space-14); }
@media (max-width: 720px) { .wrap { padding: 0 var(--space-4); } }

/* Type */

h1, h2, h3 { font-family: var(--display); font-weight: 600; color: var(--ink); font-optical-sizing: auto; }
h1 { font-size: clamp(36px, 7vw, 52px); line-height: 1.08; letter-spacing: -.01em; margin: 0 0 var(--space-4); }
h2 { font-size: clamp(26px, 4.5vw, 32px); line-height: 1.2; margin: 0 0 var(--space-6); }
h3 { font-size: 22px; line-height: 1.3; margin: 0 0 var(--space-2); }
.eyebrow { font: 600 12px/1.4 var(--text); letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin: 0 0 var(--space-4); }
.label { font: 600 12px/1.4 var(--text); letter-spacing: 2px; text-transform: uppercase; color: var(--muted-2); margin: var(--space-8) 0 var(--space-2); }
.caption { font: 500 13px/1.5 var(--text); color: var(--muted-2); }
.lede { font-size: 19px; line-height: 1.6; max-width: 40rem; }

ul.list { padding-left: 1.1rem; margin: 0 0 var(--space-4); }
ul.list li { margin-bottom: var(--space-2); }
ul.list li::marker { color: var(--accent); }

/* Header */

.monogram {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-full);
  font: 600 15px/1 var(--display);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .02em;
}
.site-header { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-6) 0; border-bottom: 1px solid var(--neutral-200); }
.site-header nav { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--space-2) var(--space-6); font-size: 15px; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--ink); }
.theme-toggle {
  font: 500 13px/1 var(--text);
  color: var(--muted);
  background: none;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--ink); }
@media (max-width: 720px) {
  .site-header { align-items: flex-start; }
  .site-header nav { gap: var(--space-2) var(--space-4); }
}

/* Sections */

.section { padding: var(--space-14) 0; border-bottom: 1px solid var(--neutral-200); }
.section-intro { max-width: 42rem; color: var(--muted); margin-top: calc(-1 * var(--space-2)); margin-bottom: var(--space-8); }

/* Hero */

.hero { padding: 88px 0 var(--space-14); display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--space-14); align-items: start; }
.hero .role { font: 400 22px/1.3 var(--display); color: var(--muted); margin: 0 0 var(--space-8); }
.hero .lede { margin-bottom: var(--space-8); }
.links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); font-weight: 500; }
.strengths { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--neutral-200); }
.strengths li { padding: var(--space-4) 0; border-bottom: 1px solid var(--neutral-200); color: var(--muted); font-size: 15px; }
.strengths b { display: block; font: 600 17px/1.35 var(--display); color: var(--ink); margin-bottom: 4px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: var(--space-8); padding-top: var(--space-14); } }

/* Experience */

.jobs { display: grid; gap: var(--space-4); }
.job {
  background: var(--surface-alt);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: var(--space-8);
}
.job .when { padding-top: 6px; }
.job .body { max-width: 44rem; }
.job h3 span { font-weight: 400; color: var(--muted); }
.job .label:first-of-type { margin-top: var(--space-6); }
.job .body > :last-child { margin-bottom: 0; }
.job .related { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--neutral-200); }
@media (max-width: 720px) {
  .job { grid-template-columns: 1fr; gap: var(--space-2); padding: var(--space-6); }
  .job .when { padding-top: 0; }
}

/* Short experience list (home) */

.roles { list-style: none; margin: 0 0 var(--space-6); padding: 0; border-top: 1px solid var(--neutral-200); }
.roles li { display: grid; grid-template-columns: 11rem minmax(0, 44rem); gap: var(--space-8); padding: var(--space-6) 0; border-bottom: 1px solid var(--neutral-200); }
.roles .when { padding-top: 5px; }
.roles h3 { font-size: 20px; }
.roles h3 span { font-weight: 400; color: var(--muted); }
.roles p { color: var(--muted); margin-bottom: var(--space-2); }
.roles p:last-child { margin-bottom: 0; }
.more { font-weight: 500; }
.cards + .more { margin: var(--space-4) 0 0; }
@media (max-width: 720px) {
  .roles li { grid-template-columns: 1fr; gap: var(--space-2); }
  .roles .when { padding-top: 0; }
}

/* Page head (experience page) */

.page-head { padding: 72px 0 var(--space-8); max-width: 48rem; }
.page-head .lede { color: var(--muted); margin: 0; }
.page-body { padding: var(--space-8) 0 var(--space-14); }

/* Case study cards */

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.card {
  background: var(--surface-alt);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
a.card:hover { border-color: var(--accent); }
a.card:hover h3 { color: var(--accent); }
.card .eyebrow { margin-bottom: var(--space-2); }
.card p { color: var(--muted); margin: 0 0 var(--space-4); }
.card .caption { margin-top: auto; }
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }

/* Projects, teaching, contact */

.prose { max-width: 42rem; }
.pending { background: var(--surface-alt); border: 1px dashed var(--neutral-200); border-radius: var(--radius-md); padding: var(--space-6); max-width: 42rem; }
.pending p { margin: 0; color: var(--muted); }

.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-4); margin: 0; }
.contact div { border-top: 2px solid var(--accent); padding-top: var(--space-4); }
.contact dt { font: 600 12px/1.4 var(--text); letter-spacing: 2px; text-transform: uppercase; color: var(--muted-2); margin-bottom: 4px; }
.contact dd { margin: 0; font-size: 17px; overflow-wrap: anywhere; }

/* Case study page */

.case-head { padding: 72px 0 var(--space-8); max-width: 48rem; }
.case-head .lede { margin: 0; color: var(--muted); }
.back { display: inline-block; font-size: 15px; font-weight: 500; margin-bottom: var(--space-8); text-decoration: none; }
.back:hover { text-decoration: underline; }

.case { display: grid; grid-template-columns: 14rem minmax(0, 42rem); gap: var(--space-14); padding: var(--space-8) 0 var(--space-14); }
.case-meta { border-top: 2px solid var(--accent); padding-top: var(--space-4); align-self: start; position: sticky; top: var(--space-6); }
.case-meta dl { margin: 0; }
.case-meta dl > div + div { margin-top: var(--space-4); }
.case-meta dt { font: 600 12px/1.4 var(--text); letter-spacing: 2px; text-transform: uppercase; color: var(--muted-2); }
.case-meta dd { margin: 2px 0 0; font-size: 15px; }
.case-body .label:first-child { margin-top: 0; }
.case-body h2 { font-size: 24px; line-height: 1.3; margin: var(--space-14) 0 var(--space-4); }
.case-body h2:first-child { margin-top: 0; }
.case-body code { font: 500 .9em/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-alt); border: 1px solid var(--neutral-200); border-radius: var(--radius-sm); padding: 1px 5px; }
.repo { margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--neutral-200); font-weight: 500; }
.case-body > :last-child { margin-bottom: 0; }

.figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0 var(--space-6);
  padding: var(--space-6) 0;
  border-top: 1px solid var(--neutral-200);
  border-bottom: 1px solid var(--neutral-200);
}
.figures b { display: block; font: 600 34px/1.05 var(--display); color: var(--accent); margin-bottom: 4px; }
.figures span { font-size: 14px; color: var(--muted); }

.outcome { background: var(--surface-alt); border: 1px solid var(--neutral-200); border-radius: var(--radius-md); padding: var(--space-6); margin-top: var(--space-2); }
.outcome > :last-child { margin-bottom: 0; }

.case-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); padding: var(--space-8) 0 var(--space-14); border-top: 1px solid var(--neutral-200); }
.case-nav a { text-decoration: none; color: inherit; background: var(--surface-alt); border: 1px solid var(--neutral-200); border-radius: var(--radius-md); padding: var(--space-4) var(--space-6); }
.case-nav a:hover { border-color: var(--accent); }
.case-nav a:hover .t { color: var(--accent); }
.case-nav .t { display: block; font: 600 17px/1.35 var(--display); margin-top: 2px; }
.case-nav .next { text-align: right; grid-column: 2; }

@media (max-width: 860px) {
  .case { grid-template-columns: 1fr; gap: var(--space-6); padding-top: 0; }
  .case-meta { position: static; }
  .case-meta dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }
  .case-meta dl > div + div { margin-top: 0; }
  .case-meta dl > div:nth-child(n+3) { margin-top: var(--space-4); }
}
@media (max-width: 520px) {
  .figures { grid-template-columns: 1fr 1fr; }
  .case-nav { grid-template-columns: 1fr; }
  .case-nav .next { grid-column: 1; }
}

/* Footer */

.site-footer { padding: var(--space-8) 0 var(--space-14); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); color: var(--muted-2); font-size: 14px; }
.site-footer a { color: inherit; }

/* Diagrams: Mermaid SVGs inlined without their own styles, coloured with the theme tokens */

.diagram { margin: var(--space-6) 0 var(--space-8); padding: var(--space-4); background: var(--surface-alt); border: 1px solid var(--neutral-200); border-radius: var(--radius-md); }
.diagram svg { display: block; width: 100%; height: auto; margin: 0 auto; overflow: visible; font: 400 14px/1.5 var(--text); }
.diagram foreignObject { overflow: visible; }
.diagram p { margin: 0; }
/* Mermaid uses the class "label" too: undo the site's small-caps label style inside diagrams */
.diagram .label { font: inherit; letter-spacing: normal; text-transform: none; color: inherit; margin: 0; }
.diagram .node rect,
.diagram .node path { fill: var(--surface); stroke: var(--muted-2); stroke-width: 1.25px; }
.diagram .flowchart-link { fill: none; stroke: var(--muted-2); stroke-width: 1.25px; }
.diagram .arrowMarkerPath { fill: var(--muted-2); stroke: none; }
.diagram .nodeLabel { color: var(--ink); }
.diagram .edgeLabel, .diagram .labelBkg { color: var(--muted); background: var(--surface-alt); font-size: 13px; }
.diagram-td { display: none !important; max-width: 380px; }
@media (max-width: 1099px) {
  .diagram-lr { display: none !important; }
  .diagram-td { display: block !important; }
}
/* Wide screens: the left-right diagram spans the metadata column too, so its text stays legible */
@media (min-width: 1100px) {
  .case-body .diagram { margin-left: calc(-14rem - var(--space-14)); }
  .case:has(.diagram) .case-meta { position: static; }
}

/* Screenshots inside case studies */

.shot { margin: var(--space-6) 0 var(--space-8); }
.shot img { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; border: 1px solid var(--neutral-200); border-radius: var(--radius-md); }
.shot figcaption { margin-top: var(--space-2); text-align: center; font: 500 13px/1.5 var(--text); color: var(--muted-2); }

/* Skills page: groups laid out like the short experience list, tables with depth chips */

.skill-group { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--space-8); padding: var(--space-8) 0; border-top: 1px solid var(--neutral-200); }
.skill-group h2 { font-size: 20px; line-height: 1.3; margin: 2px 0 0; }
.skill-group > div > :last-child { margin-bottom: 0; }
.skills-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.skills-table th { font: 600 12px/1.4 var(--text); letter-spacing: 2px; text-transform: uppercase; color: var(--muted-2); text-align: left; padding: 0 var(--space-4) var(--space-2) 0; border-bottom: 1px solid var(--neutral-200); }
.skills-table td { padding: 10px var(--space-4) 10px 0; border-bottom: 1px solid var(--neutral-200); vertical-align: top; }
.skills-table th:last-child, .skills-table td:last-child { padding-right: 0; }
.skills-table td:first-child { width: 42%; color: var(--ink); }
.skills-table td:last-child { color: var(--muted); }
.chip { display: inline-block; font: 500 12px/1.4 var(--text); color: var(--muted); border: 1px solid var(--neutral-200); border-radius: var(--radius-sm); padding: 2px 8px; white-space: nowrap; }
@media (max-width: 720px) {
  .skill-group { grid-template-columns: 1fr; gap: var(--space-4); }
  .skills-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .skills-table, .skills-table tbody, .skills-table tr, .skills-table td { display: block; width: auto !important; }
  .skills-table tr { padding: var(--space-4) 0; border-bottom: 1px solid var(--neutral-200); }
  .skills-table tr:first-child { padding-top: 0; }
  .skills-table td { border: 0; padding: 0; }
  .skills-table td + td { margin-top: 6px; }
  .chip { white-space: normal; }
}
