/* Fonts */

@font-face {
  font-family: "Maple Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/MapleMono-Regular.ttf.woff2") format("woff2");
}

@font-face {
  font-family: "Maple Mono";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/MapleMono-Italic.ttf.woff2") format("woff2");
}

@font-face {
  font-family: "Maple Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/MapleMono-Bold.ttf.woff2") format("woff2");
}

@font-face {
  font-family: "Maple Mono";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/MapleMono-BoldItalic.ttf.woff2") format("woff2");
}

/* Theme */

:root {
  /* Catppuccin Mocha */
  --rosewater: #f5e0dc;
  --flamingo: #f2cdcd;
  --pink: #f5c2e7;
  --mauve: #cba6f7;
  --red: #f38ba8;
  --maroon: #eba0ac;
  --peach: #fab387;
  --yellow: #f9e2af;
  --green: #a6e3a1;
  --teal: #94e2d5;
  --sky: #89dceb;
  --sapphire: #74c7ec;
  --blue: #89b4fa;
  --lavender: #b4befe;
  --text: #cdd6f4;
  --subtext1: #bac2de;
  --subtext0: #a6adc8;
  --overlay2: #9399b2;
  --overlay1: #7f849c;
  --overlay0: #6c7086;
  --surface2: #585b70;
  --surface1: #45475a;
  --surface0: #313244;
  --base: #1e1e2e;
  --mantle: #181825;
  --crust: #11111b;

  /* Category accent colors */
  --kind-work: var(--blue);
  --kind-project: var(--mauve);
  --kind-leadership: var(--peach);

  /* Just barely above half the pill button's height, so buttons fully round
     (clipped to height/2) and cards share the same absolute curve. */
  --radius: 1rem;
}

/* Reset */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base */

body {
  background: var(--base);
  color: var(--subtext1);
  font-family: "Maple Mono", ui-monospace, monospace;
  font-size: 1rem;
  line-height: 1.55;
  word-wrap: break-word;
  /* Enable OpenType ligatures (common ligatures + contextual alternates) */
  font-feature-settings: "liga", "calt";
  font-variant-ligatures: common-ligatures contextual;
}

a {
  color: var(--mauve);
  text-decoration: none;
}

strong {
  color: var(--text);
}

/* Layout */

main {
  max-width: 37.5rem;
  margin: 3rem auto 0;
  padding-bottom: 4rem;
}

main.wide {
  max-width: 60rem;
}

/* consistent vertical rhythm */
main > * + *,
section > * + * {
  margin-top: 1rem;
}

/* Elements */

.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  /* wrap-reverse means when the nav can't fit beside the title, it wraps
     ABOVE the title instead of below. */
  flex-wrap: wrap-reverse;
}

.page-header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.top-home {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.icon {
  display: block;
}

.top-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  /* Stay right-aligned whether sharing a line with the title or on its own. */
  margin-left: auto;
}

.desc {
  color: var(--subtext0);
  font-style: italic;
}

ul,
ol {
  padding-left: 2.5rem;
  margin-top: 0.5rem;
}

li + li {
  margin-top: 0.5rem;
}

/* Typography */

h1 {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

hr {
  display: block;
  width: 100%;
  height: 0;
  border: none;
  border-top: 1px solid var(--surface1);
  margin: 1rem 0;
}

li a {
  position: relative;
  text-decoration: none;
}

li a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ONLY trigger underline when the link is hovered */
li a:hover::after,
li a:focus-visible::after {
  transform: scaleX(1);
}

/* only add side padding on small screens */
@media (max-width: 42rem) {
  main {
    padding-inline: 1.25rem;
  }

  ul,
  ol {
    padding-left: 1.75rem;
  }
}


/* Code blocks */

pre.astro-code {
  background-color: var(--base) !important;
  color: var(--text);

  border: 1px solid var(--surface1);
  border-radius: var(--radius);

  padding: 0.5rem 1rem;

  overflow-x: auto;
}

/* Typography */
pre.astro-code,
pre.astro-code code {
  font-family:
    "Maple Mono",
    monospace;
}

/* Operators & symbols slightly muted for readability */
pre.astro-code .line span {
  color: var(--text);
}

/* Inline code (to match blocks) */
:not(pre) > code {
  background-color: var(--surface0);
  color: var(--text);

  padding: 0.05em 0.35em;
  border: 1px solid var(--surface1);
  border-radius: 0.25rem;

  font-family:
    "Maple Mono",
    monospace;
  font-size: 0.9em;
}

/* Tables — allowed to escape the main text column when they need to. */
table {
  width: max-content;
  max-width: calc(100vw - 2rem);
  border-collapse: collapse;
  border: 1px solid var(--surface1);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1rem auto;
  margin-left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
}

th,
td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--surface1);
  text-align: left;
}

thead {
  background: var(--mantle);
}

th {
  color: var(--text);
  font-weight: 700;
}

tbody tr:nth-child(even) {
  background: color-mix(in oklab, var(--mantle) 50%, transparent);
}

.sheet-embed {
  --scale: 0.5;
  --vh: 600px;

  height: var(--vh);
  width: 100%;
  overflow: hidden;

  border: 1px solid var(--surface1);
  border-radius: var(--radius);
  background: var(--mantle);
}

.sheet-embed iframe {
  display: block;
  width: calc(100% / var(--scale));
  height: calc(var(--vh) / var(--scale));
  border: 0;

  transform: scale(var(--scale));
  transform-origin: top left;
}

.chart-embed {
  --scale: 0.8;
  --vh: 360px;

  height: var(--vh);
  width: 100%;
  overflow: hidden;

  border: 1px solid var(--surface1);
  border-radius: var(--radius);
  background: var(--mantle);
}

.chart-embed iframe {
  display: block;
  width: calc(100% / var(--scale));
  height: calc(var(--vh) / var(--scale));
  border: 0;

  transform: scale(var(--scale));
  transform-origin: top left;
}


img:not(.icon) {
  display: block;
  width: 100%;

  border: 1px solid var(--surface1);
  border-radius: var(--radius);

  margin: 1rem 0;
}

.tags {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;

  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags li + li {
  margin-top: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--surface1);
  background: var(--mantle);
  color: var(--overlay2);

  border-radius: var(--radius);
  padding: 0.3rem 0.75rem;

  font-style: italic;
  font-size: 0.8rem;
  line-height: 1.2;
  white-space: nowrap;
  margin-top: 0;
}

/* Mobile: don't squeeze title/date too hard */
@media (max-width: 42rem) {
  .item-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }
  .item-date {
    white-space: normal;
  }
}

/* Home: intro */

.intro h1 {
  margin-bottom: 0;
}

.intro-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.25rem;
  /* When the nav can't fit beside the name, wrap above. */
  flex-wrap: wrap-reverse;
}

.name-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.name-icon {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
}

.intro .desc {
  color: var(--subtext0);
  font-size: 1rem;
}

/* Home: filter bar */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

/* Nav pill links (Home / About Me): rosewater border, hover changes bg. */
.filter-btn.filter-link {
  --pill-border: var(--rosewater);
  text-decoration: none;
  color: var(--rosewater);
}

.filter-btn.filter-link:hover {
  background: color-mix(in oklab, var(--rosewater) 15%, var(--surface0));
}

.filter-bar .filter-link {
  margin-left: auto;
}

.filter-btn {
  --pill-border: var(--surface1);
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background: transparent;
  border: 1px solid var(--pill-border);
  color: var(--subtext1);
  font-family: inherit;
  font-style: italic;
  font-size: 0.8rem;
  line-height: 1.2;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.filter-btn svg {
  flex-shrink: 0;
}

.filter-btn:hover {
  background: var(--surface0);
}

.filter-btn.is-active {
  --pill-border: var(--overlay0);
  background: var(--surface0);
  color: var(--text);
}

/* Color-coded filter pills. Hover/active changes only the background fill. */
.filter-btn.kind-work {
  --pill-border: var(--kind-work);
  color: var(--kind-work);
}
.filter-btn.kind-work:hover,
.filter-btn.kind-work.is-active {
  background: color-mix(in oklab, var(--kind-work) 15%, var(--surface0));
}

.filter-btn.kind-project {
  --pill-border: var(--kind-project);
  color: var(--kind-project);
}
.filter-btn.kind-project:hover,
.filter-btn.kind-project.is-active {
  background: color-mix(in oklab, var(--kind-project) 15%, var(--surface0));
}

.filter-btn.kind-leadership {
  --pill-border: var(--kind-leadership);
  color: var(--kind-leadership);
}
.filter-btn.kind-leadership:hover,
.filter-btn.kind-leadership.is-active {
  background: color-mix(in oklab, var(--kind-leadership) 15%, var(--surface0));
}

/* Home: card grid */

.card-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.25rem;
}

.card {
  --card-border: var(--surface1);
  display: flex;
  flex-direction: column;
  background: var(--mantle);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  /* Crisp 1px inset shadow draws the outline at the border-radius curve
     without shrinking the inner area, so the image's rounded top corners
     stay concentric with the card outline. */
  box-shadow: inset 0 0 0 1px var(--card-border);
  transition: background 180ms ease;
}

/* Border color matches the placeholder background (same color-mix recipe). */
.card.kind-work {
  --card-border: color-mix(in oklab, var(--kind-work) 12%, var(--surface0));
}
.card.kind-project {
  --card-border: color-mix(in oklab, var(--kind-project) 12%, var(--surface0));
}
.card.kind-leadership {
  --card-border: color-mix(in oklab, var(--kind-leadership) 12%, var(--surface0));
}

/* Hover tints the fill with the category color. */
.card.kind-work:hover {
  background: color-mix(in oklab, var(--kind-work) 8%, var(--mantle));
}
.card.kind-project:hover {
  background: color-mix(in oklab, var(--kind-project) 8%, var(--mantle));
}
.card.kind-leadership:hover {
  background: color-mix(in oklab, var(--kind-leadership) 8%, var(--mantle));
}

.card.is-hidden { display: none; }

.card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface0);
  border-bottom: 1px solid var(--surface1);
  /* Match the parent card's outer corner so the image curve looks continuous
     with the border (parent overflow:hidden still clips any overrun). */
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  border: 0;
  /* Match the parent card's outer corner so the image curve looks continuous
     with the border. */
  border-radius: var(--radius) var(--radius) 0 0;
}

/* Shader thumbnail fills the card image slot like a cover image. Clicks fall
   through to the card link since the canvas is non-interactive here. */
.card-image .shader-canvas,
.card-image .shader-canvas img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  border: 0;
  background: #000;
  border-radius: var(--radius) var(--radius) 0 0;
}
.shader-canvas[data-interactive="false"] {
  pointer-events: none;
}

/* Live shader on the project page. */
.shader-figure {
  margin: 1.5rem 0;
}
.shader-figure .shader-canvas,
.shader-figure .shader-canvas img {
  display: block;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  background: #000;
  border-radius: var(--radius);
  cursor: grab;
}
.shader-figure .shader-canvas:active {
  cursor: grabbing;
}
.shader-figure figcaption {
  margin-top: 0.5rem;
  text-align: center;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--subtext0);
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Maple Mono", monospace;
  font-size: 3rem;
  font-weight: 700;
}

.card.kind-work .card-image-placeholder {
  background: color-mix(in oklab, var(--kind-work) 12%, var(--surface0));
  color: var(--kind-work);
}
.card.kind-project .card-image-placeholder {
  background: color-mix(in oklab, var(--kind-project) 12%, var(--surface0));
  color: var(--kind-project);
}
.card.kind-leadership .card-image-placeholder {
  background: color-mix(in oklab, var(--kind-leadership) 12%, var(--surface0));
  color: var(--kind-leadership);
}

.card-body {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.card-body > * + * { margin-top: 0; }

.card-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.card-kind {
  display: inline-flex;
  align-items: center;
  font-style: italic;
  font-size: 0.75rem;
  line-height: 1.2;
  padding: 0.25rem 0.6rem;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  background: transparent;
  white-space: nowrap;
}

.card-kind.kind-work { color: var(--kind-work); }
.card-kind.kind-project { color: var(--kind-project); }
.card-kind.kind-leadership { color: var(--kind-leadership); }

.card-tech {
  display: inline-flex;
  align-items: center;
  font-style: italic;
  font-size: 0.75rem;
  line-height: 1.2;
  padding: 0.25rem 0.6rem;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  background: transparent;
  white-space: nowrap;
  color: var(--subtext0);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.card-date {
  font-style: italic;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--subtext0);
  white-space: nowrap;
  flex-shrink: 0;
}

/* When a kind badge appears in a tag row, match the tag pill dimensions */
.tags .card-kind {
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  line-height: 1.2;
}


.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.card-desc {
  color: var(--subtext0);
  font-style: italic;
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 0;
}