/* ============================================================
   Base
   Fonts loaded via Google Fonts: IM Fell English, Eczar
   ============================================================ */

html, body {
  margin: 0;
  padding: 0;
  font-family: Georgia, serif;
  line-height: 1.2;
  min-height: 100vh;
}

html {
  /* Keeps body background from being hoisted to canvas in Chrome */
  background: #FFF;
}

body {
  font-size: 102.5%;
  color: hsl(33, 50%, 10%);
  background:
    linear-gradient(180deg, rgba(255,128,0,0.033), 3em, rgba(255,216,0,0) 33em),
    linear-gradient(
      90deg,
      hsla(34, 0%, 96%, 0.98) 5%, 10%,
      hsla(34, 38%, 99%, 0.95) 25%, 33%,
      hsla(34, 38%, 99%, 1) 50%, 67%,
      hsla(34, 38%, 99%, 0.975) 75%, 90%,
      hsla(34, 0%, 96%, 0.98) 95%
    ) 0 0 / 100% 100% no-repeat,
    hsla(34, 38%, 99%, 1);
}

@media (min-width: 40em) {
  body {
    background:
      linear-gradient(180deg, rgba(255,128,0,0.033), 3em, rgba(255,216,0,0) 33em),
      linear-gradient(
        90deg,
        hsla(34, 0%, 96%, 0.98) 5%, 10%,
        hsla(34, 38%, 99%, 0.95) 25%, 33%,
        hsla(34, 38%, 99%, 1) 50%, 67%,
        hsla(34, 38%, 99%, 0.975) 75%, 90%,
        hsla(34, 0%, 96%, 0.98) 95%
      ) 0 0 / 100% 100% no-repeat,
      /* url(https://meyerweb.com/ui/i/hamonshu/bg-waves.png) 0 0, */
      /* url(https://meyerweb.com/ui/i/hamonshu/bg-waves.png) 250px -50px, */
      hsla(34, 38%, 99%, 1);
  }
}

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Eczar', 'IM Fell English', Georgia, serif;
  font-weight: 500;
  line-height: 1.2;
  margin: 1.5em 0 0.5em;
}

h2 { font-size: 200%; }
h3 { font-size: 167%; }
h4 { font-size: 133%; }
h5 { font-size: 115%; }
h6 { font-size: 100%; }

h1 {
  font-family: 'IM Fell English', 'Eczar', Georgia, serif;
  font-size: 400%;
  line-height: 1.1;
  margin: 0.67em 0 0.67em -0.1em;
}

@media (max-width: 40em) { h1 { font-size: 300%; } }
@media (max-width: 30em) { h1 { font-size: 250%; } }

a[href] {
  text-decoration-thickness: 0.03875em;
  text-underline-offset: 0.2em;
  text-decoration-color: hsl(13, 13%, 67%);
  color: hsl(13, 33%, 42%);
}

a[href]:hover {
  text-decoration-thickness: 0.125em;
  text-underline-offset: 0.15em;
  text-decoration-color: currentColor;
  color: hsl(33, 99%, 33%);
}

h1 a[href], h2 a[href], h3 a[href] {
  text-decoration-color: currentColor;
}

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

p {
  line-height: 1.5;
  margin: 0 0 1em;
}

/* ============================================================
   Layout — CSS Grid (desktop)
   ============================================================ */

body > #main {
  padding-top: 2em;
  padding-left: 1em;
  padding-right: 1em;
  line-height: 1.45;
}

@media (min-width: 40em) {
  body {
    display: grid;
    grid-template-columns: [left] minmax(1em, 1fr) [main] minmax(10em, 40em) [right] minmax(10em, 1fr);
    grid-template-rows: repeat(4, min-content) auto repeat(4, min-content);
    gap: 0 2em;
  }

  body > * {
    grid-column: 1 / -1;
  }

  body > #main {
    grid-column: main;
    padding: 3em 0 0;
  }
}

/* ============================================================
   Header (#sitemast)
   TEMP: images hotlinked from meyerweb.com — replace with own assets
   ============================================================ */

#sitemast {
  grid-column: 1 / -1;
  grid-row: 1;
  /* background: url(/assets/images/header-left.png) 0 100% / auto 50% no-repeat; */
  min-height: 6em; /* was 13em — restore when header images re-enabled */
  position: relative;
  mix-blend-mode: darken;
}

@media (min-width: 30em) {
  #sitemast {
    background:
      /* url(/assets/images/header-left.png) 0 100% / 45% auto no-repeat, */
      /* url(/assets/images/header-right.png) 100% 100% / 45% auto no-repeat, */
      linear-gradient(hsla(34, 38%, 99%, 0.5), hsla(34, 38%, 99%, 0.8));
    min-height: 4em; /* was 9em — restore when header images re-enabled */
  }
}

@media (min-width: 40em) {
  #sitemast {
    min-height: 7vw; /* was 16vw — restore when header images re-enabled */
  }
}

/* Skip links (visually hidden, appear on focus) */
#skiplinks {
  position: absolute;
  bottom: 1.5vh;
  left: -51em;
  width: 10em;
}

#skiplinks a {
  display: block;
  background: black;
  color: white;
  margin: 3px;
  padding: 0.25em;
  transition: 150ms;
}

#skiplinks a:focus { background: #060; }
#skiplinks a:focus,
#skiplinks a:focus ~ a,
#skiplinks:focus-within a { transform: translate(52em); }

/* Site title */
#sitemast h1 {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  position: absolute;
}

#sitemast a[href="/"] {
  box-sizing: border-box;
  position: absolute;
  height: 97%;
  width: 100%;
  padding: 0 0.1em 0 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  font-family: 'IM Fell English', 'Eczar', Georgia, serif;
  font-style: italic;
  font-size: 2rem;
  font-weight: 100;
  text-decoration: none;
  color: inherit;
  line-height: 1;
  opacity: 0.75;
}

@media (min-width: 30em) {
  #sitemast h1 {
    width: 50%;
    left: 50%;
  }
}

@media (min-width: 40em) {
  #sitemast a[href="/"] {
    font-size: 5vw;
    height: 100%;
  }
}

/* ============================================================
   Navigation (#navigate)
   ============================================================ */

/* Mobile: overlay at top of page, centered links */
#navigate {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 42;
  font-size: 1.125em;
}

#navlinks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 1em 1em 0;
  margin: 0;
  list-style: none;
  font-family: 'IM Fell English', Georgia, serif;
}

#navlinks li {
  text-align: center;
  padding: 0.25em 0.5em;
}

#navlinks a[href] {
  display: block;
  padding: 0;
  color: hsla(33, 50%, 10%, 0.75);
  text-decoration: none;
}

#navlinks a[href]:hover {
  color: hsl(33, 99%, 33%);
}

/* Active nav highlight — mobile */
body.work   #navlinks #workLink a,
body.arch   #navlinks #archLink a,
body.about  #navlinks #aboutLink a {
  font-weight: 600;
  font-style: normal;
  text-decoration: underline;
}

/* Desktop: sticky right-column nav */
@media (min-width: 40em) {
  #navigate {
    position: sticky;
    top: 0;
    grid-column: right;
    grid-row: 2;
    background: radial-gradient(ellipse 10em 8em at 100% 45%, hsl(34 38% 98%) 25%, hsla(34 38% 98% / 0) 75%);
    text-shadow:
      hsl(34 38% 98%) 0 0 1em,
      hsl(34 38% 98%) 0 0 1em,
      hsl(34 38% 98%) 0 0 1em,
      hsl(34 38% 98%) 0 0 1em;
  }

  #navlinks {
    display: block;
    padding: 0;
    margin-bottom: 2.5em;
  }

  #navlinks li {
    text-align: right;
    padding: 0.25em 1em;
  }

  /* Active nav highlight — desktop */
  body.work   #navlinks #workLink a,
  body.arch   #navlinks #archLink a,
  body.about  #navlinks #aboutLink a {
    font-weight: 600;
    font-style: normal;
    text-decoration: underline;
  }
}

/* ============================================================
   Footer (#global)
   TEMP: images hotlinked from meyerweb.com — replace with own assets
   ============================================================ */

footer#global {
  grid-column: 1 / -1;
  clear: both;
  margin-top: 2.5em;
  padding: 0;
  font-family: 'Eczar', 'IM Fell English', Georgia, serif;
  font-size: 95%;
}

footer#global::before {
  content: "";
  display: block;
  border-top: 1px solid hsla(13, 33%, 42%, 0.3);
  margin: 0 2em;
}

footer#global > div {
  padding: 2em 3em 3em;
  text-align: center;
}

/* Social icons */
#social ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  margin: 0 0 1em;
  padding: 0;
  gap: 2em;
}

#social a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: hsl(33, 50%, 10%);
  text-decoration: none;
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 1.05em;
  transition: color 100ms;
}

#social a:hover {
  color: hsl(33, 99%, 33%);
}

#social svg {
  fill: currentColor;
  flex-shrink: 0;
}

.copyright {
  font-size: 0.85em;
  color: hsl(33, 20%, 40%);
  margin: 0;
}

/* ============================================================
   Work Examples
   ============================================================ */

.work-examples {
  margin-top: 2em;
}

.work-item {
  margin-bottom: 4em;
  padding-bottom: 4em;
  border-bottom: 1px solid hsla(33, 20%, 40%, 0.2);
}

.work-item:last-child {
  border-bottom: none;
}

.work-item img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid hsla(33, 20%, 40%, 0.15);
}

.work-item-body {
  margin-top: 1.5em;
}

.work-item-body h3 {
  font-family: 'Eczar', 'IM Fell English', Georgia, serif;
  font-size: 133%;
  margin: 0 0 0.25em;
}

.work-meta {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 0.9em;
  color: hsl(13, 33%, 42%);
  margin: 0 0 0.75em;
}

.work-item-body p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   Link Cards — reusable navigation block component
   Inspired by build.ms/blog/ card layout
   ============================================================ */

.link-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5em;
  margin-top: 2em;
}

.link-card {
  position: relative;
  border: 1px solid hsla(33, 20%, 40%, 0.25);
  transition: background 150ms ease, border-color 150ms ease;
}

.link-card:hover {
  background: hsla(34, 50%, 94%, 0.7);
  border-color: hsla(33, 20%, 40%, 0.45);
}

.link-card-body {
  padding: 1.4em 1.5em 1.25em;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.link-card-title {
  font-family: 'Eczar', 'IM Fell English', Georgia, serif;
  font-size: 115%;
  font-weight: 500;
  margin: 0 0 0.4em;
  line-height: 1.25;
}

/* Stretch the title link to cover the whole card */
.link-card-title a {
  text-decoration: none;
  color: hsl(33, 50%, 10%);
}

.link-card-title a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.link-card-title a:hover {
  color: hsl(33, 50%, 10%);
}

.link-card-meta {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 0.85em;
  color: hsl(13, 33%, 42%);
  margin: 0 0 0.75em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.meta-sep {
  color: hsla(33, 20%, 40%, 0.5);
  font-style: normal;
}

.link-card-description {
  font-size: 0.9em;
  line-height: 1.5;
  color: hsl(33, 30%, 25%);
  margin: 0 0 1.25em;
  flex-grow: 1;
}

.link-card-footer {
  margin-top: auto;
}

.link-card-cta {
  position: relative;
  z-index: 1;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 0.9em;
  color: hsl(13, 33%, 42%);
  text-decoration: none;
  transition: color 100ms;
}

.link-card-cta:hover {
  color: hsl(33, 99%, 33%);
}

@media (max-width: 40em) {
  .link-cards {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Post / Article pages
   ============================================================ */

.post-header {
  margin-bottom: 2em;
  padding-bottom: 1em;
  border-bottom: 1px solid hsla(33, 20%, 40%, 0.2);
}

.post-title {
  font-family: 'IM Fell English', 'Eczar', Georgia, serif;
  font-size: 200%;
  margin: 0 0 0.4em;
  line-height: 1.15;
}

.post-meta-line {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 0.9em;
  color: hsl(13, 33%, 42%);
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.1em;
}

.post-tag {
  font-style: normal;
  font-size: 0.85em;
  background: hsla(34, 50%, 88%, 0.6);
  border: 1px solid hsla(33, 20%, 40%, 0.2);
  padding: 0.1em 0.45em;
  font-family: 'Eczar', Georgia, serif;
  color: hsl(33, 40%, 30%);
}

.post-body {
  line-height: 1.6;
}

.post-body h3 {
  font-family: 'Eczar', 'IM Fell English', Georgia, serif;
  font-size: 133%;
  margin: 2em 0 0.5em;
}

.post-body ul, .post-body ol {
  padding-left: 1.5em;
  margin: 0 0 1em;
}

.post-body li {
  margin-bottom: 0.4em;
  line-height: 1.5;
}

.post-footnote {
  font-size: 0.88em;
  font-style: italic;
  color: hsl(33, 30%, 40%);
  border-left: 2px solid hsla(33, 20%, 40%, 0.3);
  padding-left: 1em;
  margin: 1.5em 0;
}

.post-origin {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 0.88em;
  color: hsl(33, 30%, 45%);
  margin: 0 0 1.5em;
}

.post-figure {
  margin: 2em 0;
}

.post-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid hsla(33, 20%, 40%, 0.15);
}

.post-figure figcaption {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 0.85em;
  color: hsl(33, 20%, 45%);
  margin-top: 0.5em;
}

pre.prompt-example {
  font-family: Georgia, serif;
  font-size: 0.88em;
  line-height: 1.55;
  background: hsla(34, 38%, 96%, 0.8);
  border: 1px solid hsla(33, 20%, 40%, 0.2);
  border-left: 3px solid hsl(13, 33%, 42%);
  padding: 1.25em 1.5em;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  margin: 1em 0 1.5em;
  color: hsl(33, 40%, 15%);
  border-radius: 0;
}
