/* Chris Cronan — personal site
   Palette taken from LeadershipBits public X banners:
   deep navy #010717 and gold #C9A227.
   Display type: Cormorant Garamond. Body: system sans-serif.
*/

:root {
  --navy: #010717;
  --navy-ink: #121826;
  --gold: #c9a227;
  --gold-soft: #f3ead0;
  --cream: #f7f5f0;
  --paper: #ffffff;
  --muted: #5a616c;
  --line: #e4dfd4;
  --danger: #8a2a2a;
  --header-h: 4.25rem;
  --max: 70rem;
  --measure: 38rem;
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 1px 2px rgba(1, 7, 23, 0.04);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.75rem);
}

html:focus-within {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html,
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--navy-ink);
  background: var(--cream);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--navy);
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--navy);
  text-decoration-thickness: 2px;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--navy);
  color: var(--cream);
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

.container.narrow,
.narrow {
  width: min(100% - 2.5rem, var(--measure));
  margin-inline: auto;
}

.section-intro {
  max-width: var(--measure);
  margin: 0 0 2.5rem;
}

/* Header
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--navy);
  text-decoration: none;
  line-height: 1;
}

.wordmark:hover {
  color: var(--navy);
  text-decoration: none;
}

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

.site-nav a {
  color: var(--navy-ink);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.site-nav a:hover {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
}

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: var(--navy);
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.25rem;
  height: 1.5px;
  background: currentColor;
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Hero
   ============================================================ */

.hero {
  padding: clamp(4.5rem, 12vw, 8.5rem) 0 clamp(4.75rem, 12vw, 8.75rem);
}

.hero-inner {
  width: min(100% - 2.5rem, 46rem);
  margin-inline: auto;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.75rem, 9vw, 5.25rem);
  line-height: 1.02;
  text-wrap: balance;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin: 0 0 1.25rem;
}

.hero-line {
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--navy-ink);
  margin: 0 0 2.25rem;
  position: relative;
}

.hero-line::before {
  content: "";
  display: block;
  width: 3rem;
  height: 2px;
  background: var(--gold);
  margin-bottom: 1.35rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero-kicker {
  margin-bottom: 1rem;
}

/* Sections
   ============================================================ */

.section {
  padding: clamp(3.75rem, 8vw, 6.25rem) 0;
}

.section-alt {
  background: var(--paper);
}

.kicker {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8a7016;
}

h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.15rem, 4vw, 2.85rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0 0 1.5rem;
}

h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--navy);
  margin: 0.6rem 0 0.5rem;
}

.prose p {
  margin: 0 0 1.1rem;
  color: var(--navy-ink);
}

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

.section-cta {
  margin: 1.75rem 0 0;
}

.prose p.lead {
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 3vw, 1.75rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--navy);
}

/* Principles list (About)
   ============================================================ */

.principles-title {
  margin: 2.25rem 0 0.9rem;
}

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

.principles li {
  padding-left: 1rem;
  border-left: 2px solid var(--gold);
}

.principles strong {
  display: block;
  color: var(--navy);
}

/* Book working title
   ============================================================ */

.book-working-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 0.85rem;
  margin: 1.25rem 0 1.1rem;
}

.book-working-title cite {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  line-height: 1.3;
  color: var(--navy);
}

/* Badges and placeholders
   ============================================================ */

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--navy);
  background: var(--gold-soft);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}

.placeholder-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem 0.75rem;
  color: var(--muted);
  font-size: 1rem;
}

/* Cards
   ============================================================ */

.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.card {
  background: var(--cream);
  border: 1px solid var(--line);
  padding: 1.5rem 1.4rem 1.6rem;
  box-shadow: var(--shadow);
  min-height: 12rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

/* Forms
   ============================================================ */

.form {
  position: relative;
  margin-top: 2rem;
  display: grid;
  gap: 1.1rem;
}

.form-row {
  display: grid;
  gap: 0.4rem;
}

.form-row label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
}

.form input,
.form textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid #cfc9bb;
  background: var(--paper);
  color: var(--navy-ink);
  font: inherit;
  border-radius: 2px;
}

.form input:hover,
.form textarea:hover {
  border-color: #a8a193;
}

.form input:focus-visible,
.form textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--navy);
}

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

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin: 0;
  min-height: 1.4em;
  font-size: 1rem;
}

.form-status.is-success {
  color: var(--navy-ink);
}

.form-status.is-error {
  color: var(--danger);
}

/* Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.55rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy);
}

.btn-primary:hover {
  background: #162033;
  color: var(--cream);
  border-color: #162033;
}

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--gold);
}

.btn-secondary:hover {
  background: var(--gold-soft);
  color: var(--navy);
}

button.btn {
  appearance: none;
  width: fit-content;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Footer
   ============================================================ */

.site-footer {
  background: var(--navy);
  color: #d8d4cb;
  padding: 2.25rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.footer-mark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--cream);
}

.footer-compass {
  color: var(--gold);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: #d8d4cb;
  text-decoration-color: var(--gold);
}

.footer-links a:hover {
  color: var(--cream);
}

/* 404
   ============================================================ */

.page-404 {
  min-height: calc(100vh - var(--header-h) - 6.5rem);
  display: flex;
  align-items: center;
}

.page-404 h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 1rem;
  color: var(--navy);
}

/* Responsive
   ============================================================ */

@media (max-width: 860px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 2;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1.25rem;
    box-shadow: 0 10px 18px rgba(1, 7, 23, 0.06);
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .site-nav a {
    display: block;
    padding: 0.7rem 0;
    font-size: 1.05rem;
  }

  .container,
  .container.narrow,
  .narrow,
  .hero-inner,
  .header-inner {
    width: min(100% - 1.75rem, var(--max));
  }
}

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

  .hero-actions,
  .section-cta .btn {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
  }
}

/* Portfolio media
   ============================================================ */

.card > * + p {
  margin-top: 0.75rem;
}

.card-media {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin: 0.9rem 0 0.4rem;
}

.card-media figure {
  margin: 0;
}

.card-media img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--paper);
}

.card-media .media-thumb {
  width: 55%;
}

.media-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  margin: 0.9rem 0 0.4rem;
  border: 1px dashed #b9b2a3;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5rem;
}

.card-figure {
  margin: 0.9rem 0 0.4rem;
}

.card-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
  border: 1px solid var(--line);
}

.card-figure figcaption {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.card p.card-cite {
  font-size: 0.85rem;
  line-height: 1.5;
}

.card-cite a {
  color: var(--muted);
}
