/* =========================================================
   digitalcauldron.dev — main stylesheet
   ========================================================= */

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

/* ---------------------------------------------------------
   Brand tokens
   --------------------------------------------------------- */
:root {
  --grape-juice: #4d2655;
  --americano: #332654;
  --dark-emerald: #26542b;
  --baked: #405426;
  --purplish-pink: #a385a9;

  --bg: var(--americano);
  --surface: var(--grape-juice);
  --surface-hover: #5d3065;
  --text: var(--purplish-pink);
  --text-strong: #e9d6ed;
  --accent: var(--dark-emerald);
  --accent-alt: var(--baked);
  --border: rgba(163, 133, 169, 0.3);

  --nav-width: 260px;
  --content-max-width: 1100px;
  --gap: 22px;
}

/* ---------------------------------------------------------
   Base
   --------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 22px;
}

body {
  margin: 0;
  font-family: "Departure Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
}

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

a {
  color: var(--text-strong);
  text-decoration: underline;
  text-decoration-color: var(--purplish-pink);
}

a:hover,
a:focus {
  color: #fff;
  text-decoration-color: #fff;
}

/* ---------------------------------------------------------
   Typography
   --------------------------------------------------------- */
h1, h2, h3, h4 {
  margin: 0 0 var(--gap) 0;
  color: var(--text-strong);
  line-height: 1.2;
  font-weight: normal;
}

h1 { font-size: 55px; }
h2 { font-size: 44px; }
h3 { font-size: 33px; }

p {
  margin: 0 0 var(--gap) 0;
}

.tagline,
.card-tagline {
  font-style: italic;
  color: #fff;
}

.meta,
.card-meta {
  font-size: 16.5px;
  color: var(--purplish-pink);
  opacity: 0.8;
}

/* ---------------------------------------------------------
   Layout shell
   --------------------------------------------------------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  padding: 33px 22px;
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 33px;
  z-index: 100;
}

.nav-logo {
  font-size: 22px;
  color: #fff;
  text-decoration: none;
  line-height: 1.2;
}

.nav-logo:hover,
.nav-logo:focus {
  color: var(--purplish-pink);
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16.5px;
}

.nav-list a {
  display: block;
  padding: 8px 0;
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-list a:hover,
.nav-list a:focus,
.nav-list a.active {
  color: #fff;
  border-bottom-color: var(--purplish-pink);
}

.nav-list a.active {
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 16.5px;
  color: #fff;
  background-color: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
}

.site-wrapper {
  margin-left: var(--nav-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  padding: 55px 44px 22px;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-size: 55px;
  color: #fff;
  margin: 0;
}

.content {
  flex: 1;
  padding: 44px;
  max-width: var(--content-max-width);
}

/* ---------------------------------------------------------
   Mobile navigation
   --------------------------------------------------------- */
@media (max-width: 800px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 80vw;
    max-width: 300px;
  }

  .site-nav.open {
    transform: translateX(0);
  }

  .site-wrapper {
    margin-left: 0;
  }

  .site-header {
    padding: 80px 22px 22px;
  }

  .site-title {
    font-size: 33px;
  }

  .content {
    padding: 22px;
  }

  h1 { font-size: 33px; }
  h2 { font-size: 28px; }
  h3 { font-size: 22px; }
}

/* ---------------------------------------------------------
   Cards (posts / projects / links)
   --------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 44px;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--border);
}

.card-image-link img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.card-title {
  font-size: 33px;
  margin-bottom: 11px;
}

.card-title a {
  text-decoration: none;
}

.card-meta,
.card-tagline,
.card-excerpt {
  margin-bottom: 11px;
}

.card-excerpt {
  opacity: 0.9;
}

.card-cta {
  display: inline-block;
  margin-top: 11px;
  padding: 8px 16px;
  background-color: var(--accent);
  color: #fff;
  text-decoration: none;
  border: 1px solid transparent;
}

.card-cta:hover,
.card-cta:focus {
  background-color: var(--accent-alt);
  color: #fff;
}

/* ---------------------------------------------------------
   Single post / item page
   --------------------------------------------------------- */
.single-header {
  margin-bottom: 44px;
}

.single-header h1 {
  margin-bottom: 11px;
}

.single-header .tagline {
  margin-bottom: 11px;
}

.single-image {
  margin: 0 0 44px 0;
}

.single-image img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.single-image figcaption {
  margin-top: 11px;
  font-size: 16.5px;
  color: var(--purplish-pink);
  text-align: center;
}

.body h2,
.body h3 {
  margin-top: 44px;
}

.body ul,
.body ol {
  margin: 0 0 var(--gap) 0;
  padding-left: 1.5em;
}

.body code {
  font-family: inherit;
  font-size: 16.5px;
  background-color: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
}

.body pre {
  background-color: rgba(0, 0, 0, 0.35);
  padding: 22px;
  overflow-x: auto;
  border: 1px solid var(--border);
}

.body pre code {
  background: transparent;
  padding: 0;
}

/* ---------------------------------------------------------
   Home page extras
   --------------------------------------------------------- */
.landing-intro {
  margin-bottom: 66px;
}

.latest-scroll {
  padding: 33px;
  background-color: rgba(77, 38, 85, 0.4);
  border: 1px solid var(--border);
}

.latest-scroll h2 {
  font-size: 33px;
  margin-bottom: 22px;
}

.latest-scroll h3 {
  font-size: 22px;
  margin-bottom: 11px;
}

/* ---------------------------------------------------------
   Utilities
   --------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
