/* ============================================================
   sprikl — útlit
   Allt CSS býr hér. Engin <style> tög í HTML.
   ============================================================ */

:root {
  /* riso / zine litir */
  --pappir:   #F2ECDD;   /* hlýr pappír */
  --blek:     #15171F;   /* næstum svart */
  --blatt:    #2B43E0;   /* riso blátt */
  --korall:   #FF5A4D;   /* heitt korall */
  --gult:     #FFC93D;   /* gult */
  --graent:   #1FAE7C;   /* grænt */

  --skuggi:   8px 8px 0 var(--blek);
  --skuggi-sm: 4px 4px 0 var(--blek);

  --max: 1200px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--pappir);
  color: var(--blek);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  /* fínn pappírs-grain */
  background-image:
    radial-gradient(rgba(21,23,31,0.035) 1px, transparent 1px);
  background-size: 4px 4px;
}

body.laest { overflow: hidden; }

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

a { color: inherit; }

code {
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.85em;
  background: rgba(21,23,31,0.07);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

:focus-visible {
  outline: 3px solid var(--blatt);
  outline-offset: 3px;
}

/* ---------------- Haus ---------------- */

.haus {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.merki {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(34px, 6vw, 54px);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
}
.merki b { color: var(--blatt); font-weight: 800; }

.haus__undir {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.7;
}

/* ---------------- Hero ---------------- */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 24px 8px;
}

.hero__fyrirsogn {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(40px, 8.5vw, 92px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
  max-width: 14ch;
}
.hero__fyrirsogn em { font-style: normal; color: var(--korall); }

.hero__texti {
  font-size: clamp(17px, 2.2vw, 21px);
  max-width: 46ch;
  margin: 0 0 26px;
  opacity: 0.85;
}

/* spriklið — kvik svigðlína */
.spriklid { display: block; width: min(420px, 80%); height: auto; margin: 4px 0 30px; }
.spriklid path {
  fill: none;
  stroke: var(--blatt);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: teikna 1.6s ease forwards 0.2s, vagga 6s ease-in-out infinite 2s;
}
@keyframes teikna { to { stroke-dashoffset: 0; } }
@keyframes vagga  { 0%,100% { transform: rotate(-0.6deg); } 50% { transform: rotate(0.6deg); } }

/* ---------------- Síu-rönd ---------------- */

.sturod {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 24px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(var(--pappir) 70%, rgba(242,236,221,0));
}

.sturod__merki {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.55;
}

#siur { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 15px;
  border: 2px solid var(--blek);
  border-radius: 999px;
  background: var(--pappir);
  color: var(--blek);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.chip:hover { transform: translateY(-2px); }
.chip--virk { background: var(--blek); color: var(--pappir); }

.talning {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.5;
}

/* ---------------- Veggurinn (masonry) ---------------- */

.veggur {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4px 24px 80px;
  column-count: 3;
  column-gap: 26px;
}
@media (max-width: 900px) { .veggur { column-count: 2; } }
@media (max-width: 560px) { .veggur { column-count: 1; } }

.tomur {
  text-align: center;
  font-size: 18px;
  opacity: 0.7;
  padding: 60px 0;
}

.spjald {
  break-inside: avoid;
  margin: 0 0 26px;
  background: #fff;
  border: 2.5px solid var(--blek);
  box-shadow: var(--skuggi-sm);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.spjald:hover,
.spjald:focus-visible {
  transform: rotate(0deg) translateY(-4px) !important;
  box-shadow: var(--skuggi);
}

/* föst halli — víxlast en hoppar ekki við hverja hleðslu */
.tilt-0 { transform: rotate(-1.8deg); }
.tilt-1 { transform: rotate(1.4deg); }
.tilt-2 { transform: rotate(-0.8deg); }
.tilt-3 { transform: rotate(2.1deg); }
.tilt-4 { transform: rotate(-2.4deg); }

.spjald__mynd { position: relative; background: var(--pappir); }
.spjald__mynd img { width: 100%; height: auto; }

/* þegar mynd finnst ekki */
.spjald__mynd--vantar {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  background: repeating-linear-gradient(45deg, var(--pappir), var(--pappir) 10px, #e9e2cf 10px, #e9e2cf 20px);
  text-align: center;
}
.vantar-merki { font-weight: 700; color: var(--korall); }
.vantar-slod  { font-size: 12px; word-break: break-all; }

.spjald__texti {
  padding: 12px 14px 14px;
  border-top: 2.5px solid var(--blek);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.spjald__titill {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.spjald__hofundur { font-size: 13px; font-weight: 500; opacity: 0.6; }

/* ---------------- Stóra myndin ---------------- */

.stora {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(21,23,31,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.stora[hidden] { display: none; }

.stora__inni {
  background: var(--pappir);
  border: 3px solid var(--blek);
  box-shadow: var(--skuggi);
  max-width: 920px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
}
@media (max-width: 700px) { .stora__inni { grid-template-columns: 1fr; } }

.stora__myndhol {
  background: #fff;
  border-right: 3px solid var(--blek);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
@media (max-width: 700px) { .stora__myndhol { border-right: none; border-bottom: 3px solid var(--blek); } }
.stora__myndhol img { width: 100%; height: auto; max-height: 78vh; object-fit: contain; }

.stora__texti { padding: 26px; position: relative; }
#stora-titill {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.04;
  margin: 0 0 4px;
}
#stora-hofundur { font-size: 15px; font-weight: 600; color: var(--blatt); margin: 0 0 16px; }
#stora-lysing { font-size: 16px; line-height: 1.55; margin: 0 0 20px; }
#stora-lysing[hidden] { display: none; }

.stora__hlekkur {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  padding: 9px 18px;
  background: var(--gult);
  border: 2.5px solid var(--blek);
  box-shadow: var(--skuggi-sm);
}
.stora__hlekkur[hidden] { display: none; }

.stora__loka {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 2.5px solid var(--blek);
  background: var(--korall);
  color: var(--blek);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border-radius: 999px;
}

/* ---------------- Fótur ---------------- */

.fotur {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 24px 50px;
  border-top: 2px dashed rgba(21,23,31,0.25);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  opacity: 0.7;
}

/* ---------------- Hreyfing af ---------------- */

@media (prefers-reduced-motion: reduce) {
  .spriklid path { animation: none; stroke-dashoffset: 0; }
  .spjald { transition: none; }
  .chip { transition: none; }
}
