/* ============================================================
   Elvar Þormar — thormar.is
   Editorial personal profile. Warm paper canvas, ink type,
   serif display (Fraunces) + sans body (Inter), Reon-red accent.
   ============================================================ */

:root {
  --paper:      #f6f3ee;
  --paper-2:    #efe9e1;
  --ink:        #16151a;
  --ink-soft:   #4a4852;
  --muted:      #8a8780;
  --line:       #e2dcd2;
  --accent:     #ed174c;
  --accent-ink: #c1123e;
  --dark:       #131319;
  --linkedin:   #0a66c2;

  --maxw: 1180px;
  --pad: clamp(1.25rem, 5vw, 4rem);
  --hero-inset: 20px;
  --hero-top-inset: 88px;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

em { font-style: italic; color: var(--accent); }

::selection { background: var(--accent); color: #fff; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: .75rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* Visually hidden (screen-reader / SEO heading) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Layout helpers ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
  padding-top: clamp(4.5rem, 11vw, 9rem);
}

.section__label {
  font-size: .75rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent-ink);
  font-weight: 600;
  margin-bottom: 1.1rem;
  display: flex; align-items: center; gap: .7rem;
}
.section__label::before {
  content: ""; width: 1.8rem; height: 1px; background: var(--accent); display: inline-block;
}

.section__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 16ch;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), backdrop-filter .4s;
}
.nav__inner {
  max-width: none;
  margin: 0;
  padding: 1.3rem var(--pad);
  display: flex; align-items: center; justify-content: space-between;
  transition: padding .4s var(--ease);
}
.nav.scrolled {
  background: rgba(246,243,238,.82);
  backdrop-filter: saturate(180%) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav.scrolled .nav__inner { padding-top: .9rem; padding-bottom: .9rem; }

.nav__brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.nav__links { display: flex; gap: 2rem; }
.nav__links a {
  font-size: .9rem; font-weight: 500; color: var(--ink-soft);
  position: relative; padding: .25rem 0;
  transition: color .25s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0;
  background: var(--accent); transition: width .3s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }

.nav__end { display: flex; align-items: center; gap: 1.6rem; }

.nav__social-link {
  display: inline-flex; align-items: center; justify-content: center; padding: 4px;
}
.nav__social {
  width: 20px; height: 20px; display: block;
  background-color: var(--ink-soft);
  -webkit-mask: url("images/linkedin-app-white-icon.svg") no-repeat center / contain;
          mask: url("images/linkedin-app-white-icon.svg") no-repeat center / contain;
  transition: background-color .25s var(--ease), transform .25s var(--ease);
}
.nav__social-link:hover .nav__social,
.nav__social-link:focus-visible .nav__social {
  background-color: var(--linkedin); transform: scale(1.08);
}

.nav__toggle {
  display: none; flex-direction: column; gap: 6px; background: none; border: 0;
  cursor: pointer; padding: 6px;
}
.nav__toggle span { width: 26px; height: 2px; background: var(--ink); transition: transform .3s var(--ease), opacity .3s; }
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.hero__text {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6rem, 11vh, 8rem) clamp(2rem, 5vw, 4.5rem) clamp(3rem, 6vh, 5rem);
}
.hero__text-inner {
  width: 100%;
  max-width: 34rem;
}

.eyebrow {
  font-size: .78rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 600; margin-bottom: 1.6rem;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  margin-bottom: 1.8rem;
}

.hero__lede {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 42ch;
  margin-bottom: 2.2rem;
}
.hero__lede strong { color: var(--ink); font-weight: 600; }

.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Playful "currently" live status */
.hero__now {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin-top: 2.1rem; font-size: .95rem; color: var(--muted);
}
.hero__now-label { font-weight: 500; color: var(--ink-soft); }
.pulse {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  flex: none; box-shadow: 0 0 0 0 rgba(237,23,76,.5);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(237,23,76,.5); }
  70%  { box-shadow: 0 0 0 11px rgba(237,23,76,0); }
  100% { box-shadow: 0 0 0 0 rgba(237,23,76,0); }
}
.rotator {
  color: var(--ink); font-weight: 600;
  display: inline-block;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.rotator.swap { opacity: 0; transform: translateY(7px); }

.hero__media {
  position: relative;
  min-height: 0;
  padding: var(--hero-top-inset) var(--hero-inset) var(--hero-inset);
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 22px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 500; font-size: .95rem;
  padding: .85rem 1.6rem; border-radius: 100px;
  transition: transform .25s var(--ease), background .25s, color .25s, box-shadow .25s;
}
.btn--primary {
  background: var(--ink); color: var(--paper);
}
.btn--primary:hover { background: var(--accent); transform: translateY(-2px); box-shadow: 0 12px 24px -12px var(--accent); }
.btn--ghost {
  border: 1.5px solid var(--ink); color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.about__media img {
  width: 100%; border-radius: 14px;
  aspect-ratio: 3 / 4; object-fit: cover; object-position: center;
  box-shadow: 0 24px 50px -28px rgba(20,18,24,.4);
}
.about__body p { color: var(--ink-soft); margin-top: 1.2rem; max-width: 54ch; }
.about__body strong { color: var(--ink); font-weight: 600; }
.section__title { margin-bottom: .4rem; }

.facts {
  display: flex; flex-wrap: wrap; gap: 2.4rem;
  margin-top: 2.4rem; padding-top: 2rem; border-top: 1px solid var(--line);
}
.facts dt { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; }
.facts dd { font-family: var(--serif); font-size: 1.05rem; }

/* ---------- Work / cards ---------- */
.work__head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.cards {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}
.card {
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(1.6rem, 3vw, 2.4rem);
  display: flex; flex-direction: column;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 50px -30px rgba(20,18,24,.35);
  border-color: #d8d0c4;
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; min-height: 30px; }
.card__head h3 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; letter-spacing: -0.01em; }
.card__brand { display: flex; align-items: center; }
.card__logo { height: 25px; width: auto; display: block; }
.card__logo--reon { height: 21px; }
.card__role { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); font-weight: 600; white-space: nowrap; }
.card p { color: var(--ink-soft); font-size: .98rem; }
.card__link {
  margin-top: 1.4rem; font-weight: 600; font-size: .9rem; color: var(--ink);
  align-self: flex-start;
  border-bottom: 1.5px solid transparent; transition: border-color .25s, color .25s;
}
.card__link:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Quote ---------- */
.quote {
  max-width: 60rem; margin: clamp(4.5rem, 10vw, 8rem) auto 0;
  padding: 0 var(--pad);
}
.quote blockquote p {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.6vw, 2.6rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  text-align: center;
}

/* ---------- Journey / timeline ---------- */
.journey__head { margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.timeline { list-style: none; max-width: 760px; }
.timeline li {
  display: grid; grid-template-columns: 7rem 1fr; gap: clamp(1rem, 3vw, 2.5rem);
  padding: 1.8rem 0; border-top: 1px solid var(--line);
  position: relative;
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline__year {
  font-family: var(--serif); font-size: 1.3rem; color: var(--accent); font-weight: 500;
}
.timeline__body h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: .35rem; }
.timeline__body p { color: var(--ink-soft); font-size: .98rem; }

/* ---------- FAQ ---------- */
.faq { padding-bottom: clamp(5rem, 11vw, 9rem); }
.faq__head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.faq__list {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.6rem, 3.5vw, 3rem) clamp(2rem, 5vw, 4rem);
}
.faq__item h3 {
  font-family: var(--serif); font-weight: 500; font-size: 1.3rem;
  letter-spacing: -0.01em; margin-bottom: .55rem;
}
.faq__item p { color: var(--ink-soft); font-size: .98rem; max-width: 48ch; }
.faq__item strong { color: var(--ink); font-weight: 600; }
.faq__item a { color: var(--accent-ink); border-bottom: 1px solid transparent; transition: border-color .25s; }
.faq__item a:hover { border-color: var(--accent); }

/* ---------- Contact ---------- */
.contact { text-align: center; padding-bottom: clamp(5rem, 11vw, 9rem); }
.contact__inner { max-width: 640px; margin: 0 auto; }
.contact .section__label { justify-content: center; }
.contact__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem); line-height: 1.07; letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
}
.contact__lede { color: var(--ink-soft); font-size: 1.1rem; margin: 0 auto 2.2rem; max-width: 44ch; }
.contact__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer { background: var(--dark); color: #cfcdd6; }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 2.4rem var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .88rem;
}
.footer__brand { font-family: var(--serif); font-size: 1.15rem; color: #fff; }
.footer__brand span { color: var(--accent); }
.footer__meta { letter-spacing: .12em; text-transform: uppercase; font-size: .72rem; color: #8e8c97; }
.footer__copy { color: #76747f; }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; overflow: visible; }
  .hero__media { height: 56vh; padding: var(--hero-inset); }
  .hero__text { padding: clamp(5.5rem, 16vw, 7rem) var(--pad) clamp(2.5rem, 7vw, 4rem); }
  .hero__text-inner { max-width: none; }
  .about { grid-template-columns: 1fr; }
  .about__media { display: none; }
  .cards { grid-template-columns: 1fr; }
  .faq__list { grid-template-columns: 1fr; }

  .nav__links {
    position: fixed; inset: 0 0 auto 0; top: 0;
    background: rgba(246,243,238,.97); backdrop-filter: blur(16px);
    flex-direction: column; gap: 0; padding: 5.5rem var(--pad) 2rem;
    transform: translateY(-100%); transition: transform .4s var(--ease);
    box-shadow: 0 20px 40px -20px rgba(0,0,0,.2);
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links a { padding: 1rem 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
  .nav__toggle { display: flex; z-index: 110; }
}

@media (max-width: 520px) {
  .timeline li { grid-template-columns: 4.5rem 1fr; }
  .facts { gap: 1.5rem 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .pulse { animation: none; }
  .rotator { transition: none; }
}
