@font-face
{
  font-family: 'Bastliga-One';
  src: url('/fonts/bastliga-one.regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root
{
  /* Light Theme */
  --background: rgb(250, 247, 244);
  --card-paperwhite: rgb(250, 247, 244); /* #faf9f7; */
  --code-midgray: #ddd;
  --blockquote-gray: #f0f0f0;
  --border-gray: rgb(199, 199, 199);
  --text: #222;
  --text-hover-shiny: #4d7ba9;
  --text-mobile-menu: white;
  --closeButton-mobile-menu: white;
  --text-mobile-menu-hover: black;
  --background-mobile-menu: linear-gradient(135deg,
      rgba(170, 45, 0, 0.7),
      rgba(0, 98, 174, 0.7) 50%,
      rgba(83, 44, 173, 0.7) 100%);
  --button-background-mobile-menu: rgba(0, 0, 0, 0.4);
  --muted-gray: #666;
  --awesome-blue: rgba(0, 145, 255, 1);
  --awesome-orange: rgba(255, 68, 0, 1);
  --accent-blue: rgb(44, 118, 246);
  --accent-yellownote: #F2BA4B;

  --font-serif: "Charter", "Garamond";
  --font-sans-serif: ui-sans-serif, -apple-system, system-ui, Segoe UI, Helvetica, Apple Color Emoji, Arial, sans-serif, Segoe UI Emoji, Segoe UI Symbol;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --border-radius: 10px;

  /* 24 looks good on computer, honestly on mobile too. 16 minimum on a lot of mobile sites and apple. */
  --padding: 24px;
  --padding-mobile: 16px;

  /*Insta uses 935. Apple 980. Most ~900. Web search 652. Blogs 650 to 740. 1200 max otherwise.*/
  /* 576px is a good blog size for the SF pro text font. */
  --max-width-article: 600px; /*  600 looks better tbh*/
  --max-width-main: 692px;
  /* --max-width-main-large: 900px; */
  /* TODO: Larger than 1200 max, include some cool art in margins. */

  /* Prevent font scaling in landscape while allowing user zoom */
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

:root.dark
{
  --background: rgb(13, 13, 13);
  --text: #eaeaea;
  --text-mobile-menu: white;
  --background-mobile-menu: linear-gradient(135deg,
      rgba(157, 42, 0, 0.7),
      rgba(0, 92, 163, 0.7) 50%,
      rgba(82, 34, 151, 0.7) 100%);
  --button-background-mobile-menu: rgba(160, 160, 160, .5);
  --muted-gray: #999;
  --accent-blue: rgba(73, 152, 247, 1);
  --card-paperwhite: rgb(13, 13, 13);
  --code-midgray: #1c1c1c;
  --blockquote-gray: #2a2a2a;
  --border-gray: rgba(57, 57, 57, 1);
}

.dark-toggle-btn
{
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  margin: 0;
  padding: 0;
  height: 24px;
  width: 24px;
}

.dark-toggle-btn svg
{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  fill: var(--text);
}

/* Show sun icon in light mode */
:root .icon-sun
{
  opacity: 1;
  pointer-events: auto;
}

/* Show moon icon in dark mode */
:root.dark .icon-sun
{
  opacity: 0;
  pointer-events: none;
}

:root.dark .icon-moon
{
  opacity: 1;
  pointer-events: auto;
}

.icon-sun:hover,
.icon-moon:hover
{
  fill: var(--accent-yellownote);
}

*
{
  box-sizing: border-box;
}

body
{
  font-family: var(--font-sans-serif);
  background: var(--background);
  color: var(--text);
  margin: 0;
  padding: var(--padding);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.no-scroll
{
  overflow: hidden;
  position: fixed;
  width: 100%;
}

header
{
  text-align: left;
  padding: 0 0 var(--padding);
}

header a
{
  color: var(--text);
}

header a:hover
{
  color: var(--accent-blue);
}

header hr
{
  max-width: var(--max-width-main);
}

pre,
code
{
  font-family: var(--font-mono);
  font-size: .9rem;
  background: var(--code-midgray);
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius);
}

pre
{
  display: block;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

hr
{
  border-style: none;
  background-color: var(--border-gray);
  height: 1px;
}

article
{
  max-width: var(--max-width-article);
  margin: 0 auto;
}

article h1
{
  line-height: 1.2;
}

h1,
h2,
h3,
h4,
h5,
h6
{
  font-family: var(--font-serif);
  font-weight: 900;
}

h1
{
  font-size: 3.5rem;
  margin: 1rem 0;
}

/* link */
a
{
  color: var(--accent-blue);
  text-decoration: none;
}

/* quote */
q
{
  font-family: var(--font-serif);
  color: var(--muted-gray);
  font-style: italic;
  /* font-weight:300; */
}

ul p,
li p
{
  display: block;
  margin: 0;
}

a:hover
{
  border-color: var(--muted-gray);
}

img {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin-bottom: 0.25em;   /* spacing between image and caption */
}

/* image caption */
img + em {
  color: var(--muted-gray);
  font-style: italic;
  font-size: 0.8rem;
  line-height: 1;
  margin-top: 0;           /* reset default inline spacing */
}

video {
  width: 100%;
  max-width: 100vw;
  max-height: 100vh;
  height: auto;
  border-radius: var(--border-radius);
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

/* image caption */
video+em
{
  color: var(--muted-gray);
  font-style: italic;
  font-size: 0.8rem;
  line-height: 1;
}

svg
{
  fill: var(--text);
  display: inline-block;
  width: 2rem;
  height: auto;
}

button
{
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
}

blockquote
{
  border-left: 4px solid var(--accent-blue);
  background: var(--blockquote-gray);
  padding: 0.5rem 1rem;
  margin: 1.5rem 0;
  color: var(--muted-gray);
  font-style: italic;
}

table,
th,
td
{
  border: 1px solid var(--border-gray);
  border-collapse: collapse;
  padding: 0.75rem;
}


small
{
  color: var(--muted-gray);
  font-style: italic;
  font-size: 0.8rem;
}



main
{
  /* background-color: var(--card-paperwhite); */
  max-width: var(--max-width-main);
  width: 100%;
  margin: 0 auto;
  flex: auto;
}

footer
{
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted-gray);
}

footer a
{
  color: var(--accent-yellownote);
}

footer a:hover
{
  text-decoration: underline;
}

/* Apply to containers or text elements where wrapping is needed */
p,
h1,
h2,
h3,
h4,
h5,
h6,
li,
div
{
  word-wrap: break-word;
  /* legacy */
  overflow-wrap: break-word;
  /* modern */
}


/* article img,
article video
{
  max-width: min(var(--max-width-main), 100vh);
  width: auto;
  margin-left: calc((var(--max-width-article) - var(--max-width-main)) / 2);
  margin-right: auto;
} */
 
article img {
  max-width: var(--max-width-main);
  width: 100%;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* used for article nav bar */
.article-width
{
  max-width: var(--max-width-article);
  margin: 0 auto;
}



/* --------------- SIGNATURE ---------------- */

.signature
{
  font-family: 'Bastliga-One';
  font-size: 3rem;
  margin: 0;
}

.signature-large
{
  font-family: 'Bastliga-One';
  font-weight: normal;
  font-size: 6rem;
  margin: 0;
}

/* ------------------- DESKTOP NAV ------------------- */

.nav-container
{
  max-width: var(--max-width-main);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo
{
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  gap: 1rem;
}

.nav-logo img
{
  display: block;
  width: auto;
  height: 40px;
  justify-content: center;
  border-radius: 0;
}

.nav-links
{
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a
{
  text-decoration: none;
  color: var(--text);
}

.nav-links p
{
  margin: 0;
}

.nav-links svg
{
  width: 24px;
  height: 24px;
}



/* ------------------- MOBILE MENU ------------------- */
/* Soap bubble V2 */
.mobile-menu
{
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;

  background-image: var(--background-mobile-menu);
  background-blend-mode: screen;
  background-size: 140% 140%;

  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  animation: gradientShift 15s linear infinite;

  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 2em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.menu-button
{
  display: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  z-index: 1001;
}

.menu-button svg
{
  width: 100%;
  height: 100%;
}

.menu-button line
{
  stroke: var(--text);
}

#closeIcon
{
  display: none;
}

#closeIcon line
{
  stroke: var(--closeButton-mobile-menu);
}

.menu-button circle
{
  fill: var(--button-background-mobile-menu);
}

.mobile-menu svg,
.mobile-menu .dark-toggle-btn
{
  display: flex;
  flex-shrink: 1;
  width: 36px;
  height: 36px;
  max-width: 36px;
  min-width: 24px;
  max-height: 36px;
  min-height: 24px;
}


#post-grid-container
{
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
}

.post-grid
{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 40px;
}

#post-row-container
{
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
}

.post-row
{
  display: flex;
  align-items: center;
  gap: 1rem;
}

.post-row img
{
  width: 150px;
  height: auto;
  max-height: 112px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 4px;
  display: block;
}

.post-text
{
  flex: 1;
}

.post-text h2
{
  margin: 0 0 0.3rem 0;
}

.post-text a
{
  color: var(--text);
}

.post-text a:hover
{
  color: var(--muted-gray);
}

.post-text p,
small
{
  margin: 0.3rem 0;
  padding: 0;
}

.post-card
{
  background: var(--card-paperwhite);
}

.post-card img
{
  width: 100%;
  display: block;
  object-fit: cover;
  height: 160px;
  max-height: 300px;
  margin-bottom: .8rem;
}

.post-nav
{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border-gray);
  text-align: center;
}

.post-nav-prev
{
  text-align: left;
}

.post-nav-random
{
  text-align: center;
}

.post-nav-next
{
  text-align: right;
}

/* bottom of post links */
.post-nav a
{
  /* color: var(--muted-gray); */
  color: var(--accent-blue)
}

.post-nav a:hover
{
  /* color: var(--text-hover-shiny); */
  text-decoration: underline;
}

.post-date-author
{
  color: var(--muted-gray);
  font-size: 0.9rem;
  margin-top: 0;
  margin-bottom: 2rem;
}

.post-breadcrumbs
{
  color: var(--muted-gray);
  padding: 1rem 0;
  font-size: 0.9em;
}

.post-breadcrumbs a
{
  font-weight: bold;
  color: var(--muted-gray);
}

.post-breadcrumbs a:hover
{
  text-decoration: underline;

}



.date-divider
{
  display: flex;
  align-items: center;
  width: 100%;
}

.date-divider hr
{
  flex: 1;
  border: none;
  margin: 0;
}

/* --- July 2025 --- */
.date-divider-label
{
  margin: 0 1.5rem;
}

.post-divider
{
  margin: 0;
}




@media (max-width: 738px)
{

  /* ----------- MOBILE PADDING ----------- */
  body
  {
    padding: var(--padding-mobile);
  }

  h1
  {
    font-size: 2.5rem;
  }

  .signature-large
  {
    font-size: 4rem;
  }

  /* ----------- NAVIGATION ----------- */
  .nav-links
  {
    display: none;
  }

  .menu-button
  {
    display: block;
  }

  .mobile-menu.show
  {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu .menu-animatable
  {
    color: var(--text-mobile-menu);
    transform: translateX(50px);
    opacity: 0;
    font-size: 1.5rem;
    margin: 0.5rem 0;
    font-weight: bold;
  }


  .dark-toggle-btn svg
  {
    fill: var(--text-mobile-menu);
  }

  .mobile-menu .menu-animatable:hover
  {
    color: var(--text-mobile-menu-hover);
  }

  .mobile-menu.show .menu-animatable
  {
    animation: slideIn 0.3s ease forwards;
  }

  .mobile-menu.show .menu-animatable:nth-child(1)
  {
    animation-delay: 0.05s;
  }

  .mobile-menu.show .menu-animatable:nth-child(2)
  {
    animation-delay: 0.10s;
  }

  .mobile-menu.show .menu-animatable:nth-child(3)
  {
    animation-delay: 0.15s;
  }

  .mobile-menu.show .menu-animatable:nth-child(4)
  {
    animation-delay: 0.20s;
  }

  .mobile-menu.show .menu-animatable:nth-child(5)
  {
    animation-delay: 0.25s;
  }

  .mobile-menu.show .menu-animatable:nth-child(6)
  {
    animation-delay: 0.30s;
  }

  @keyframes slideIn
  {
    to
    {
      transform: translateX(0);
      opacity: 1;
    }
  }
}

@keyframes fadeIn
{
  from
  {
    opacity: 0;
    transform: translateY(12px);
  }

  to
  {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animate background position for subtle color drift */
@keyframes gradientShift
{
  0%
  {
    background-position: 0% 50%;
  }

  50%
  {
    background-position: 100% 50%;
  }

  100%
  {
    background-position: 0% 50%;
  }
}