/* =========================================================================
   Shamim Akhtar 2026 - Design System
   Light-first Indigo + Amber. Every colour is a token; dark mode only
   redefines the tokens, never the components.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. TOKENS - LIGHT (the default)
   ------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --sa-bg:              #FBFAF7;
  --sa-surface:         #FFFFFF;
  --sa-surface-2:       #F4F2EC;
  --sa-surface-3:       #EBE8E0;

  /* Text */
  --sa-text:            #14161C;
  --sa-text-muted:      #545A69;
  --sa-text-subtle:     #767D8E;
  --sa-text-inverse:    #FFFFFF;

  /* Lines */
  --sa-border:          #E4E1D8;
  --sa-border-strong:   #CDC8BB;

  /* Indigo - primary */
  --sa-primary:         #3A45A8;
  --sa-primary-hover:   #2C3689;
  --sa-primary-active:  #232C73;
  --sa-primary-soft:    #EDEEF9;
  --sa-primary-contrast:#FFFFFF;

  /* Amber - accent. The -text variant is the AA-safe one for type on light ground. */
  --sa-accent:          #D98416;
  --sa-accent-text:     #9A5B06;
  --sa-accent-hover:    #B96C0C;
  --sa-accent-soft:     #FCF1E0;
  --sa-accent-contrast: #1B1200;

  /* Feedback */
  --sa-success:         #1C7A4C;
  --sa-success-soft:    #E6F4EC;
  --sa-warning:         #A66A00;
  --sa-danger:          #B3261E;

  /* Elevation */
  --sa-shadow-sm:  0 1px 2px rgba(20, 22, 28, .06), 0 1px 3px rgba(20, 22, 28, .05);
  --sa-shadow-md:  0 4px 10px rgba(20, 22, 28, .07), 0 2px 4px rgba(20, 22, 28, .05);
  --sa-shadow-lg:  0 14px 34px rgba(20, 22, 28, .10), 0 4px 10px rgba(20, 22, 28, .05);

  /* Decorative gradient - indigo into amber, the two brand poles */
  --sa-gradient: linear-gradient(120deg, var(--sa-primary) 0%, #6A57B8 48%, var(--sa-accent) 100%);

  /* Type */
  --sa-font-display: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sa-font-body:    "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sa-font-mono:    "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Consolas, monospace;

  /* Fluid type scale */
  --sa-fs-xs:   0.78rem;
  --sa-fs-sm:   0.875rem;
  --sa-fs-base: 1.0625rem;
  --sa-fs-lg:   clamp(1.125rem, 0.5vw + 1rem, 1.25rem);
  --sa-fs-xl:   clamp(1.35rem, 1vw + 1.1rem, 1.6rem);
  --sa-fs-2xl:  clamp(1.65rem, 1.6vw + 1.2rem, 2.15rem);
  --sa-fs-3xl:  clamp(2rem, 2.6vw + 1.3rem, 2.9rem);
  --sa-fs-4xl:  clamp(2.4rem, 4.2vw + 1.3rem, 4rem);

  /* Space */
  --sa-space-1: .25rem;  --sa-space-2: .5rem;   --sa-space-3: .75rem;
  --sa-space-4: 1rem;    --sa-space-5: 1.5rem;  --sa-space-6: 2rem;
  --sa-space-7: 3rem;    --sa-space-8: 4rem;    --sa-space-9: 6rem;

  /* Shape */
  --sa-radius-sm: 6px;
  --sa-radius:    10px;
  --sa-radius-lg: 16px;
  --sa-radius-xl: 24px;
  --sa-radius-pill: 999px;

  /* Motion */
  --sa-ease: cubic-bezier(.22, .61, .36, 1);
  --sa-dur:  180ms;

  /* Layout */
  --sa-content: 720px;
  --sa-wide:    1180px;

  color-scheme: light;
}

/* -------------------------------------------------------------------------
   2. TOKENS - DARK
   Applied by explicit choice (data-theme) or by system preference when the
   visitor has not chosen. Components below never change.
   ------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sa-bg:              #12141A;
    --sa-surface:         #1B1E27;
    --sa-surface-2:       #232733;
    --sa-surface-3:       #2C3140;

    --sa-text:            #ECEDF2;
    --sa-text-muted:      #A3A9B9;
    --sa-text-subtle:     #7F8697;
    --sa-text-inverse:    #12141A;

    --sa-border:          #2B303C;
    --sa-border-strong:   #3B4252;

    --sa-primary:         #8B93E8;
    --sa-primary-hover:   #A6ACF0;
    --sa-primary-active:  #BCC1F5;
    --sa-primary-soft:    #1E2233;
    --sa-primary-contrast:#12141A;

    --sa-accent:          #F0A93C;
    --sa-accent-text:     #F0A93C;
    --sa-accent-hover:    #F6BE63;
    --sa-accent-soft:     #2A2117;
    --sa-accent-contrast: #12141A;

    --sa-success:         #5CC48D;
    --sa-success-soft:    #16261D;
    --sa-warning:         #E0A33C;
    --sa-danger:          #F0837B;

    --sa-shadow-sm:  0 1px 2px rgba(0, 0, 0, .5);
    --sa-shadow-md:  0 4px 12px rgba(0, 0, 0, .55);
    --sa-shadow-lg:  0 16px 40px rgba(0, 0, 0, .6);

    --sa-gradient: linear-gradient(120deg, var(--sa-primary) 0%, #A98BE0 48%, var(--sa-accent) 100%);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --sa-bg:              #12141A;
  --sa-surface:         #1B1E27;
  --sa-surface-2:       #232733;
  --sa-surface-3:       #2C3140;

  --sa-text:            #ECEDF2;
  --sa-text-muted:      #A3A9B9;
  --sa-text-subtle:     #7F8697;
  --sa-text-inverse:    #12141A;

  --sa-border:          #2B303C;
  --sa-border-strong:   #3B4252;

  --sa-primary:         #8B93E8;
  --sa-primary-hover:   #A6ACF0;
  --sa-primary-active:  #BCC1F5;
  --sa-primary-soft:    #1E2233;
  --sa-primary-contrast:#12141A;

  --sa-accent:          #F0A93C;
  --sa-accent-text:     #F0A93C;
  --sa-accent-hover:    #F6BE63;
  --sa-accent-soft:     #2A2117;
  --sa-accent-contrast: #12141A;

  --sa-success:         #5CC48D;
  --sa-success-soft:    #16261D;
  --sa-warning:         #E0A33C;
  --sa-danger:          #F0837B;

  --sa-shadow-sm:  0 1px 2px rgba(0, 0, 0, .5);
  --sa-shadow-md:  0 4px 12px rgba(0, 0, 0, .55);
  --sa-shadow-lg:  0 16px 40px rgba(0, 0, 0, .6);

  --sa-gradient: linear-gradient(120deg, var(--sa-primary) 0%, #A98BE0 48%, var(--sa-accent) 100%);

  color-scheme: dark;
}

/* Explicit light wins over a dark system preference. */
:root[data-theme="light"] { color-scheme: light; }

/* -------------------------------------------------------------------------
   3. BASE
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  /* `clip` rather than `hidden`: it contains stray horizontal overflow from
     migrated content without breaking the sticky header. */
  overflow-x: clip;
  max-width: 100vw;
  background-color: var(--sa-bg);
  color: var(--sa-text);
  font-family: var(--sa-font-body);
  font-size: var(--sa-fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--sa-dur) var(--sa-ease), color var(--sa-dur) var(--sa-ease);
}

/* Suppress transitions during a theme switch so the flip is instant. */
html.sa-theme-switching *,
html.sa-theme-switching *::before,
html.sa-theme-switching *::after {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--sa-font-display);
  color: var(--sa-text);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 var(--sa-space-4);
  text-wrap: balance;
}
h1 { font-size: var(--sa-fs-4xl); font-weight: 700; letter-spacing: -0.033em; }
h2 { font-size: var(--sa-fs-3xl); font-weight: 700; }
h3 { font-size: var(--sa-fs-2xl); font-weight: 600; }
h4 { font-size: var(--sa-fs-xl);  font-weight: 600; }
h5 { font-size: var(--sa-fs-lg);  font-weight: 600; }
h6 {
  font-size: var(--sa-fs-sm); font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--sa-text-muted); font-family: var(--sa-font-mono);
}

p { margin: 0 0 var(--sa-space-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--sa-primary);
  text-decoration-color: color-mix(in srgb, var(--sa-primary) 35%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color var(--sa-dur) var(--sa-ease), text-decoration-color var(--sa-dur) var(--sa-ease);
}
a:hover { color: var(--sa-primary-hover); text-decoration-color: currentColor; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--sa-primary);
  outline-offset: 2px;
  border-radius: var(--sa-radius-sm);
}

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

hr {
  border: 0;
  height: 1px;
  background: var(--sa-border);
  margin: var(--sa-space-7) 0;
}

::selection { background: var(--sa-primary); color: var(--sa-primary-contrast); }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* Long-form typography */
blockquote {
  margin: var(--sa-space-6) 0;
  padding: var(--sa-space-4) var(--sa-space-5);
  border-left: 3px solid var(--sa-accent);
  background: var(--sa-accent-soft);
  border-radius: 0 var(--sa-radius) var(--sa-radius) 0;
  color: var(--sa-text);
  font-size: var(--sa-fs-lg);
}
blockquote cite {
  display: block; margin-top: var(--sa-space-3);
  font-size: var(--sa-fs-sm); color: var(--sa-text-muted); font-style: normal;
}

code, kbd, samp {
  font-family: var(--sa-font-mono);
  font-size: .9em;
  background: var(--sa-surface-2);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius-sm);
  padding: .12em .38em;
}
pre {
  background: var(--sa-surface-2);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius);
  padding: var(--sa-space-4);
  overflow-x: auto;
  font-size: var(--sa-fs-sm);
  line-height: 1.6;
}
pre code { background: none; border: 0; padding: 0; }

ul, ol { padding-left: 1.35em; margin: 0 0 var(--sa-space-4); }
li { margin-bottom: var(--sa-space-2); }
li::marker { color: var(--sa-accent-text); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sa-space-5) 0;
  font-size: var(--sa-fs-sm);
}
th, td { padding: var(--sa-space-3); border-bottom: 1px solid var(--sa-border); text-align: left; }
th { font-weight: 600; background: var(--sa-surface-2); font-family: var(--sa-font-display); }
.sa-table-scroll { overflow-x: auto; }

/* -------------------------------------------------------------------------
   4. LAYOUT
   ------------------------------------------------------------------------- */
.sa-container { width: 100%; max-width: var(--sa-wide); margin-inline: auto; padding-inline: var(--sa-space-5); }
.sa-container--narrow { max-width: var(--sa-content); }
.sa-section { padding-block: var(--sa-space-9); }
.sa-section--tight { padding-block: var(--sa-space-7); }
.sa-stack > * + * { margin-top: var(--sa-space-4); }

.site-main { background: var(--sa-bg); }

.sa-section-head { margin-bottom: var(--sa-space-6); }
.sa-section-head p { color: var(--sa-text-muted); max-width: 62ch; }

/* -------------------------------------------------------------------------
   5. HEADER + NAVIGATION
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--sa-bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--sa-border);
  padding-block: var(--sa-space-3);
  transition: background-color var(--sa-dur) var(--sa-ease), border-color var(--sa-dur) var(--sa-ease);
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: var(--sa-bg); }
}

.site-header .site-title,
.site-header .site-branding .site-title {
  font-family: var(--sa-font-display);
  font-size: var(--sa-fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.site-header .site-title a { color: var(--sa-text); text-decoration: none; }
.site-header .site-title a:hover { color: var(--sa-primary); }
.site-header .site-description { color: var(--sa-text-muted); font-size: var(--sa-fs-sm); margin: 0; }

.site-navigation ul,
.site-header nav ul {
  display: flex;
  align-items: center;
  gap: var(--sa-space-2);
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-navigation li, .site-header nav li { margin: 0; }

.site-navigation a,
.site-header nav a {
  position: relative;
  display: inline-block;
  padding: var(--sa-space-2) var(--sa-space-3);
  color: var(--sa-text-muted);
  font-size: var(--sa-fs-sm);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--sa-radius-sm);
  transition: color var(--sa-dur) var(--sa-ease), background-color var(--sa-dur) var(--sa-ease);
}
.site-navigation a:hover,
.site-header nav a:hover { color: var(--sa-text); background: var(--sa-surface-2); }

.site-navigation .current-menu-item > a,
.site-navigation .current_page_item > a,
.site-header nav .current-menu-item > a {
  color: var(--sa-primary);
  font-weight: 600;
}
.site-navigation .current-menu-item > a::after,
.site-navigation .current_page_item > a::after {
  content: "";
  position: absolute;
  left: var(--sa-space-3);
  right: var(--sa-space-3);
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--sa-accent);
}

/* -------------------------------------------------------------------------
   6. THEME TOGGLE
   ------------------------------------------------------------------------- */
.sa-toggle-item { display: flex; align-items: center; margin-left: var(--sa-space-2) !important; }

.sa-theme-toggle {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 0;
  padding: var(--sa-space-1);
  cursor: pointer;
  line-height: 0;
}

.sa-theme-toggle__track {
  position: relative;
  display: block;
  width: 52px;
  height: 28px;
  border-radius: var(--sa-radius-pill);
  background: var(--sa-surface-2);
  border: 1px solid var(--sa-border-strong);
  transition: background-color var(--sa-dur) var(--sa-ease), border-color var(--sa-dur) var(--sa-ease);
}
.sa-theme-toggle:hover .sa-theme-toggle__track { border-color: var(--sa-primary); }

.sa-theme-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sa-surface);
  color: var(--sa-accent-text);
  box-shadow: var(--sa-shadow-sm);
  transition: transform 220ms var(--sa-ease), background-color var(--sa-dur) var(--sa-ease), color var(--sa-dur) var(--sa-ease);
}
.sa-theme-toggle__thumb svg { grid-area: 1 / 1; transition: opacity 140ms var(--sa-ease), transform 220ms var(--sa-ease); }

.sa-icon-moon { opacity: 0; transform: rotate(-70deg) scale(.6); }
.sa-icon-sun  { opacity: 1; transform: rotate(0deg) scale(1); }

html[data-theme="dark"] .sa-theme-toggle__thumb { transform: translateX(24px); color: var(--sa-primary); }
html[data-theme="dark"] .sa-icon-sun  { opacity: 0; transform: rotate(70deg) scale(.6); }
html[data-theme="dark"] .sa-icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .sa-theme-toggle__thumb { transform: translateX(24px); color: var(--sa-primary); }
  html:not([data-theme="light"]) .sa-icon-sun  { opacity: 0; transform: rotate(70deg) scale(.6); }
  html:not([data-theme="light"]) .sa-icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }
}

/* Floating fallback when the header has no menu to attach to. */
.sa-theme-toggle--floating {
  position: fixed;
  right: var(--sa-space-5);
  bottom: var(--sa-space-5);
  z-index: 999;
  padding: var(--sa-space-2);
  background: var(--sa-surface);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius-pill);
  box-shadow: var(--sa-shadow-md);
}

/* -------------------------------------------------------------------------
   7. BUTTONS
   ------------------------------------------------------------------------- */
.sa-btn,
.wp-block-button__link,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sa-space-2);
  padding: .7rem 1.35rem;
  font-family: var(--sa-font-body);
  font-size: var(--sa-fs-sm);
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--sa-radius);
  border: 1px solid transparent;
  background: var(--sa-primary);
  color: var(--sa-primary-contrast);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--sa-dur) var(--sa-ease), transform var(--sa-dur) var(--sa-ease), box-shadow var(--sa-dur) var(--sa-ease);
}
.sa-btn:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover {
  background: var(--sa-primary-hover);
  color: var(--sa-primary-contrast);
  transform: translateY(-1px);
  box-shadow: var(--sa-shadow-md);
}
.sa-btn:active { transform: translateY(0); }

.sa-btn--accent { background: var(--sa-accent); color: var(--sa-accent-contrast); }
.sa-btn--accent:hover { background: var(--sa-accent-hover); color: var(--sa-accent-contrast); }

.sa-btn--ghost {
  background: transparent;
  color: var(--sa-text);
  border-color: var(--sa-border-strong);
}
.sa-btn--ghost:hover { background: var(--sa-surface-2); color: var(--sa-text); border-color: var(--sa-primary); }

.sa-btn--sm { padding: .45rem .9rem; font-size: var(--sa-fs-xs); }

/* -------------------------------------------------------------------------
   8. CARDS + GRIDS
   ------------------------------------------------------------------------- */
.sa-grid { display: grid; gap: var(--sa-space-5); }
.sa-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.sa-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
/* Two-up at desktop width. For cards carrying a detailed UI screenshot, where
   a third column would shrink the image below the point of being readable. */
.sa-grid--pair { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }

.sa-card {
  display: flex;
  flex-direction: column;
  background: var(--sa-surface);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius-lg);
  overflow: hidden;
  box-shadow: var(--sa-shadow-sm);
  transition: transform var(--sa-dur) var(--sa-ease), box-shadow var(--sa-dur) var(--sa-ease), border-color var(--sa-dur) var(--sa-ease);
}
.sa-card:hover { transform: translateY(-3px); box-shadow: var(--sa-shadow-lg); border-color: var(--sa-border-strong); }

.sa-card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--sa-surface-2); }
.sa-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms var(--sa-ease); }
.sa-card:hover .sa-card__media img { transform: scale(1.03); }

.sa-card__body { padding: var(--sa-space-5); display: flex; flex-direction: column; flex: 1; gap: var(--sa-space-3); }
.sa-card__title { font-size: var(--sa-fs-xl); margin: 0; }
.sa-card__title a { color: var(--sa-text); text-decoration: none; }
.sa-card__title a:hover { color: var(--sa-primary); }
.sa-card__excerpt { color: var(--sa-text-muted); font-size: var(--sa-fs-sm); margin: 0; flex: 1; }
.sa-card__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sa-space-2);
  font-family: var(--sa-font-mono);
  font-size: var(--sa-fs-xs);
  color: var(--sa-text-subtle);
}
.sa-card__meta .sep { opacity: .5; }
.sa-card__tags { display: flex; flex-wrap: wrap; gap: var(--sa-space-2); }

/* Resource cards carry their own action row, pinned to the bottom so a grid of
   cards with uneven copy still lines its buttons up. */
.sa-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sa-space-2);
  margin-top: auto;
  padding-top: var(--sa-space-2);
}
.sa-card--resource .sa-card__media { aspect-ratio: 16 / 10; }
.sa-card--resource .sa-card__media img { object-position: top center; }

/* Feature list inside a resource card */
.sa-card__facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sa-space-1);
  font-size: var(--sa-fs-sm);
  color: var(--sa-text-muted);
}
.sa-card__facts li {
  margin: 0;
  padding-left: 1.1em;
  position: relative;
}
.sa-card__facts li::before {
  content: "\2192";
  position: absolute;
  left: 0;
  color: var(--sa-accent-text);
}

/* Eyebrow + pills */
.sa-eyebrow {
  display: inline-block;
  font-family: var(--sa-font-mono);
  font-size: var(--sa-fs-xs);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sa-accent-text);
  margin-bottom: var(--sa-space-3);
}

.sa-tag {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: var(--sa-radius-pill);
  background: var(--sa-primary-soft);
  color: var(--sa-primary);
  border: 1px solid color-mix(in srgb, var(--sa-primary) 22%, transparent);
  font-family: var(--sa-font-mono);
  font-size: var(--sa-fs-xs);
  text-decoration: none;
}
a.sa-tag:hover { background: var(--sa-primary); color: var(--sa-primary-contrast); }

.sa-tag--accent { background: var(--sa-accent-soft); color: var(--sa-accent-text); border-color: color-mix(in srgb, var(--sa-accent) 30%, transparent); }
.sa-tag--status { background: var(--sa-success-soft); color: var(--sa-success); border-color: color-mix(in srgb, var(--sa-success) 28%, transparent); }

/* -------------------------------------------------------------------------
   8b. FEATURE PANEL
   A cross-link block heavier than a card but lighter than a hero. Used to
   point the home and projects pages at the Learn Networking page.
   ------------------------------------------------------------------------- */
.sa-feature {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: var(--sa-space-7);
  align-items: center;
  padding: var(--sa-space-7);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius-xl);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--sa-primary) 9%, var(--sa-surface)) 0%,
      var(--sa-surface) 55%,
      color-mix(in srgb, var(--sa-accent) 10%, var(--sa-surface)) 100%);
  box-shadow: var(--sa-shadow-sm);
  overflow: hidden;
}

/* Brand bar down the leading edge. */
.sa-feature::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--sa-gradient);
}

@media (max-width: 860px) {
  .sa-feature {
    grid-template-columns: 1fr;
    gap: var(--sa-space-5);
    padding: var(--sa-space-5);
  }
}

.sa-feature__title { font-size: var(--sa-fs-2xl); margin-bottom: var(--sa-space-3); }
.sa-feature__body p { color: var(--sa-text-muted); }

/* Inline capability pills */
.sa-feature__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sa-space-2);
  list-style: none;
  margin: var(--sa-space-4) 0 var(--sa-space-5);
  padding: 0;
}
.sa-feature__pills li {
  margin: 0;
  padding: .22rem .65rem;
  border-radius: var(--sa-radius-pill);
  background: var(--sa-surface);
  border: 1px solid var(--sa-border-strong);
  font-family: var(--sa-font-mono);
  font-size: var(--sa-fs-xs);
  color: var(--sa-text-muted);
}

/* Screenshot mosaic */
.sa-feature__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sa-space-3);
}
.sa-feature__grid a,
.sa-feature__grid span {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--sa-radius);
  border: 1px solid var(--sa-border);
  background: var(--sa-surface-2);
  box-shadow: var(--sa-shadow-sm);
  transition: transform var(--sa-dur) var(--sa-ease), box-shadow var(--sa-dur) var(--sa-ease);
}
.sa-feature__grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}
.sa-feature:hover .sa-feature__grid a { box-shadow: var(--sa-shadow-md); }
.sa-feature__grid a:hover { transform: translateY(-2px); }

/* -------------------------------------------------------------------------
   8c. NOTE + GALLERY PLACEHOLDER
   Used by the Photography page while the archive is still being scanned.
   The frames are deliberately empty and dashed so nobody mistakes them for
   broken images.
   ------------------------------------------------------------------------- */
.sa-note {
  display: flex;
  gap: var(--sa-space-4);
  align-items: flex-start;
  padding: var(--sa-space-5);
  border: 1px solid color-mix(in srgb, var(--sa-accent) 35%, transparent);
  border-left: 3px solid var(--sa-accent);
  border-radius: var(--sa-radius);
  background: var(--sa-accent-soft);
  color: var(--sa-text);
}
.sa-note__icon { flex: none; color: var(--sa-accent-text); margin-top: 2px; }
.sa-note__body { min-width: 0; }
.sa-note__title {
  font-family: var(--sa-font-mono);
  font-size: var(--sa-fs-xs);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--sa-accent-text);
  margin: 0 0 var(--sa-space-2);
}
.sa-note p { margin: 0; color: var(--sa-text-muted); font-size: var(--sa-fs-sm); }

/* Gallery */
.sa-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: var(--sa-space-4);
}

.sa-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--sa-border-strong);
  border-radius: var(--sa-radius);
  background:
    repeating-linear-gradient(
      45deg,
      transparent 0 10px,
      color-mix(in srgb, var(--sa-text) 3%, transparent) 10px 20px
    ),
    var(--sa-surface-2);
  color: var(--sa-text-subtle);
  transition: border-color var(--sa-dur) var(--sa-ease), color var(--sa-dur) var(--sa-ease);
}
.sa-frame:hover { border-color: var(--sa-primary); color: var(--sa-primary); }

/* Tiles share one ratio so rows stay flush. A mixed-ratio grid without
   masonry leaves gaps under the shorter tiles, which reads as broken rather
   than deliberate. The wide tile spans two columns and stretches to the row
   height instead of setting its own ratio. */
.sa-frame--pano {
  grid-column: span 2;
  aspect-ratio: auto;
}

@media (max-width: 620px) {
  .sa-frame--pano { grid-column: span 1; aspect-ratio: 4 / 3; }
}

.sa-frame__inner { display: grid; justify-items: center; gap: var(--sa-space-2); text-align: center; padding: var(--sa-space-3); }
.sa-frame__label {
  font-family: var(--sa-font-mono);
  font-size: var(--sa-fs-xs);
  letter-spacing: .06em;
}

/* -------------------------------------------------------------------------
   9. HERO
   ------------------------------------------------------------------------- */
.sa-hero {
  position: relative;
  padding-block: var(--sa-space-9);
  overflow: hidden;
}
.sa-hero::before {
  content: "";
  position: absolute;
  inset: -40% 30% auto -10%;
  height: 80vh;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--sa-primary) 16%, transparent), transparent);
  pointer-events: none;
  z-index: 0;
}
.sa-hero::after {
  content: "";
  position: absolute;
  inset: auto -15% -45% 45%;
  height: 70vh;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--sa-accent) 15%, transparent), transparent);
  pointer-events: none;
  z-index: 0;
}
.sa-hero > * { position: relative; z-index: 1; }

.sa-hero__inner {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: var(--sa-space-8);
  align-items: center;
}
@media (max-width: 860px) {
  .sa-hero__inner { grid-template-columns: 1fr; gap: var(--sa-space-6); }
}

.sa-hero__title { margin-bottom: var(--sa-space-4); }
.sa-hero__title .sa-hl {
  background: var(--sa-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sa-hero__lede {
  font-size: var(--sa-fs-lg);
  color: var(--sa-text-muted);
  max-width: 58ch;
  margin-bottom: var(--sa-space-6);
}
.sa-hero__actions { display: flex; flex-wrap: wrap; gap: var(--sa-space-3); }

.sa-hero__portrait {
  border-radius: var(--sa-radius-xl);
  border: 1px solid var(--sa-border);
  box-shadow: var(--sa-shadow-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--sa-surface-2);
}
.sa-hero__portrait img { width: 100%; height: 100%; object-fit: cover; }

/* Stat strip */
.sa-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--sa-space-4);
  padding: var(--sa-space-5);
  background: var(--sa-surface);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius-lg);
  box-shadow: var(--sa-shadow-sm);
}
.sa-stat__value {
  font-family: var(--sa-font-display);
  font-size: var(--sa-fs-2xl);
  font-weight: 700;
  color: var(--sa-primary);
  line-height: 1.1;
}
.sa-stat__label {
  font-family: var(--sa-font-mono);
  font-size: var(--sa-fs-xs);
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--sa-text-subtle);
}

/* -------------------------------------------------------------------------
   10. RESUME TIMELINE
   ------------------------------------------------------------------------- */
.sa-timeline { position: relative; padding-left: var(--sa-space-6); }
.sa-timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--sa-primary), color-mix(in srgb, var(--sa-accent) 60%, transparent));
  border-radius: 2px;
}
.sa-role { position: relative; padding-bottom: var(--sa-space-7); }
.sa-role::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--sa-space-6) + 1px);
  top: 8px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--sa-surface);
  border: 2px solid var(--sa-primary);
}
.sa-role__title { font-size: var(--sa-fs-xl); margin-bottom: var(--sa-space-1); }
.sa-role__org { color: var(--sa-primary); font-weight: 600; }
.sa-role__dates {
  font-family: var(--sa-font-mono);
  font-size: var(--sa-fs-xs);
  color: var(--sa-text-subtle);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: var(--sa-space-3);
}

/* -------------------------------------------------------------------------
   11. SINGLE POST / PAGE
   ------------------------------------------------------------------------- */
.sa-entry { max-width: var(--sa-content); margin-inline: auto; }
.sa-entry img { border-radius: var(--sa-radius); }
.sa-entry > h2 { margin-top: var(--sa-space-7); }
.sa-entry > h3 { margin-top: var(--sa-space-6); }

.sa-entry-header { margin-bottom: var(--sa-space-6); }
.sa-entry-meta {
  display: flex; flex-wrap: wrap; gap: var(--sa-space-3);
  font-family: var(--sa-font-mono);
  font-size: var(--sa-fs-xs);
  color: var(--sa-text-subtle);
  margin-top: var(--sa-space-3);
}

.sa-featured {
  border-radius: var(--sa-radius-lg);
  overflow: hidden;
  border: 1px solid var(--sa-border);
  margin-bottom: var(--sa-space-7);
}

.sa-pagination {
  display: flex; gap: var(--sa-space-2); flex-wrap: wrap;
  justify-content: center; margin-top: var(--sa-space-7);
}
.sa-pagination .page-numbers {
  padding: .45rem .8rem;
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius-sm);
  background: var(--sa-surface);
  color: var(--sa-text-muted);
  text-decoration: none;
  font-size: var(--sa-fs-sm);
}
.sa-pagination .page-numbers:hover { border-color: var(--sa-primary); color: var(--sa-primary); }
.sa-pagination .page-numbers.current { background: var(--sa-primary); color: var(--sa-primary-contrast); border-color: var(--sa-primary); }

/* -------------------------------------------------------------------------
   12. FORMS
   ------------------------------------------------------------------------- */
input[type="text"], input[type="email"], input[type="url"], input[type="search"],
input[type="tel"], input[type="number"], input[type="password"], textarea, select {
  width: 100%;
  padding: .65rem .85rem;
  font-family: inherit;
  font-size: var(--sa-fs-sm);
  color: var(--sa-text);
  background: var(--sa-surface);
  border: 1px solid var(--sa-border-strong);
  border-radius: var(--sa-radius);
  transition: border-color var(--sa-dur) var(--sa-ease), box-shadow var(--sa-dur) var(--sa-ease);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--sa-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sa-primary) 18%, transparent);
  outline: none;
}
::placeholder { color: var(--sa-text-subtle); opacity: 1; }
label { display: block; font-size: var(--sa-fs-sm); font-weight: 600; margin-bottom: var(--sa-space-2); }

/* -------------------------------------------------------------------------
   13. FOOTER
   ------------------------------------------------------------------------- */
.site-footer {
  background: var(--sa-surface);
  border-top: 1px solid var(--sa-border);
  padding-block: var(--sa-space-7);
  margin-top: var(--sa-space-9);
  color: var(--sa-text-muted);
  font-size: var(--sa-fs-sm);
  transition: background-color var(--sa-dur) var(--sa-ease), border-color var(--sa-dur) var(--sa-ease);
}
.site-footer a { color: var(--sa-text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--sa-primary); }

.sa-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--sa-space-6);
  margin-bottom: var(--sa-space-6);
}
.sa-footer__heading {
  font-family: var(--sa-font-mono);
  font-size: var(--sa-fs-xs);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--sa-text-subtle);
  margin-bottom: var(--sa-space-3);
}
.sa-footer__list { list-style: none; padding: 0; margin: 0; }
.sa-footer__list li { margin-bottom: var(--sa-space-2); }
.sa-footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sa-space-3);
  padding-top: var(--sa-space-5);
  border-top: 1px solid var(--sa-border);
  font-size: var(--sa-fs-xs);
  color: var(--sa-text-subtle);
}

/* -------------------------------------------------------------------------
   14. ELEMENTOR BRIDGE
   Builder content inherits theme tokens instead of baked-in hex values.
   ------------------------------------------------------------------------- */
.elementor-widget-container { color: inherit; }
.elementor-section, .e-con, .e-con-inner { color: var(--sa-text); }
.elementor-heading-title { color: var(--sa-text); font-family: var(--sa-font-display); }
.elementor-widget-text-editor { color: var(--sa-text-muted); }
.elementor-button {
  background-color: var(--sa-primary);
  color: var(--sa-primary-contrast);
  border-radius: var(--sa-radius);
  font-family: var(--sa-font-body);
  font-weight: 600;
}
.elementor-button:hover { background-color: var(--sa-primary-hover); color: var(--sa-primary-contrast); }
.elementor-divider-separator { border-top-color: var(--sa-border) !important; }
.elementor-widget-image img { border-radius: var(--sa-radius); }

/* -------------------------------------------------------------------------
   15. CORE BLOCK CONTENT
   The migrated pages are built from core blocks. These rules give that
   markup the theme's treatment without altering any of the content.
   ------------------------------------------------------------------------- */
.sa-page-content > * { margin-block: var(--sa-space-5); }
.sa-page-content > *:first-child { margin-top: 0; }
/* Core gives .alignwide/.alignfull negative side margins to break out of a
   constrained layout. This theme's container already provides the width, so
   neutralise them - otherwise these blocks hang off the left edge on mobile. */
.sa-page-content .alignwide,
.sa-page-content .alignfull,
.sa-entry .alignwide,
.sa-entry .alignfull {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  left: auto;
  right: auto;
}

/* Section headings inside migrated pages */
.sa-page-content > .wp-block-heading {
  margin-top: var(--sa-space-8);
  padding-bottom: var(--sa-space-3);
  border-bottom: 1px solid var(--sa-border);
}
.sa-page-content > .wp-block-heading:first-child { margin-top: 0; }

/* Media + text: treat each one as a card so the big raw screenshots read as
   deliberate project tiles rather than full-bleed images. */
.wp-block-media-text {
  gap: var(--sa-space-6);
  align-items: center;
  background: var(--sa-surface);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius-lg);
  padding: var(--sa-space-5);
  box-shadow: var(--sa-shadow-sm);
  transition: border-color var(--sa-dur) var(--sa-ease), box-shadow var(--sa-dur) var(--sa-ease);
}
.wp-block-media-text:hover { border-color: var(--sa-border-strong); box-shadow: var(--sa-shadow-md); }

.wp-block-media-text__media {
  border-radius: var(--sa-radius);
  overflow: hidden;
  background: var(--sa-surface-2);
  border: 1px solid var(--sa-border);
}
.wp-block-media-text__media img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  object-position: top center;
  transition: transform 300ms var(--sa-ease);
}
.wp-block-media-text:hover .wp-block-media-text__media img { transform: scale(1.02); }

/* The portrait block on the front page is a person, not a screenshot. */
.wp-block-media-text.alignwide .wp-block-media-text__media img {
  max-height: none;
  object-fit: cover;
}

/* Core applies `padding: 0 8%` here; the card already supplies the inset. */
.wp-block-media-text > .wp-block-media-text__content,
.wp-block-media-text.is-stacked-on-mobile > .wp-block-media-text__content { padding: 0; }
.wp-block-media-text__content > p:only-child {
  font-family: var(--sa-font-display);
  font-size: var(--sa-fs-xl);
  font-weight: 600;
  margin: 0;
}
.wp-block-media-text__content > p:only-child a { text-decoration: none; color: var(--sa-text); }
.wp-block-media-text__content > p:only-child a:hover { color: var(--sa-primary); }

@media (max-width: 700px) {
  .wp-block-media-text { grid-template-columns: 1fr !important; }
  .wp-block-media-text__media img { max-height: 240px; }
}

/* Separators */
.wp-block-separator {
  border: 0;
  height: 1px;
  background: var(--sa-border);
  max-width: 100%;
  margin-block: var(--sa-space-6);
}
.wp-block-separator.is-style-dots {
  background: none;
  height: auto;
  text-align: center;
  line-height: 1;
  color: var(--sa-border-strong);
}
.wp-block-separator.is-style-dots::before {
  content: "\00b7 \00b7 \00b7";
  font-size: var(--sa-fs-xl);
  letter-spacing: 1em;
  padding-left: 1em;
  color: var(--sa-accent);
  opacity: .7;
}

/* Buttons inside migrated content */
.wp-block-buttons { gap: var(--sa-space-3); margin-block: var(--sa-space-6); }
.wp-block-button__link { text-decoration: none; }
.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button:not(.is-style-fill):nth-child(n + 2) .wp-block-button__link {
  background: transparent;
  color: var(--sa-text);
  border: 1px solid var(--sa-border-strong);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button:not(.is-style-fill):nth-child(n + 2) .wp-block-button__link:hover {
  background: var(--sa-surface-2);
  color: var(--sa-text);
  border-color: var(--sa-primary);
}

/* Images and embeds in migrated content */
.sa-page-content img, .sa-entry img { border-radius: var(--sa-radius); }
.wp-block-image figcaption, figcaption {
  font-size: var(--sa-fs-sm);
  color: var(--sa-text-subtle);
  text-align: center;
  margin-top: var(--sa-space-2);
}
.wp-block-table { overflow-x: auto; }

/* -------------------------------------------------------------------------
   16. UTILITIES
   ------------------------------------------------------------------------- */
.sa-muted   { color: var(--sa-text-muted); }
.sa-subtle  { color: var(--sa-text-subtle); }
.sa-mono    { font-family: var(--sa-font-mono); }
.sa-center  { text-align: center; }
.sa-lede    { font-size: var(--sa-fs-lg); color: var(--sa-text-muted); }
.sa-mt-0 { margin-top: 0; }
.sa-mb-0 { margin-bottom: 0; }

.sa-skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--sa-primary); color: var(--sa-primary-contrast);
  padding: var(--sa-space-3) var(--sa-space-4);
  z-index: 1000; border-radius: 0 0 var(--sa-radius) 0;
}
.sa-skip-link:focus { left: 0; color: var(--sa-primary-contrast); }

/* -------------------------------------------------------------------------
   17. PRINT - resume-friendly
   ------------------------------------------------------------------------- */
@media print {
  :root {
    --sa-bg: #fff; --sa-surface: #fff; --sa-surface-2: #fff;
    --sa-text: #000; --sa-text-muted: #333; --sa-text-subtle: #555;
    --sa-border: #ccc;
  }
  .site-header, .site-footer, .sa-theme-toggle { display: none !important; }
  .sa-hero::before, .sa-hero::after { display: none !important; }
  body { font-size: 11pt; }
  a { text-decoration: underline; color: #000; }
  .sa-card, .sa-stats { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .sa-role { break-inside: avoid; }
}
