/* Yrkingar eftir Rúna Thomsen */

:root {
  --bg: #f5f2ed;
  --surface: #fbf9f6;
  --ink: #232224;
  --muted: #6d6a67;
  --line: #e2ddd5;
  --rose: #b1555d;
  --rose-soft: #b1555d1a;
  --hero-bg: #1c1c1e;
  --hero-ink: #efebe6;
  --shadow: 0 1px 2px #0000000d, 0 8px 24px #00000012;

  --t-sorg: #7a6f93;
  --t-familja: #b1555d;
  --t-natura: #5c8468;
  --t-hatidir: #b08638;
  --t-samfelag: #4f7699;
  --t-livid: #8a7a68;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --poem-size: 1.5rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161617; --surface: #1f1f21; --ink: #ebe7e2; --muted: #9c9894; --line: #302f31;
    --rose: #d58088; --rose-soft: #d580881f; --shadow: 0 1px 2px #0000004d, 0 10px 30px #00000059;
    --t-sorg: #a99cc8; --t-familja: #d58088; --t-natura: #88b594; --t-hatidir: #d6ad62; --t-samfelag: #7fa6c9; --t-livid: #b8a792;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161617; --surface: #1f1f21; --ink: #ebe7e2; --muted: #9c9894; --line: #302f31;
  --rose: #d58088; --rose-soft: #d580881f; --shadow: 0 1px 2px #0000004d, 0 10px 30px #00000059;
  --t-sorg: #a99cc8; --t-familja: #d58088; --t-natura: #88b594; --t-hatidir: #d6ad62; --t-samfelag: #7fa6c9; --t-livid: #b8a792;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--rose); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 720px; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; border-radius: 4px; }

.t-sorg { --tc: var(--t-sorg); } .t-familja { --tc: var(--t-familja); } .t-natura { --tc: var(--t-natura); }
.t-hatidir { --tc: var(--t-hatidir); } .t-samfelag { --tc: var(--t-samfelag); } .t-livid { --tc: var(--t-livid); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--tc, var(--muted)); margin-right: 7px; vertical-align: middle; position: relative; top: -1px; }

.eyebrow { font: 600 .72rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--rose); margin: 0 0 18px; }

/* ---------- topbar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 50; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: background .3s, border-color .3s, color .3s;
}
.home .topbar:not(.scrolled) { background: transparent; border-color: transparent; color: var(--hero-ink); backdrop-filter: none; }
.brand { text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-y { font: italic 500 1.5rem/1 var(--serif); }
.brand-by { font: 300 .8rem/1 var(--sans); opacity: .75; margin-left: 4px; }
.topnav { display: flex; align-items: center; gap: clamp(10px, 3vw, 26px); }
.topnav a { font-size: .85rem; text-decoration: none; opacity: .85; }
.topnav a:hover { opacity: 1; color: var(--rose); }
.mode { background: none; border: 1px solid currentColor; color: inherit; border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; opacity: .75; }
.mode:hover { opacity: 1; }
@media (max-width: 520px) { .brand-by { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center;
  background: var(--hero-bg); color: var(--hero-ink); overflow: hidden;
  padding: 96px 0 72px;
}
.hero-bg {
  position: absolute; inset: -10%;
  background:
    radial-gradient(60% 50% at 75% 45%, #5a5a5e66, transparent 70%),
    radial-gradient(40% 40% at 20% 80%, #b1555d22, transparent 70%),
    linear-gradient(160deg, #1a1a1c, #2b2b2e 60%, #1a1a1c);
  animation: drift 24s ease-in-out infinite alternate;
}
.hero-bg::after { /* fínt korn */
  content: ""; position: absolute; inset: 0; opacity: .08; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift { to { transform: translate3d(3%, -2%, 0) scale(1.05); } }

.hero-inner {
  position: relative; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 90px); align-items: center;
}
.hero .eyebrow { color: #d58088; animation: rise .9s .1s both; }
.hero-title {
  font: italic 400 clamp(4.2rem, 13vw, 9.5rem)/.9 var(--serif);
  margin: 0; letter-spacing: -.02em; color: #d58088;
  animation: rise 1.1s .2s both;
}
.hero-author { font: 300 clamp(1.15rem, 2.6vw, 1.6rem)/1.3 var(--sans); margin: 14px 0 0; letter-spacing: .02em; animation: rise 1s .45s both; }
.hero-tag { margin: 34px 0 0; display: flex; flex-direction: column; gap: 2px; font: italic 300 clamp(1.05rem, 2vw, 1.3rem)/1.45 var(--sans); color: #bdb8b2; }
.hero-tag span { animation: rise 1s both; }
.hero-tag span:nth-child(1) { animation-delay: .7s; padding-left: 0; }
.hero-tag span:nth-child(2) { animation-delay: .9s; padding-left: 1.4em; }
.hero-tag span:nth-child(3) { animation-delay: 1.1s; padding-left: 2.8em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; animation: rise 1s 1.3s both; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border-radius: 999px; text-decoration: none; font: 600 .9rem/1 var(--sans); letter-spacing: .02em; transition: transform .2s, background .2s, color .2s, border-color .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: #c9737a; color: #1c1c1e; }
.btn-primary:hover { background: #dc8a91; }
.btn-ghost { border: 1px solid #ffffff40; color: var(--hero-ink); }
.btn-ghost:hover { border-color: #d58088; color: #d58088; }
.notfound .btn-primary { color: #1c1c1e; }

.hero-cover { margin: 0; justify-self: center; perspective: 1400px; animation: coverIn 1.4s .3s both; }
.hero-cover img {
  width: min(360px, 100%); height: auto; border-radius: 3px 8px 8px 3px;
  box-shadow: -1px 0 0 #ffffff14 inset, 0 30px 60px #00000080, 0 10px 20px #00000066;
  transform: rotateY(-14deg) rotateX(3deg); transition: transform .8s cubic-bezier(.2,.7,.2,1);
}
.hero-cover:hover img { transform: rotateY(-4deg) rotateX(1deg) translateY(-6px); }
@keyframes coverIn { from { opacity: 0; transform: translateY(40px); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.scroll-cue { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: 24px; height: 38px; border: 1px solid #ffffff55; border-radius: 12px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 3px; height: 7px; margin-left: -1.5px; background: #d58088; border-radius: 2px; animation: cue 1.8s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

@media (max-width: 820px) {
  .hero { padding-top: 88px; }
  .hero-inner { grid-template-columns: 1fr; text-align: left; }
  .hero-cover { order: -1; justify-self: start; }
  .hero-cover img { width: min(170px, 42vw); transform: rotate(-3deg); }
  .hero-tag { margin-top: 24px; }
  .hero-cta { margin-top: 28px; }
  .scroll-cue { display: none; }
}

/* ---------- dagsins yrking ---------- */
.today { padding: clamp(72px, 12vw, 140px) 0; text-align: center; border-bottom: 1px solid var(--line); }
.today-quote { margin: 0 auto; max-width: 760px; font: italic 400 clamp(1.6rem, 4vw, 2.5rem)/1.35 var(--serif); position: relative; }
.today-quote::before { content: "“"; display: block; font: 400 5rem/0.6 var(--serif); color: var(--rose); opacity: .5; margin-bottom: 18px; }
.today-quote span { display: block; }
.today-meta { margin: 32px 0 0; }
.today-link { color: var(--rose); text-decoration: none; font-size: .95rem; border-bottom: 1px solid transparent; }
.today-link:hover { border-color: currentColor; }

/* ---------- savnið ---------- */
.collection { padding: clamp(56px, 9vw, 100px) 0 110px; }
.collection-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.collection-head h2 { font: italic 400 clamp(2.4rem, 6vw, 3.6rem)/1 var(--serif); margin: 0; }
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 48px; padding: 0 16px 0 44px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 400 1rem var(--sans); transition: border-color .2s, box-shadow .2s;
}
.search input:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 4px var(--rose-soft); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 36px; }
.chip {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); text-decoration: none;
  font-size: .85rem; white-space: nowrap; transition: border-color .2s, background .2s, color .2s;
}
.chip small { margin-left: 7px; color: var(--muted); font-size: .75rem; }
.chip:hover { border-color: var(--tc, var(--rose)); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.on small { color: inherit; opacity: .7; }
@media (max-width: 600px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 28px; padding: 0 16px 6px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
}

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.card a {
  position: relative; display: flex; flex-direction: column; height: 100%;
  padding: 26px 24px 22px; border-radius: 14px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s, border-color .35s;
  overflow: hidden;
}
.card a::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tc); transform: scaleY(0); transform-origin: top; transition: transform .35s; }
.card a:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card a:hover::before { transform: scaleY(1); }
.card-nr { font: 500 .8rem/1 var(--serif); color: var(--muted); letter-spacing: .1em; }
.card-title { font: 500 1.55rem/1.15 var(--serif); margin: 10px 0 12px; }
.card-title.untitled { font-style: italic; font-weight: 400; }
.card-excerpt { margin: 0 0 20px; color: var(--muted); font: italic 400 1.08rem/1.45 var(--serif); flex: 1; }
.card-excerpt span { display: block; }
.card-meta { font-size: .75rem; color: var(--muted); letter-spacing: .02em; }
.card.reveal { opacity: 0; transform: translateY(16px); }
.card.reveal.in { opacity: 1; transform: none; transition: opacity .6s, transform .6s; }
.empty { text-align: center; color: var(--muted); font: italic 1.3rem var(--serif); padding: 40px 0; }

/* ---------- yrking ---------- */
.reading main { padding-top: 60px; }
.poem-page { padding: clamp(40px, 8vw, 80px) 0 40px; }
.back { font-size: .85rem; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--rose); }
.poem-head { margin: 40px 0 44px; }
.poem-nr { font: 600 .72rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--tc, var(--rose)); margin: 0 0 16px; }
.poem-title { font: 500 clamp(2.4rem, 7vw, 3.8rem)/1.05 var(--serif); margin: 0; letter-spacing: -.01em; }
.poem-title.untitled { font-style: italic; font-weight: 400; }
.poem-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 20px 0 0; font-size: .85rem; color: var(--muted); }
.tag { text-decoration: none; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; }
.tag:hover { border-color: var(--tc); }
.poem { font: 400 var(--poem-size)/1.6 var(--serif); position: relative; padding-left: clamp(0px, 3vw, 28px); border-left: 1px solid var(--line); }
.stanza { margin: 0 0 1.35em; animation: rise .8s both; animation-delay: calc(var(--d) * .12s + .1s); }
.line { display: block; padding-left: 1.2em; text-indent: -1.2em; }
.poem-note { margin: 34px 0 0; font: italic 400 1.1rem/1.5 var(--serif); color: var(--muted); }
.signature { margin: 40px 0 0; font: italic 400 1.3rem var(--serif); color: var(--tc, var(--rose)); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 48px 0 0; }
.tool { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; min-height: 38px; padding: 0 16px; font: 400 .82rem var(--sans); cursor: pointer; }
.tool:hover { border-color: var(--rose); color: var(--rose); }

.pager { max-width: 1180px; margin: 70px auto 0; padding: 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pager-link { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; transition: border-color .25s, transform .25s; min-width: 0; }
.pager-link:hover { border-color: var(--rose); transform: translateY(-2px); }
.pager-link small { color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.pager-link span { font: italic 400 1.3rem/1.25 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager-link.next { text-align: right; grid-column: 2; }
@media (max-width: 600px) {
  .pager { grid-template-columns: 1fr; }
  .pager-link.next { grid-column: 1; }
}
.notfound { text-align: center; padding: 80px 16px; }
.notfound h1 { font: italic 400 3rem var(--serif); margin: 0 0 30px; }

/* ---------- fótur ---------- */
.site-footer { background: var(--hero-bg); color: #bdb8b2; padding: 56px 16px; text-align: center; }
.foot-title { font: 400 1.5rem var(--serif); color: var(--hero-ink); margin: 0; }
.foot-title em { color: #d58088; }
.foot-tag { font: italic 300 .95rem var(--sans); margin: 8px 0 22px; }
.foot-copy { font-size: .75rem; opacity: .6; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .topbar, .site-footer, .tools, .pager, .back, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  .reading main { padding: 0; }
  .poem { border: 0; padding: 0; font-size: 14pt; }
  .stanza { animation: none; }
}
.foot-copy a { color: inherit; }
