/* ==========================================================================
   oskaringi.com · shared styles
   Brand: Óskar Ingi design system, Hraun (dark) theme.
   Ember is the warm accent: the logo mark, the portrait block and the numbers band.
   ========================================================================== */

:root {
  --ground: #191919;          /* hraun */
  --surface-raised: #202020;
  --line: #333333;            /* moda */
  --ink: #F2F0EA;             /* mjoll */
  --ink-muted: #969696;       /* aska */
  --ember: #C76A41;           /* glod: the warm accent */
  --haf: #10262E;             /* haf: North Atlantic deep, from the brand's colour explorations */
  --haf-light: #5FA3C0;       /* haf, lifted and brightened so it reads on Hraun (6.4:1 as text) */

  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --serif: Newsreader, Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  background: var(--ground);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 32px; }

/* ---------- Type styles from the design system ---------- */
.label {
  font-size: 12px; line-height: 1.4; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-muted);
}
.display {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(38px, 6vw, 64px); line-height: 1.08; letter-spacing: -0.01em;
  text-wrap: balance;
}
.heading-1 { font-size: 32px; line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; }
.heading-2 { font-size: 22px; line-height: 1.25; font-weight: 600; }
.body-serif { font-family: var(--serif); font-size: 19px; line-height: 1.6; }
.caption { font-size: 13px; line-height: 1.45; color: var(--ink-muted); }

/* ---------- Header ---------- */
header.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(25, 25, 25, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
header.top.scrolled { border-bottom-color: var(--line); }
header.top .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; height: 72px; }
header.top img { height: 28px; width: auto; display: block; }
header.top nav ul { display: flex; gap: 32px; list-style: none; }
header.top nav a { text-decoration: none; display: block; padding: 14px 0; position: relative; }
header.top nav a.label { color: var(--ink-muted); transition: color 0.2s; }
header.top nav a.label:hover,
header.top nav a.label.active { color: var(--ink); }
/* A hairline under the section you're in */
header.top nav a.label::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 1px;
  background: var(--ember); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
header.top nav a.label.active::after,
header.top nav a.label:hover::after { transform: scaleX(1); }

/* Inline links in running text: quiet underline that firms up on hover */
.intro a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(242, 240, 234, 0.35); text-underline-offset: 4px; text-decoration-thickness: 1px; transition: text-decoration-color 0.2s; }
.intro a:hover { text-decoration-color: var(--ember); }
.logos a { display: flex; align-items: center; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 0; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: end; }
.hero .copy { padding-bottom: 112px; }
/* Portrait on an ember block. The source photo is cut at the right shoulder and at
   the chest, so the block is sized to the photo's own box: the shoulder cut lands on
   the block's right edge, the chest cut on its bottom edge (the hero's bottom line),
   and the head breaks out above the top edge. The crop then reads as a deliberate
   cut-out rather than an accident. --top is where the block starts, as a share of
   the photo's height (just below the eyes). */
.hero .portrait { --h: 560px; --top: 0.36; align-self: end; position: relative; height: var(--h); }
.hero .portrait::before {
  content: ""; position: absolute; right: -32px; bottom: 0;
  width: calc(var(--h) * 2 / 3);            /* photo is 1024 x 1536 */
  height: calc(var(--h) * (1 - var(--top)));
  background: var(--ember);
}
.hero .portrait img {
  position: absolute; right: -32px; bottom: 0;
  height: 100%; width: auto; max-width: none; display: block;
}
.hero .label { margin-bottom: 24px; }
.hero .display { max-width: 18ch; }
.hero .intro { margin-top: 32px; max-width: 52ch; font-size: 18px; color: var(--ink-muted); }
.hero .intro strong { color: var(--ink); font-weight: 400; }
.clock { font-variant-numeric: tabular-nums; }

/* Load-in: the hero arrives in a short, calm sequence */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { scale: 1 0; } to { scale: 1 1; } }
@keyframes settle { from { opacity: 0; transform: translateY(24px) scale(0.985); } to { opacity: 1; transform: none; } }
.hero .label, .hero .display, .hero .intro { animation: rise 0.9s var(--ease) both; }
.hero .display { animation-delay: 0.08s; }
.hero .intro { animation-delay: 0.18s; }
.hero .portrait::before { transform-origin: bottom; animation: grow 0.9s var(--ease) both; }
.hero .portrait img { animation: settle 1.2s var(--ease) 0.1s both; }

/* ---------- Sections ---------- */
section { padding: 96px 0; border-top: 1px solid var(--line); scroll-margin-top: 72px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: 48px; }
.more { text-decoration: none; }
.more:hover { color: var(--ink); }

/* Scroll reveal (only when JS runs, and never for people who prefer less motion) */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: 0.08s; }
.js .reveal.d2 { transition-delay: 0.16s; }
.js .reveal.d3 { transition-delay: 0.24s; }

/* ---------- Where I've worked ---------- */
.worked { padding: 48px 0; }
.worked-groups { display: grid; grid-template-columns: auto 1fr; gap: 80px; }
.worked .label { margin-bottom: 20px; }
.logos { list-style: none; display: flex; flex-wrap: wrap; gap: 20px 44px; align-items: center; }
.logos li { display: flex; align-items: center; height: 40px; }
.logos img { display: block; height: 26px; width: auto; filter: brightness(0) invert(0.95); opacity: 0.82; transition: opacity 0.25s, transform 0.25s var(--ease); }
.logos.clients img { opacity: 0.5; }
.logos img:hover { opacity: 1; transform: translateY(-2px); }
/* Optical sizing: each logo has different proportions and padding */
.logos .syndis { height: 26px; }
.logos .kvika { height: 36px; }
.logos .landsbankinn { height: 34px; }
.logos .ossur { height: 27px; filter: none; }
.logos .icelandair { height: 36px; }
.logos .carlsberg { height: 44px; }
.logos .eastpak { height: 30px; }

/* ---------- Numbers: a Glóð (ember) band, the brand's warm accent used as a ground ---------- */
.stats { padding: 88px 0; background: var(--ember); color: var(--ground); border-top: 0; }
.stats + section { border-top: 0; }
.stats ul { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.stats li { border-top: 1px solid rgba(25, 25, 25, 0.35); padding-top: 24px; }
.stats .num {
  display: block; font-size: clamp(56px, 9vw, 112px); font-weight: 800;
  line-height: 0.95; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.stats .what { display: block; margin-top: 16px; color: var(--ground); font-weight: 600; max-width: 22ch; }
.stats .label.kicker { color: var(--ground); margin-bottom: 40px; }

/* ---------- Experience: a Haf and ember timeline ----------
   A Haf-blue line runs down the left; each role has a small square ember marker on it.
   Years are in Haf; hovering a role washes it in deep Haf and fills its marker.
   The most recent role's marker is always filled. The line draws itself in on scroll. */
.jobs { list-style: none; border-top: 1px solid var(--line); position: relative; padding-left: 28px; }
.jobs::before {
  content: ""; position: absolute; left: 3px; top: 0; bottom: 0; width: 2px;
  background: var(--haf-light); transform-origin: top; transform: scaleY(1);
}
.js .jobs.draw::before { transform: scaleY(0); transition: transform 1.6s var(--ease); }
.js .jobs.draw.in::before { transform: scaleY(1); }
.jobs li {
  position: relative;
  display: grid; grid-template-columns: 140px 1fr 1.4fr; gap: 32px;
  padding: 28px 16px; margin: 0 -16px 0 0; border-bottom: 1px solid var(--line);
  transition: background-color 0.25s;
}
.jobs li::before {
  content: ""; position: absolute; left: -29px; top: 32px; width: 11px; height: 11px; box-sizing: border-box;
  border: 2px solid var(--ember); background: var(--ground); transition: background-color 0.25s, transform 0.25s var(--ease);
}
.jobs li:first-child::before,
.jobs li:hover::before { background: var(--ember); }
.jobs li:hover::before { transform: scale(1.25); }
.jobs li:hover { background: var(--haf); }
.jobs .years { padding-top: 5px; color: var(--haf-light); }
.jobs .company { font-size: 22px; font-weight: 800; line-height: 1.2; }
.jobs .role { color: var(--ink-muted); margin-top: 4px; }
.jobs .what { max-width: 52ch; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 64px; }
.about-text p + p { margin-top: 16px; }
.about-text { max-width: 60ch; }
.facts { list-style: none; border-top: 1px solid var(--line); }
.facts li { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }

/* ---------- Writing (post list, used on home and /blog) ---------- */
.posts { list-style: none; border-top: 1px solid var(--line); }
.posts a {
  display: grid; grid-template-columns: 140px 1fr auto; gap: 32px; align-items: baseline;
  padding: 28px 16px; margin: 0 -16px; border-bottom: 1px solid var(--line);
  text-decoration: none; transition: background-color 0.25s;
}
.posts a:hover { background: var(--surface-raised); }
.posts .date { padding-top: 6px; color: var(--ember); }
.posts a:hover .arrow, .links a:hover .arrow { color: var(--ember); }
.posts .title { font-family: var(--serif); font-weight: 300; font-size: 30px; line-height: 1.15; text-wrap: balance; }
.posts .dek { margin-top: 8px; color: var(--ink-muted); max-width: 60ch; }
.posts .arrow { font-size: 22px; transition: transform 0.25s var(--ease); }
.posts a:hover .arrow { transform: translateX(6px); }

/* ---------- A few photos from my life: a mosaic, square corners, photos fill their tiles ---------- */
.life {
  display: grid; gap: 8px;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 300px 300px;
  grid-template-areas:
    "bruges   bruges sailing paris"
    "macarons street sailing paris";
}
.life figure { position: relative; overflow: hidden; background: var(--surface-raised); }
.life img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.9s var(--ease); }
.life figure:hover img { transform: scale(1.04); }
.life figcaption {
  position: absolute; left: 12px; bottom: 12px; padding: 4px 8px;
  background: rgba(25, 25, 25, 0.78); color: var(--ink);
}
.p-bruges { grid-area: bruges; }
.p-bruges img { object-position: 60% 40%; }
.p-sailing { grid-area: sailing; }
.p-sailing img { object-position: 45% 60%; }
.p-paris { grid-area: paris; }
.p-macarons { grid-area: macarons; }
.p-macarons img { object-position: 40% 30%; }
.p-street { grid-area: street; }
.p-street img { object-position: 50% 25%; }

/* ---------- Contact ---------- */
.contact-intro { max-width: 56ch; font-size: 18px; color: var(--ink-muted); margin: -24px 0 40px; }
.links { list-style: none; border-top: 1px solid var(--line); }
.links a {
  display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 24px;
  padding: 24px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.links .name { font-size: 22px; font-weight: 600; }
.links .arrow { font-size: 22px; transition: transform 0.25s var(--ease); }
.links a:hover .arrow { transform: translateX(6px); }
.links a:hover .name { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

/* ---------- Blog pages ---------- */
.page-head { padding: 96px 0 64px; }
.page-head .label { margin-bottom: 24px; }
.page-head .lede { margin-top: 24px; max-width: 52ch; font-size: 18px; color: var(--ink-muted); }

.article { padding: 80px 0 96px; }
.article .back { display: inline-block; margin-bottom: 48px; text-decoration: none; }
.article .back:hover { color: var(--ink); }
.article header { max-width: 720px; margin-bottom: 56px; }
.article header .label { margin-bottom: 24px; }
.article header .dek { margin-top: 24px; font-size: 20px; color: var(--ink-muted); max-width: 46ch; }
.prose { max-width: 680px; font-family: var(--serif); font-size: 20px; line-height: 1.65; }
.prose p + p { margin-top: 20px; }
.prose h2 { font-family: var(--sans); font-size: 22px; line-height: 1.25; font-weight: 600; margin: 48px 0 16px; }
.prose blockquote {
  margin: 40px 0; padding-left: 0; font-weight: 300; font-style: italic;
  font-size: 30px; line-height: 1.3;
}
.prose a { text-underline-offset: 4px; text-decoration-thickness: 1px; }
.article .sign { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); max-width: 680px; }

/* ---------- Footer ---------- */
footer { padding: 48px 0; border-top: 1px solid var(--line); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .wrap { padding: 0 20px; }
  header.top .wrap { height: 64px; }
  header.top nav ul { gap: 14px; }
  header.top nav a.label { letter-spacing: 0.1em; font-size: 11px; }
  header.top img { height: 28px; }
  section { scroll-margin-top: 64px; padding: 64px 0; }
  .hero { padding: 56px 0 0; }
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .hero .copy { padding-bottom: 0; }
  .hero .portrait { --h: 440px; margin: 0 -20px; }
  .hero .portrait img,
  .hero .portrait::before { right: auto; left: 50%; transform: translateX(-46%); }
  .hero .portrait img { animation: none; }
  .heading-1 { font-size: 28px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 32px; }
  .contact-intro { margin: -8px 0 32px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .worked { padding: 40px 0; }
  .worked-groups { grid-template-columns: 1fr; gap: 32px; }
  /* Logos sit in an even grid on phones: 2 across for employers, 3 for clients */
  .logos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 24px; }
  .logos.clients { grid-template-columns: repeat(3, 1fr); }
  .logos li { height: 44px; }
  .logos img { max-width: 100%; }
  .logos .syndis { height: 24px; }
  .logos .kvika { height: 32px; }
  .logos .landsbankinn { height: 32px; }
  .logos .ossur { height: 24px; }
  .logos .icelandair { height: 28px; }
  .logos .carlsberg { height: 38px; }
  .logos .eastpak { height: 26px; }
  header.top nav li.desk { display: none; }
  .stats { padding: 56px 0; }
  .stats ul { grid-template-columns: 1fr; gap: 24px; }
  .jobs { padding-left: 24px; }
  .jobs li { grid-template-columns: 1fr; gap: 6px; padding: 24px 0; margin: 0; }
  .jobs li::before { left: -25px; top: 28px; }
  .jobs li:hover { background: none; }
  .jobs .years { padding-top: 0; }
  .jobs .what { margin-top: 6px; }
  .posts a { grid-template-columns: 1fr auto; gap: 8px 16px; padding: 24px 0; margin: 0; }
  .posts .date { grid-column: 1 / -1; padding-top: 0; }
  .posts .title { font-size: 26px; }
  .life {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 240px 220px 220px 220px;
    grid-template-areas:
      "bruges   bruges"
      "sailing  paris"
      "sailing  paris"
      "macarons street";
  }
  .links a { grid-template-columns: 1fr auto; }
  .links .sub { display: none; }
  .page-head { padding: 56px 0 40px; }
  .article { padding: 48px 0 64px; }
  .prose { font-size: 19px; }
  .prose blockquote { font-size: 26px; }
}

