/* ==========================================================================
   About Section (Home)
   ========================================================================== */

.about-section {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.about-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  flex: 1;
}

.about-photo {
  flex: 1;
  aspect-ratio: var(--photo-aspect);
  border-radius: 4px;
  overflow: hidden;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--photo-focus);
  border-radius: 4px;
}

@media (max-width: 1199px) {
  .about-section {
    flex-direction: column;
  }

  /* Stacked, the main axis becomes vertical, so `flex: 1` would set
     flex-basis on the *height* and silently override aspect-ratio — exactly
     how it used to override the old `height: 280px`. */
  .about-photo {
    flex: none;
    width: 100%;
  }

  .note-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ==========================================================================
   Career Section (Home)
   ========================================================================== */

.career-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ==========================================================================
   Page Header (shared by Notes + Work)
   ========================================================================== */

.page-header h1 {
  margin-bottom: 8px;
}

.page-header h5 {
  margin-bottom: 8px;
}

/* ==========================================================================
   Work List
   ========================================================================== */

.work-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ==========================================================================
   Notes List + Tags
   ========================================================================== */

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.note-item {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.note-link {
  min-width: 0;
}
.note-link p {
  color: var(--text-dark-active);
  transition: color var(--transition);
}
.note-link:hover p {
  color: var(--linen);
}

.note-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
.note-tag {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.286;
  color: var(--linen);
}

@media (max-width: 809px) {
  .note-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .note-tags {
    flex-direction: column;
    align-items: flex-start;
    white-space: normal;
  }
}

/* ==========================================================================
   Note Detail
   ========================================================================== */

.note-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-meta {
  color: var(--linen);
}

.note-body p + p,
.note-body p + h6 {
  margin-top: 24px;
}

/* ==========================================================================
   Login page
   ========================================================================== */

.login-container {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px var(--container-pad);
}

/* The site's card shell, so the gate reads as part of the site rather than a
   detour. Deliberately not the full .nav-bar — this page has one job, and a
   full nav invites wandering away from it. */
.login-card {
  width: 100%;
  max-width: 720px;
  align-self: flex-start;
  margin-top: 10vh;
  background-color: var(--bg-light);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-small);
  padding: 28px 36px 40px;
  display: flex;
  flex-direction: column;
}

.login-topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 44px;
}

/* Follows the site's link behaviour: no underline at rest, underline on hover.
   Sized down from the site header — this is orientation, not navigation. */
.login-wordmark,
.login-back {
  font-family: var(--font-mono);
  text-decoration: none;
  color: var(--text-dark-active);
  transition: color var(--transition);
}

.login-wordmark:hover,
.login-back:hover,
.login-contact a:hover {
  color: var(--linen);
  text-decoration: underline;
}

.login-wordmark {
  font-size: 16px;
}

.login-back {
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

.login-contact a {
  text-decoration: none;
  color: var(--text-dark-active);
  transition: color var(--transition);
}

.login-lede {
  max-width: 20ch;
  margin: 0 0 16px;
}

.login-body {
  color: #555;
  max-width: 52ch;
  margin: 0 0 28px;
}

.login-form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form input[type="password"] {
  font-family: var(--font-sans);
  font-size: var(--text-regular);
  border-radius: var(--radius-control);
}

.login-error {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.286;
  color: var(--red);
  background-color: color-mix(in srgb, var(--red) 8%, white);
  padding: 12px;
  border-radius: var(--radius-control);
}

.login-button-dark {
  background-color: var(--bg-dark);
  color: var(--text-light);
  border-radius: var(--radius-control);
  font-family: var(--font-sans);
}

.login-button-dark:hover:not(:disabled) {
  background-color: color-mix(in srgb, var(--bg-dark), white 25%);
}

.login-form .login-button-dark:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Contact — the way in, for someone who doesn't have the password yet. */
.login-contact {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dark-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Login — mobile overrides (MUST be after base login styles) */
@media (max-width: 768px) {
  .login-card {
    margin-top: 4vh;
    padding: 22px 20px 32px;
  }

  .login-topbar {
    margin-bottom: 28px;
    gap: 10px;
  }

  .login-wordmark {
    font-size: 14px;
  }

  .login-back {
    font-size: 13px;
  }

  .login-form .login-button-dark {
    width: 100%;
  }
}

/* ==========================================================================
   Case Study — Article scaffold
   ========================================================================== */

.cs-article {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.cs-section {
  padding: 40px 0;
}

.cs-contained {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   Case Study — Hero
   ========================================================================== */

.cs-hero {
  padding: 40px 0 32px;
}

.cs-hero .cs-contained {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  padding-left: 0;
  padding-right: 0;
}

.cs-hero .label-group {
  justify-content: center;
}

.cs-hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.cs-hero .stat-card {
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 12px 0;
}

/* ==========================================================================
   Case Study — Text Section
   ========================================================================== */

.cs-text .cs-contained {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-left: 0;
  padding-right: 0;
}

.cs-text-tag {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.286;
  font-weight: 700;
  color: var(--text-dark-muted);
}

.cs-text-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-text-body > * + * {
  margin-top: 16px;
}

/* ==========================================================================
   Case Study — Image Section
   ========================================================================== */

.cs-image .cs-contained {
  padding-left: 0;
  padding-right: 0;
}

.cs-image figure {
  margin: 0;
}

.cs-image img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.cs-image figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-dark-muted);
  text-align: center;
}

/* ==========================================================================
   Case Study — Callout Section
   ========================================================================== */

.cs-callout .cs-contained {
  padding-left: 0;
  padding-right: 0;
}

.cs-callout .label-mono {
  margin-bottom: 12px;
}

.cs-callout-box {
  padding: 24px;
  border-radius: 4px;
}

.cs-callout-content > * + * {
  margin-top: 12px;
}

/* ==========================================================================
   Case Study — Cards / Stats Grid
   ========================================================================== */

.cs-stats .cs-contained {
  padding-left: 0;
  padding-right: 0;
}

.cs-cards .label-mono,
.cs-stats .label-mono {
  margin-bottom: 12px;
}

.cs-cards-grid,
.cs-stats-grid {
  display: grid;
  gap: 16px;
}

.cs-cards-col-2 {
  grid-template-columns: repeat(2, 1fr);
}
.cs-cards-col-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ==========================================================================
   Case Study — Quote Section
   ========================================================================== */

.cs-quote .cs-contained {
  padding-left: 0;
  padding-right: 0;
}

.cs-quote-block {
  border-left: 3px solid var(--linen);
  padding-left: 24px;
}

.cs-quote-block p {
  font-size: 24px;
  font-style: italic;
  line-height: 1.5;
}

.cs-quote-block cite {
  display: block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-style: normal;
  color: var(--text-dark-muted);
}

/* ==========================================================================
   Case Study — Banner (full-bleed)
   ========================================================================== */

.cs-banner {
  padding: 48px 0;
}

.cs-banner-text {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.5;
}

/* ==========================================================================
   Case Study — Two-Column Layout
   ========================================================================== */

.cs-twocol .cs-contained {
  padding-left: 0;
  padding-right: 0;
}

.cs-twocol .label-mono {
  margin-bottom: 12px;
}

.cs-twocol-grid {
  display: grid;
  gap: 24px;
}

.cs-twocol-1-1 {
  grid-template-columns: 1fr 1fr;
}

.cs-twocol-2-1 {
  grid-template-columns: 2fr 1fr;
}

.cs-twocol-1-2 {
  grid-template-columns: 1fr 2fr;
}

.cs-twocol-left > * + *,
.cs-twocol-right > * + * {
  margin-top: 16px;
}

/* ==========================================================================
   Case Study — Image Grid
   ========================================================================== */

.cs-imagegrid .cs-contained {
  padding-left: 0;
  padding-right: 0;
}

.cs-imagegrid .label-mono {
  margin-bottom: 12px;
}

.cs-imagegrid-grid {
  display: grid;
  gap: 16px;
}

.cs-imagegrid-col-2 {
  grid-template-columns: repeat(2, 1fr);
}

.cs-imagegrid-col-3 {
  grid-template-columns: repeat(3, 1fr);
}

.cs-imagegrid-item {
  margin: 0;
}

.cs-imagegrid-item img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.cs-imagegrid-item figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-dark-muted);
  text-align: center;
}

/* ==========================================================================
   Case Study — Video Embed
   ========================================================================== */

.cs-video .cs-contained {
  padding-left: 0;
  padding-right: 0;
}

.cs-video .label-mono {
  margin-bottom: 12px;
}

.cs-video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 4px;
}

.cs-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.cs-video-caption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-dark-muted);
  text-align: center;
}

/* ==========================================================================
   Case Study — Responsive overrides (MUST be after base styles)
   ========================================================================== */

/* Mobile: 390–809px */
@media (max-width: 809px) {
  .cs-section {
    padding: 24px 0;
  }

  .cs-hero {
    padding: 24px 0 16px;
  }

  .cs-hero-stats {
    grid-template-columns: 1fr;
  }

  .cs-cards-col-2,
  .cs-cards-col-3 {
    grid-template-columns: 1fr;
  }

  .cs-quote-block p {
    font-size: 20px;
  }

  .cs-banner {
    padding: 32px 0;
  }

  .cs-banner-text {
    font-size: 24px;
  }

  .cs-twocol-1-1,
  .cs-twocol-2-1,
  .cs-twocol-1-2 {
    grid-template-columns: 1fr;
  }

  .cs-imagegrid-col-2,
  .cs-imagegrid-col-3 {
    grid-template-columns: 1fr;
  }
}
