:root {
  --paper: #f4efe6;
  --ink: #1c241c;
  --copper: #9c5a32;
  --line: #e2d8c8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: hidden; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Figtree, sans-serif;
  line-height: 1.65;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--copper); }
h1, h2, h3 { font-family: Literata, serif; font-weight: 560; letter-spacing: -0.02em; line-height: 1.15; }
.grain {
  position: fixed;
  inset: -40px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  background-image: radial-gradient(rgba(28, 36, 28, 0.08) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
  animation: grain 14s linear infinite;
}
.head {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 239, 230, 0.92);
  overflow: hidden;
}
.crest {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: Literata, serif;
  font-size: 1.25rem;
}
.crest img {
  width: 42px;
  height: 42px;
  animation: sway 7s ease-in-out infinite;
}
.head nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.head nav a { color: var(--ink); text-decoration: none; }
.col {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 36px;
}
.gate {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 28px;
  align-items: center;
  padding: 42px 0 12px;
}
.gate h1 { font-size: clamp(2rem, 4vw, 3.3rem); margin-top: 0; }
.torn {
  overflow: hidden;
  clip-path: polygon(0 6%, 100% 0, 100% 94%, 0 100%);
}
.torn img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.btn {
  display: inline-flex;
  margin-top: 8px;
  padding: 11px 14px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-radius: 2px;
  border: 0;
  cursor: pointer;
  font: inherit;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
.chapter {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.num {
  font-family: Literata, serif;
  font-size: 1.8rem;
  color: var(--copper);
}
.roles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 18px;
}
.roles article {
  border: 1px solid var(--line);
  padding: 12px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.35);
}
.wide img { width: 100%; aspect-ratio: 16/9; object-fit: cover; margin: 8px 0 18px; }
.links { padding-bottom: 10px; }
.links a { display: inline-block; margin: 0 18px 8px 0; }
.dark {
  position: relative;
  z-index: 1;
  background: var(--ink);
  color: #efe8dc;
  padding: 32px 20px 18px;
}
.dark a { color: #e2b089; }
.dark-in {
  width: min(920px, calc(100% - 8px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.dark .crest { color: #efe8dc; }
.dark ul { list-style: none; padding: 0; margin: 0; }
.dark .crest img { animation: none; width: 36px; height: 36px; }
.year { width: min(920px, calc(100% - 8px)); margin: 14px auto 0; color: #b7b1a4; }
.samtykke {
  position: fixed;
  z-index: 5;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: var(--ink);
  color: #efe8dc;
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.samtykke p { margin: 0; max-width: 36rem; }
.samtykke a { color: #e2b089; }
.samtykke .btn { background: #efe8dc; color: var(--ink); }
.quiet {
  background: transparent;
  color: #efe8dc;
  border: 1px solid #efe8dc;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}
@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}
@keyframes grain {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-12px, 8px, 0); }
}
@media (max-width: 800px) {
  .gate, .chapter, .roles, .dark-in { grid-template-columns: 1fr; }
  .num { font-size: 1.3rem; }
  .torn { clip-path: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
