/* ==========================================
   0) Root + Reset
   ========================================== */
html {
  font-size: clamp(87.5%, 85% + 0.5vw, 100%);
  -webkit-text-size-adjust: 100%;
}

:root {
  --font-serif: "Gowun Batang";

  --color-bg: #f4f1ea;
  --color-bg-footer: #ffffff;
  --color-text: #1a1611;
  --color-heading-hover: #c75c33;
  --color-h3: #6b6358;
  --color-h4: #938b7e;
  --color-link: #c75c33;
  --color-link-hover: #b04e29;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1714;
    --color-bg-footer: #0c0b0a;
    --color-text: #f5f2ea;
    --color-heading-hover: #e58a60;
    --color-h3: #8d887e;
    --color-h4: #6a665d;
    --color-link: #d97a4f;
    --color-link-hover: #e58a60;
  }
}


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  line-height: 1.6;
  font-family: var(--font-serif);
  font-kerning: normal;
  font-weight: 400;
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
  text-rendering: optimizeLegibility;
  hyphens: auto;
  text-align: justify;
  background: var(--color-bg);
  color: var(--color-text);
}

main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

.spacer {
  height: 50vh;
  background: linear-gradient(to bottom, var(--color-bg) 0%, var(--color-bg-footer) 100%);
}

/* ==========================================
   1) Headings & basic text
   ========================================== */

h1, h2, h3, h4 {
	margin: 2rem 0 1rem;
	line-height: 1.25;
	font-family: var(--font-serif);
	font-weight: 700;
	color: var(--color-text);
}

h2, h3, h4 {
  border-bottom: 2px solid;
  display: inline-block;
}

h1 { 
  font-size: 1.5rem;   /* 24px */ 
}
h2 { 
  font-size: 1.25rem;  /* 20px */ 
}
h3 { 
  font-size: 1.125rem; /* 18px */ 
  color: var(--color-h3);
}
h4 { 
  font-size: 1.125rem;     /* 18px */
  color: var(--color-h4);
}

h1 a, h2 a, h3 a, h4 a {
  color: inherit;
  text-decoration: none;
}

h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover {
  color: var(--color-heading-hover);
}

p { font-size: 1rem; margin: 0 0 1rem; }

strong, b { font-weight: 700; }

em, i { font-style: italic; }

hr {
  border: 0;
  border-top: 1px solid;
  margin: 2rem 0;
}

footer {
  background: var(--color-bg-footer);
  padding: 1.5rem 1rem;
  text-align: center;
}

/* ==========================================
   2) Links, lists
   ========================================== */

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

a:hover { color: var(--color-link-hover); }

a:focus, a:hover { outline: none; }

ul, ol {
  margin: 0 0 1rem 1.5rem;
  padding: 0;
}

li { margin: 0.25rem 0; }

/* ==========================================
   3) Images
   ========================================== */

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

.video-container {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-bottom: 1rem;
}

.video-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ==========================================
   4) Widows/orphans, print
   ========================================== */

p, ul, ol {
  widows: 2;
  orphans: 2;
}

/* ==========================================
   5) Web-only niceties
   ========================================== */

@media screen {
  html { scroll-behavior: smooth; }

  h1, h2, h3, h4, h5, h6 {
    scroll-margin-top: 20px;
  }
}