/* ===================== Theme ===================== */

:root {
  --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;
}

/* ===================== Reset ===================== */

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

/* ===================== Base  ===================== */

body {
  background: var(--base);
  color: var(--subtext1);
  font-family: "Fira Sans";
  word-wrap: break-word;
}

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

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

/* ===================== Layout ===================== */

main {
  max-width: 37.5rem;
  margin: 14vh auto 0;
  font-size: 0.9rem;
  line-height: 1.5rem;
  padding-bottom: 2rem;
}

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

/* ===================== Elements ===================== */

.icon {
  margin: 0 0 1.75rem;
  image-rendering: pixelated;
}

.web-code {
  margin-top: 1rem;
  color: var(--overlay0);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-family: "Fira Mono";
}

.desc {
  color: var(--overlay0);
}

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

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

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

nav {
  margin-top: 3rem;
}

nav::after {
  content: "";
  display: table;
  clear: both;
  width: 100%;
}

.btn {
  border: 0;
  border-radius: 1.25rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
}

.primary {
  float: left;
  background: var(--blue);
  color: var(--base);
}

.secondary {
  float: right;
  background: var(--base);
  border: 1px solid var(--surface2);
  color: var(--blue);
  text-align: center;
}

/* ===================== 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 {
  color: var(--surface1);
  background-color: var(--surface1);
  border: none;
  height: 1px;
}

@keyframes drop-in {
  0% {
    transform: translateY(-120vh);
    opacity: 0;
  }
  60% {
    transform: translateY(6px);
    opacity: 1;
  }
  80% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(0);
  }
}


.icon {
  animation: drop-in 600ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

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);
}

.btn {
  transition: filter 150ms ease, transform 150ms ease;
}

.btn:hover {
  filter: brightness(1.25);
}

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

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


/* =========================
   Code Blocks (Catppuccin)
   ========================= */

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

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

  padding: 0.5rem 1rem;

  overflow-x: auto;
}

/* Typography */
pre.astro-code,
pre.astro-code code {
  font-family:
    "Fira 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.15em 0.4em;
  border-radius: 0.5rem;
  border: 1px solid var(--surface1);

  font-family:
    "Fira Mono",
    monospace;
}

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

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

  border-radius: 0.5rem;
  border: 1px solid var(--surface1);
  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;
}


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

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

  margin: 1rem 0;
}

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


  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 1rem;
}

.tag {
  border: 1px solid var(--surface1);
  background: var(--mantle);
  color: var(--overlay2);

  border-radius: 999px;
  padding: 0.15rem 0.6rem;

  font-size: 0.85rem;
  line-height: 1.5;
  white-space: nowrap;
  margin-top: 0.0rem;
}

.can-word {
  position: relative;
  display: inline-block;
  font-weight: 800;
  font-style: italic;
  color: var(--green);
}

.can-word::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: currentColor;

  transform: scaleX(0);
  transform-origin: left;

  animation: can-underline 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 120ms; /* optional, feels nicer */
}

@keyframes can-underline {
  to {
    transform: scaleX(1);
  }
}

.item-meta {
  margin-top: 0.15rem;
  color: var(--subtext0);
  font-size: 0.85rem;
}

.item-meta .dot {
  margin: 0 0.25rem;
  color: var(--subtext0);
}

/* 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;
  }
}

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