/* ingimarthor.is — léttari útgáfa. Sömu grunnlitir (dökkblár og appelsínubrúnn), meira loft og smá glettni. */
:root {
  --bg: #fffaf1;
  --paper: #ffffff;
  --ink: #13273a;
  --text: #3d4654;
  --muted: #5d6877;
  --orange: #c8721a;
  --orange-ink: #9c4d0b;
  --sun: #ffd76e;
  --mint: #c4ead8;
  --sky: #d3e8ff;
  --blush: #ffd9cc;
  --radius: 18px;
  --shadow: 5px 5px 0 var(--ink);
  --font-display: "Fraunces", "Crimson Text", Georgia, serif;
  --font-body: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  --font-hand: "Caveat", "Segoe Print", cursive;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 1.06rem; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--orange-ink); text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--sun); }
a:hover { color: var(--ink); text-decoration-color: var(--orange); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* Haus */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 250, 241, .92); backdrop-filter: blur(8px); border-bottom: 2px solid var(--ink); }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; max-width: 1080px; margin: 0 auto; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--ink); object-fit: cover; object-position: 50% 22%; transition: transform .3s; }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }
.brand b { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.nav a { display: block; padding: 6px 14px; border-radius: 999px; border: 2px solid transparent; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .98rem; }
.nav a:hover { background: var(--sun); border-color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }

/* Fyrirsögn síðu */
.hero { padding: 64px 0 40px; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); }
.hero h1 em { font-style: italic; color: var(--orange-ink); }
.lede { font-size: 1.25rem; max-width: 46rem; margin: 18px 0 0; color: var(--text); }
.hand { font-family: var(--font-hand); font-size: 1.55rem; line-height: 1.15; color: var(--orange-ink); display: inline-block; transform: rotate(-2deg); }
.hand--block { display: block; margin-top: 10px; }
.squiggle { background: linear-gradient(transparent 62%, var(--sun) 62%); padding: 0 .1em; }

/* Forsíða */
.home-hero { display: grid; grid-template-columns: 1.4fr .8fr; gap: 40px; align-items: center; padding: 64px 0 36px; }
.portrait { position: relative; justify-self: center; width: min(260px, 70vw); aspect-ratio: 1; }
.portrait::before { content: ""; position: absolute; inset: -18px -10px -6px -22px; background: var(--sun); border: 2px solid var(--ink); border-radius: 58% 42% 55% 45% / 48% 56% 44% 52%; animation: blob 9s ease-in-out infinite alternate; }
.portrait img { position: relative; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; border-radius: 50%; border: 3px solid var(--ink); }
.portrait .hand { position: absolute; right: -18px; bottom: -14px; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: 2px 12px; transform: rotate(5deg); }
@keyframes blob { to { border-radius: 44% 56% 42% 58% / 56% 44% 58% 42%; transform: rotate(6deg); } }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.tags li { padding: 5px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); font-weight: 700; color: var(--ink); font-size: .95rem; }
.tags li:nth-child(3n+1) { background: var(--mint); }
.tags li:nth-child(3n+2) { background: var(--sky); }
.tags li:nth-child(3n) { background: var(--blush); }
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-block; padding: 11px 22px; border: 2px solid var(--ink); border-radius: 999px; background: var(--orange); color: #fff; font-weight: 800; text-decoration: none; box-shadow: 3px 3px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.btn:hover { color: #fff; transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.btn--plain { background: var(--paper); color: var(--ink); }
.btn--plain:hover { color: var(--ink); }

.section { padding: 36px 0; }
.section > h2, .wrap > h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 8px; }
.section__note { margin: 0 0 24px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat:nth-child(1) { background: var(--sun); } .stat:nth-child(2) { background: var(--mint); }
.stat:nth-child(3) { background: var(--sky); } .stat:nth-child(4) { background: var(--blush); }
.stat b { display: block; font-family: var(--font-display); font-size: 2.5rem; line-height: 1; color: var(--ink); letter-spacing: -0.03em; }
.stat span { display: block; margin-top: 8px; color: var(--ink); font-size: .98rem; line-height: 1.4; }
.stat i { display: block; margin-top: 8px; font-family: var(--font-hand); font-style: normal; font-size: 1.3rem; line-height: 1.1; color: var(--ink); opacity: .8; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
a.card { display: block; text-decoration: none; color: var(--text); transition: transform .12s, box-shadow .12s; }
a.card:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--ink); color: var(--text); }
.card h3 { font-size: 1.45rem; margin-bottom: 8px; }
.card p { margin: 0 0 12px; overflow-wrap: anywhere; }
.card p:last-child, .card ul:last-child, .card ol:last-child { margin-bottom: 0; }
.card .more { font-weight: 800; color: var(--orange-ink); }
.emoji { font-size: 1.9rem; line-height: 1; display: block; margin-bottom: 10px; }

/* Ártalsmerki */
.year { display: inline-block; padding: 2px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--sun); color: var(--ink); font-weight: 800; font-size: .88rem; white-space: nowrap; }

/* Tímalína */
.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; border-left: 3px dashed var(--ink); }
.timeline > li { position: relative; margin: 0 0 22px; }
.timeline > li::before { content: ""; position: absolute; left: -37px; top: 22px; width: 16px; height: 16px; border-radius: 50%; background: var(--orange); border: 3px solid var(--ink); }
.timeline > li.is-now::before { background: var(--sun); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.35); } }
.timeline h3 { font-size: 1.3rem; margin: 8px 0 0; }
.timeline p, .timeline ul { margin: 8px 0 0; }
.card ul { padding-left: 1.2rem; }
.card li { margin-bottom: 6px; }

/* Verkefni */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.filters button { font: inherit; font-weight: 800; padding: 6px 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); cursor: pointer; }
.filters button:hover { background: var(--sun); }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.projects { columns: 2; column-gap: 22px; }
.project { break-inside: avoid; margin: 0 0 22px; }
.project[hidden] { display: none; }
.project h3 { margin-top: 10px; }
.project .hand { margin-top: 12px; }
.count { color: var(--muted); font-weight: 700; margin-left: 4px; }

/* Nefndir */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rows li { display: grid; grid-template-columns: 215px 1fr; gap: 16px; align-items: start; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 16px 20px; box-shadow: 4px 4px 0 var(--ink); }
.rows li:nth-child(4n+1) .year { background: var(--mint); } .rows li:nth-child(4n+2) .year { background: var(--sky); }
.rows li:nth-child(4n+3) .year { background: var(--blush); }
.rows p { margin: 0; }

/* Myndir */
.polaroids { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 28px 22px; padding: 10px 0 30px; }
.polaroid { display: block; background: var(--paper); border: 2px solid var(--ink); padding: 10px 10px 0; text-decoration: none; color: var(--ink); box-shadow: 4px 4px 0 var(--ink); transition: transform .18s; cursor: zoom-in; font: inherit; text-align: center; }
.polaroid:nth-child(3n+1) { transform: rotate(-2deg); } .polaroid:nth-child(3n+2) { transform: rotate(1.4deg); } .polaroid:nth-child(5n) { transform: rotate(-.8deg); }
.polaroid:hover, .polaroid:focus-visible { transform: rotate(0) scale(1.05); z-index: 2; position: relative; color: var(--ink); }
.polaroid__img { display: block; aspect-ratio: 4 / 3; background: var(--sky); overflow: hidden; border: 2px solid var(--ink); }
.polaroid:nth-child(4n+1) .polaroid__img { background: var(--mint); } .polaroid:nth-child(4n+2) .polaroid__img { background: var(--blush); } .polaroid:nth-child(4n+3) .polaroid__img { background: var(--sun); }
.polaroid__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.polaroid__img.is-missing { display: grid; place-items: center; font-size: 2.4rem; }
.polaroid__cap { display: block; font-family: var(--font-hand); font-size: 1.45rem; line-height: 1.1; padding: 10px 4px 12px; min-height: 3.1rem; }
.notice { border: 2px dashed var(--ink); border-radius: var(--radius); padding: 14px 18px; background: var(--paper); margin-bottom: 26px; }
.notice[hidden] { display: none; }

.lb { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(19, 39, 58, .88); padding: 20px; }
.lb[hidden] { display: none; }
.lb figure { margin: 0; background: var(--paper); border: 2px solid var(--ink); padding: 12px 12px 0; max-width: min(1000px, 94vw); transform: rotate(-.6deg); }
.lb img { display: block; max-width: 100%; max-height: 74vh; margin: 0 auto; }
.lb figcaption { font-family: var(--font-hand); font-size: 1.8rem; text-align: center; padding: 8px 0 12px; color: var(--ink); }
.lb button { position: fixed; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--ink); background: var(--sun); color: var(--ink); font-size: 1.5rem; font-weight: 800; cursor: pointer; line-height: 1; }
.lb button:hover { background: #fff; }
.lb__close { top: 18px; right: 18px; } .lb__prev { left: 18px; top: 50%; } .lb__next { right: 18px; top: 50%; }

/* Efni */
.yeargroup { margin: 0 0 34px; }
.yeargroup h2 { font-size: 2.2rem; display: inline-block; }
.links { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.links a { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 12px 18px; text-decoration: none; color: var(--ink); box-shadow: 4px 4px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.links a:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); background: #fffdf8; }
.links .ico { font-size: 1.6rem; text-align: center; }
.links b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; line-height: 1.25; }
.links small { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.kind { padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px; font-size: .8rem; font-weight: 800; background: var(--mint); white-space: nowrap; }
.kind--video { background: var(--blush); } .kind--own { background: var(--sun); } .kind--doc { background: var(--sky); }

/* Fótur */
.foot { margin-top: 50px; border-top: 2px solid var(--ink); background: var(--ink); color: #dfe7ef; }
.foot__in { max-width: 1080px; margin: 0 auto; padding: 30px 20px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.foot p { margin: 0; }
.foot .hand { color: var(--sun); transform: rotate(-1.5deg); }
.foot a { color: #fff; }

@media (max-width: 860px) {
  .home-hero { grid-template-columns: 1fr; padding-top: 40px; }
  .portrait { order: -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
  .projects { columns: 1; }
  .rows li { grid-template-columns: 1fr; gap: 8px; }
  .links a { grid-template-columns: 36px 1fr; }
  .links .kind { display: none; }
  .hero { padding-top: 40px; }
}
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
@media print { .top, .filters, .lb, .btns { display: none !important; } body { background: #fff; } .card, .stat, .rows li, .links a { box-shadow: none; } }
