/* ------------------------------------------------------------------
   Shared base (admin pages inherit these; the public page overrides
   them under .public below).
   ------------------------------------------------------------------ */

:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1b2e3b;
  background: #f3f6f5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  padding: clamp(1.25rem, 5vw, 4rem);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 4rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

h2 {
  margin: 0 0 1.25rem;
  color: #263e4b;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

/* ------------------------------------------------------------------
   Public profile: "Classic resume, elevated"
   A resume typeset to book standard: white ground, ink text, hairline
   rules, hanging section heads, and one Oxford navy reserved for links
   and the contact action.
   ------------------------------------------------------------------ */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-wght-italic.woff2") format("woff2");
}

.public {
  --paper: #ffffff;
  --ink: #16202b;
  --slate: #4a5563;
  --hairline: #d9dde3;
  --separator: #8a93a0;
  --navy: #1f3a68;
  --navy-deep: #152a4d;
  --navy-wash: #eef2f8;
  --navy-line: #c9d3e3;
  --face-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --face-sans: "Source Sans 3", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --rail: 11rem;
  --column-gap: clamp(1.5rem, 4vw, 3rem);
  --section-space: clamp(2rem, 4.5vw, 3rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  padding: clamp(1.75rem, 6vw, 5rem) clamp(1rem, 5vw, 3rem) clamp(2rem, 5vw, 4rem);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--face-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  accent-color: var(--navy);
  scrollbar-color: #a4acb7 var(--paper);
}

.public ::selection {
  background: var(--navy);
  color: var(--paper);
}

.public :focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
  border-radius: 2px;
}

.public a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.public h1,
.public h2,
.public h3,
.public p {
  overflow-wrap: break-word;
}

.public .profile {
  width: min(100%, 60rem);
  margin: 0 auto;
}

/* ---------- Fallback notice ---------- */

.public .fallback-notice {
  margin: 0 0 2rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--navy-line);
  border-radius: 4px;
  background: var(--navy-wash);
  color: var(--ink);
  line-height: 1.5;
}

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

.public .profile-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "identity contact"
    "summary summary"
    "nav nav";
  column-gap: 2rem;
  padding-bottom: 0.5rem;
}

.public .identity {
  grid-area: identity;
}

.public h1 {
  margin: 0;
  font-family: var(--face-serif);
  font-size: clamp(2.5rem, 6.5vw, 3.75rem);
  font-weight: 600;
  font-optical-sizing: auto;
  letter-spacing: -0.015em;
  line-height: 1.05;
  text-wrap: balance;
}

.public .headline {
  max-width: 44ch;
  margin: 0.75rem 0 0;
  color: var(--slate);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.4;
  text-wrap: balance;
}

.public .header-contact {
  grid-area: contact;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  gap: 0.6rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

/* Contact actions: the first is the primary button, any others are outlined. */
.public .contact-action,
.public .contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.05rem;
  border: 1px solid var(--navy);
  border-radius: 4px;
  background: var(--paper);
  color: var(--navy);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.public .contact-action::after,
.public .contact-links a::after {
  content: "";
  width: 0.95em;
  height: 0.95em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 11.5 11.5 4.5M5.5 4.5h6v6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 11.5 11.5 4.5M5.5 4.5h6v6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.public .contact-action:hover,
.public .contact-links a:hover {
  background: var(--navy-wash);
}

.public .header-contact li:first-child .contact-action,
.public .contact-links li:first-child a {
  background: var(--navy);
  color: var(--paper);
}

.public .header-contact li:first-child .contact-action:hover,
.public .contact-links li:first-child a:hover {
  border-color: var(--navy-deep);
  background: var(--navy-deep);
  color: var(--paper);
}

.public .contact-action:active,
.public .contact-links a:active {
  transform: translateY(1px);
}

.public .summary {
  grid-area: summary;
  max-width: 62ch;
  margin: 1.75rem 0 0;
  font-family: var(--face-serif);
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  font-weight: 400;
  font-variant-numeric: oldstyle-nums proportional-nums;
  line-height: 1.6;
}

.public .page-nav {
  grid-area: nav;
  margin-top: 2rem;
}

.public .page-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.public .page-nav a {
  display: inline-block;
  padding: 0.35rem 0;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  color: var(--slate);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.public .page-nav a:hover {
  background-size: 100% 1px;
  color: var(--ink);
}

/* ---------- Sections: hanging heads in the left rail ---------- */

.public .profile-section {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  column-gap: var(--column-gap);
  padding: var(--section-space) 0;
  border-top: 1px solid var(--hairline);
}

.public h2 {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  margin: 0;
  color: var(--ink);
  font-family: var(--face-serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
}

.public .section-body {
  min-width: 0;
}

.public .entry {
  min-width: 0;
}

.public .entry + .entry {
  margin-top: 2rem;
}

.public .entry-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1.5rem;
}

.public h3 {
  margin: 0;
  font-family: var(--face-serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

.public h3 a {
  color: var(--ink);
  text-decoration-color: var(--navy-line);
}

.public h3 a:hover {
  color: var(--navy);
  text-decoration-color: currentColor;
}

.public .entry-subtitle {
  margin: 0.2rem 0 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.45;
}

.public .entry-location {
  color: var(--slate);
  font-weight: 400;
}

.public .entry-dates {
  flex: 0 0 auto;
  margin: 0;
  color: var(--slate);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.public .entry-description {
  max-width: 65ch;
  margin: 0.6rem 0 0;
  line-height: 1.6;
  white-space: pre-line;
}

/* Skills used on a line item: a quiet typed run, not chips. */
.public .used-list {
  display: flex;
  flex-wrap: wrap;
  margin: 0.6rem 0 0;
  padding: 0;
  color: var(--slate);
  font-size: 0.9375rem;
  list-style: none;
}

.public .used-list li:not(:last-child)::after {
  content: "·";
  padding: 0 0.5em;
  color: var(--separator);
}

.public .skill-list {
  columns: 3 11rem;
  column-gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.public .skill-list li {
  padding: 0.2rem 0;
  break-inside: avoid;
  line-height: 1.45;
}

/* ---------- Close ---------- */

.public .contact-lede {
  max-width: 52ch;
  margin: 0 0 1.25rem;
  font-family: var(--face-serif);
  font-size: 1.125rem;
}

.public .contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.public .empty-state {
  margin: 0;
  color: var(--slate);
  font-style: italic;
}

/* ---------- Privacy page: running text inside a section ---------- */

.public .prose {
  max-width: 65ch;
  line-height: 1.6;
}

.public .prose > :first-child {
  margin-top: 0;
}

.public .prose * + h3 {
  margin-top: 2rem;
}

.public .prose ul {
  padding-left: 1.25rem;
}

.public .prose li + li {
  margin-top: 0.4rem;
}

.public .page-foot {
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
}

.public .page-foot p {
  margin: 0;
  color: var(--slate);
  font-size: 0.875rem;
}

.public .link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

/* ---------- Analytics consent: a quiet sheet pinned to the bottom ---------- */

.public .consent-banner {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 10;
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.1rem 1.25rem 1.25rem;
  border: 1px solid var(--navy-line);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 6px 24px rgb(22 32 43 / 0.12);
}

.public .link-button[hidden],
.public .consent-banner[hidden] {
  display: none;
}

.public .consent-banner h2 {
  position: static;
  font-size: 1.1rem;
}

.public .consent-banner p {
  margin: 0.4rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.public .consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

/* Accept and Decline carry equal weight so neither choice is nudged. */
.public .consent-actions button {
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--navy);
  border-radius: 4px;
  background: var(--paper);
  color: var(--navy);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.public .consent-actions button:hover {
  background: var(--navy-wash);
}

.public .consent-actions button:active {
  transform: translateY(1px);
}

@media (prefers-reduced-motion: no-preference) {
  .public .page-nav a {
    transition:
      background-size 260ms var(--ease-out),
      color 160ms var(--ease-out);
  }

  .public .contact-action,
  .public .contact-links a,
  .public h3 a {
    transition:
      background-color 160ms var(--ease-out),
      border-color 160ms var(--ease-out),
      color 160ms var(--ease-out),
      text-decoration-color 160ms var(--ease-out),
      transform 120ms var(--ease-out);
  }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 48rem) {
  .public .profile-header {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "identity"
      "contact"
      "summary"
      "nav";
  }

  .public .headline {
    font-size: 1.125rem;
  }

  .public .header-contact {
    justify-content: flex-start;
    margin-top: 1.25rem;
  }

  .public .profile-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .public h2 {
    position: static;
    margin-bottom: 1.25rem;
    font-size: 1.625rem;
    line-height: 1.15;
  }

  .public .page-nav ul {
    column-gap: 1rem;
  }

  .public .entry-heading {
    flex-direction: column;
  }

  .public .skill-list {
    columns: 2 9rem;
    column-gap: 1.25rem;
  }
}

/* ---------- Print: the same resume on paper ---------- */

@media print {
  .public {
    padding: 0;
    color: #000;
    font-size: 10.5pt;
  }

  .public .profile {
    width: 100%;
  }

  .public .profile-header {
    padding-bottom: 12pt;
  }

  .public h1 {
    font-size: 26pt;
  }

  .public .summary {
    margin-top: 10pt;
    font-size: 11pt;
  }

  .public .page-nav,
  .public .contact-section,
  .public .page-foot,
  .public .consent-banner {
    display: none;
  }

  .public .profile-section {
    grid-template-columns: 7.5rem minmax(0, 1fr);
    padding: 12pt 0;
    border-top-color: #999;
  }

  .public h2 {
    position: static;
    font-size: 12pt;
  }

  .public h3 {
    font-size: 11.5pt;
  }

  .public .entry {
    break-inside: avoid;
  }

  .public .entry + .entry {
    margin-top: 9pt;
  }

  .public .contact-action {
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #000;
  }

  .public .header-contact li:first-child .contact-action {
    background: none;
    color: #000;
  }

  .public .contact-action::after {
    content: " " attr(href);
    width: auto;
    height: auto;
    background: none;
    -webkit-mask: none;
    mask: none;
    font-weight: 400;
  }
}

/* ------------------------------------------------------------------
   Admin pages
   ------------------------------------------------------------------ */

.admin {
  width: min(100%, 48rem);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px solid #dce5e2;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1.5rem 4rem rgb(27 46 59 / 7%);
}

.admin-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-nav form,
.admin-list form {
  margin: 0;
}

.admin-nav a,
.admin-list a,
.admin-link {
  color: #155e55;
  font-weight: 650;
  text-underline-offset: 0.2em;
}

.admin-section {
  padding: 1.25rem 0;
  border-top: 1px solid #e5ece9;
}

.admin-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid #e5ece9;
  border-radius: 0.5rem;
}

.admin-list li > div {
  display: grid;
  gap: 0.25rem;
}

.admin-list span {
  color: #536b78;
  font-size: 0.9rem;
}

.admin-form {
  display: grid;
  gap: 0.55rem;
}

.admin-form label {
  margin-top: 0.65rem;
  color: #263e4b;
  font-weight: 650;
}

.admin-form input,
.admin-form textarea,
.admin input[type="password"] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid #aebfbc;
  border-radius: 0.4rem;
  color: #1b2e3b;
  font: inherit;
}

.admin-form textarea {
  min-height: 8rem;
  resize: vertical;
}

.admin-form .admin-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
}

.admin-form .admin-checkbox input {
  width: auto;
}

.admin button {
  width: fit-content;
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 0.4rem;
  background: #155e55;
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.admin .text-button {
  margin: 0;
  padding: 0;
  background: transparent;
  color: #155e55;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.admin .danger-button {
  background: #8d3030;
}

.admin-error {
  padding: 0.8rem 1rem;
  border-left: 0.25rem solid #a33737;
  border-radius: 0.25rem;
  background: #fff0f0;
  color: #6f2020;
}


@media (max-width: 40rem) {
  body {
    padding: 0.75rem;
  }

  .admin-list li {
    align-items: flex-start;
    flex-direction: column;
  }
}
