/* ============================================================
   Content sections — shared across pages
   ============================================================ */

/* ---------- Logo strip ---------- */
.logos {
  padding: 96px 0;
  border-bottom: 1px solid var(--border-light);
  overflow: hidden;
}

/* full-bleed marquee: logos drift horizontally on an endless loop */
.logos .container {
  max-width: none;
  padding: 0;
}

.logos__marquee {
  display: flex;
  width: max-content;
  animation: logos-scroll 45s linear infinite;
}

.logos__track {
  display: flex;
  align-items: center;
  gap: 96px;
  padding-right: 96px;
}

.logos__track img {
  height: 44px;
  width: auto;
  object-fit: contain;
  /* uniform black silhouette, toned down so they read as grey */
  filter: brightness(0);
  opacity: 0.45;
}

/* Varsom er allerede grå med hvit V — sverting ville slukt V-en */
.logos__track img[src*="varsom"] {
  filter: none;
}

@keyframes logos-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  .logos__marquee {
    animation: none;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  .logos__track[aria-hidden="true"] {
    display: none;
  }
}

/* ---------- Intro block ---------- */
/* the role reads as a subtitle under the name, not as a label above it */
.intro h1 {
  margin-bottom: 10px;
}

.intro__role {
  margin-bottom: 26px;
}

.intro .lead {
  max-width: 720px;
  margin-bottom: 14px;
}

/* the closing line carries the gap down to the photo */
.intro__lead-2 {
  margin-bottom: 32px;
}

.intro__img {
  width: 100%;
  border-radius: var(--radius-card);
  aspect-ratio: 858 / 540;
  object-fit: cover;
  background: var(--surface-1);
}

.intro__cta {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

/* ---------- "Hva kan jeg?" skills ---------- */
.skills__title {
  margin-bottom: 8px;
}

.skills__card {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 24px;
}

.skill {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.skill:last-child {
  border-bottom: none;
}

.skill__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.skill__head .ico {
  width: 24px;
  height: 24px;
  color: var(--fg);
  flex: none;
}

.skill__head .ico svg {
  width: 100%;
  height: 100%;
}

.skill__name {
  font-size: 20px;
  font-weight: 500;
  color: var(--fg);
}

.skill__desc {
  font-size: 16px;
  color: var(--fg-subtle);
  margin: 0;
  padding-left: 36px;
}

/* ---------- Selected work ---------- */
.work__title {
  margin-bottom: 28px;
}

.work__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* the newest piece leads at full width, the other two sit beside each other */
.wcard--featured {
  grid-column: 1 / -1;
}

.wcard {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.wcard:hover {
  border-color: var(--tag-soft);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(114, 102, 253, 0.1);
}

.wcard__media {
  overflow: hidden;
  background: var(--surface-1);
  aspect-ratio: 16 / 9;
}

.wcard--featured .wcard__media {
  aspect-ratio: 21 / 9;
}

.wcard__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.wcard:hover .wcard__media img {
  transform: scale(1.03);
}

.wcard__body {
  padding: 22px 24px 26px;
}

/* year + role on one quiet line, with the diamond motif leading it */
.wcard__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

.wcard__year {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--tag);
}

.wcard__year::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--tag-soft);
  border-radius: 1.5px;
  transform: rotate(45deg);
  transition: background-color 0.2s ease;
}

.wcard:hover .wcard__year::before {
  background: var(--tag);
}

.wcard__role::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 11px;
  margin-right: 10px;
  vertical-align: -1px;
  background: var(--border);
}

.wcard__title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -1px;
  margin: 0 0 8px;
  color: var(--fg-teal);
}

.wcard--featured .wcard__title {
  font-size: 38px;
}

.wcard__desc {
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-subtle);
  margin: 0;
  max-width: 60ch;
}

.work__cta {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

@media (max-width: 720px) {
  .work__grid {
    grid-template-columns: 1fr;
  }
  .wcard--featured .wcard__media {
    aspect-ratio: 16 / 9;
  }
  .wcard--featured .wcard__title {
    font-size: 30px;
  }
}

/* ---------- Recent projects (cards) ---------- */
.recent__title {
  margin-bottom: 24px;
}

.pcard {
  display: flex;
  align-items: stretch;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 8px;
  margin-bottom: 16px;
  /* fixed so every card matches regardless of its thumbnail's aspect ratio */
  height: 176px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pcard:hover {
  border-color: var(--surface-2);
  box-shadow: 0 6px 24px #0000000d;
}

.pcard__thumb {
  /* 16:9, tied to the card height so every thumbnail matches */
  height: 100%;
  aspect-ratio: 16 / 9;
  width: auto;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-1);
}

.pcard__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 8px;
}

.pcard__tags {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.minitag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 9999px;
  background: var(--surface-1);
  color: var(--fg-subtle);
  font-size: 13px;
}

.pcard__title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -1px;
  margin: 0 0 6px;
  color: var(--fg);
}

.pcard__sub {
  font-size: 16px;
  color: var(--fg-subtle);
  margin: 0;
}

.recent__cta {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

/* ============================================================
   Portfolio page
   ============================================================ */

/* Subtle lavender wash in the top-right corner (mirrors the PDF cover).
   Set on the body so it always paints behind the content. */
.page-portfolio {
  background-image: radial-gradient(
    120% 90% at 100% 0%,
    rgba(114, 102, 253, 0.16) 0%,
    rgba(114, 102, 253, 0.07) 38%,
    rgba(114, 102, 253, 0) 72%
  );
  background-repeat: no-repeat;
  background-position: right top;
  /* scales down on narrow screens so it stays a corner glow, not a band */
  background-size: min(900px, 85vw) min(620px, 42vh);
}

/* Innhold / table of contents — vertical timeline with diamond markers */
.toc__title {
  margin-bottom: 24px;
}

.toc__list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 96px;
  position: relative;
}

/* the hairline the diamonds sit on; starts at the first marker and runs to the
   bottom of the list, where .tl-curve picks it up */
.toc__list::before {
  content: "";
  position: absolute;
  left: 64px;
  top: 21px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.toc__item {
  position: relative;
  padding: 8px 0;
  font-size: 18px;
  color: var(--fg);
}

.toc__item::before {
  content: "";
  position: absolute;
  /* pull back across the list's padding so the marker centres on the rule */
  left: -36px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  background: var(--tag-soft);
  border-radius: 1.5px;
  transform: rotate(45deg);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.toc__item:hover::before {
  background: var(--tag);
  transform: rotate(45deg) scale(1.25);
}

.toc__item a:hover {
  color: var(--tag);
}

/* Timeline connector between the TOC rule (x=88.5) and the project rule (x=28.5).
   Padding is dropped so the SVG's own coordinates line up with the container. */
.toc-section {
  padding-bottom: 0;
}

.tl-curve {
  position: relative;
  height: 160px;
  padding: 0;
}

.tl-curve svg {
  position: absolute;
  left: 0;
  top: 0;
}

/* Project section — the timeline runs down the gutter, a diamond + year per project */
.timeline {
  position: relative;
  padding-left: 120px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 1px;
  /* fades out rather than stopping dead under the last project */
  background: linear-gradient(
    to bottom,
    var(--border) 0,
    var(--border) calc(100% - 120px),
    transparent 100%
  );
}

.project {
  position: relative;
  padding: 64px 0;
  border-top: 1px solid var(--border-light);
}

/* marker + year sit on the rule, level with the first line of the title */
.project__year {
  position: absolute;
  left: -76px;
  top: 142px;
  transform: translateY(-50%);
  font-size: 13px;
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
}

.project__year::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  background: var(--tag-soft);
  border-radius: 1.5px;
  transform: rotate(45deg);
}

/* neutral pill — no purple fill, matching the printed portfolio */
.project__tag {
  margin-bottom: 16px;
  background: transparent;
  color: var(--fg-subtle);
  font-weight: 400;
}

.project__title {
  margin-bottom: 20px;
}

.project__desc {
  max-width: 760px;
  font-size: 18px;
  color: var(--fg-subtle);
  line-height: 1.5;
  margin: 0 0 20px;
}

.project__chips {
  margin-bottom: 32px;
}

.project__media {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project__img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  object-fit: cover;
  background: var(--surface-1);
}

.project__caption {
  font-size: 16px;
  color: var(--muted);
  margin: 4px 0 0;
}

/* ============================================================
   Bli kjent page
   ============================================================ */
.bk-hero {
  text-align: center;
  padding: 144px 0 96px;
}

.bk-hero h1 {
  color: var(--fg-teal);
  margin-bottom: 28px;
}

.bk-hero__sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.tabs {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.tab {
  height: 32px;
  padding: 0 18px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 400;
  color: var(--fg-subtle);
}

.tab.is-active {
  background: var(--fg);
  color: #fff;
}

.bk-panel {
  display: none;
}

.bk-panel.is-active {
  display: block;
}

.bk__hero-img {
  width: 100%;
  height: 440px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-1);
  margin-bottom: 44px;
}

.bk__updated {
  font-size: 16px;
  color: #849090;
  margin: 0 0 80px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.factcard {
  background: var(--surface-1);
  border-radius: var(--radius-card);
  padding: 32px;
  margin-bottom: 112px;
}

.factcard--warm {
  background: #f4e7df;
}

.factcard__title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: -0.18px;
  color: var(--fg-subtle);
  margin: 0 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.factrow {
  padding: 12px 0;
}

.factrow__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.factrow__head .ico {
  width: 22px;
  height: 22px;
  flex: none;
  font-size: 18px;
  line-height: 1;
}

.factrow__label {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.18px;
  color: var(--fg);
}

.factrow__val {
  font-size: 16px;
  color: var(--fg-subtle);
  margin: 0;
}

.bk-section {
  margin-bottom: 96px;
}

.bk-section h3 {
  margin-bottom: 20px;
  color: var(--fg-teal);
  font-size: 32px;
  letter-spacing: -0.6px;
}

.bk-section p {
  font-size: 18px;
  color: var(--fg-subtle);
  line-height: 1.65;
  margin: 0 0 20px;
  max-width: 68ch;
}

/* narrower reading column under the full-width hero */
.bk-content {
  max-width: 800px;
  margin: 0 auto;
}

.bk__chips {
  margin-bottom: 32px;
}

.bk__list {
  margin: 32px 0;
  padding-left: 0;
  list-style: none;
}

.bk__list li {
  position: relative;
  padding: 14px 0 14px 28px;
  font-size: 17px;
  color: var(--fg-subtle);
  border-bottom: 1px solid var(--border-light);
}

.bk__list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 22px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tag);
}

/* "Hva kan jeg?" — numbered tiles instead of a flat stack of rows.
   Own component so the plain .skills__card list on the front page is untouched. */
.skillgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 44px;
}

.skillgrid__item {
  position: relative;
  padding: 26px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* accent bar that wipes in from the left on hover */
.skillgrid__item::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--tag);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.25s ease;
}

.skillgrid__item:hover {
  border-color: var(--tag-soft);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(114, 102, 253, 0.1);
}

.skillgrid__item:hover::after {
  transform: scaleY(1);
}

.skillgrid__name {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 21px;
  letter-spacing: -0.4px;
  color: var(--fg-teal);
  margin: 0 0 10px;
}

.skillgrid__ico {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--tag-soft);
  transition: color 0.2s ease;
}

.skillgrid__ico svg {
  width: 100%;
  height: 100%;
  display: block;
}

.skillgrid__item:hover .skillgrid__ico {
  color: var(--tag);
}

/* two classes deep on purpose: `.bk-section p` is more specific than a single
   class and was overriding this to 18px inside the Bli kjent panels */
.skillgrid .skillgrid__desc {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--fg-subtle);
  margin: 0;
  max-width: none;
}

/* tiles and cards stagger in once their section has been revealed */
.js .bk-section.is-visible .skillgrid__item,
.js .skills.is-visible .skillgrid__item,
.js .work.is-visible .wcard {
  animation: skill-pop 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
}

.js .bk-section.is-visible .skillgrid__item:nth-child(1),
.js .skills.is-visible .skillgrid__item:nth-child(1),
.js .work.is-visible .wcard:nth-of-type(1) { animation-delay: 0.08s; }
.js .bk-section.is-visible .skillgrid__item:nth-child(2),
.js .skills.is-visible .skillgrid__item:nth-child(2),
.js .work.is-visible .wcard:nth-of-type(2) { animation-delay: 0.16s; }
.js .bk-section.is-visible .skillgrid__item:nth-child(3),
.js .skills.is-visible .skillgrid__item:nth-child(3),
.js .work.is-visible .wcard:nth-of-type(3) { animation-delay: 0.24s; }
.js .bk-section.is-visible .skillgrid__item:nth-child(4),
.js .skills.is-visible .skillgrid__item:nth-child(4),
.js .work.is-visible .wcard:nth-of-type(4) { animation-delay: 0.32s; }
.js .bk-section.is-visible .skillgrid__item:nth-child(5) { animation-delay: 0.40s; }
.js .bk-section.is-visible .skillgrid__item:nth-child(6) { animation-delay: 0.48s; }
.js .bk-section.is-visible .skillgrid__item:nth-child(7) { animation-delay: 0.56s; }
.js .bk-section.is-visible .skillgrid__item:nth-child(8) { animation-delay: 0.64s; }
.js .bk-section.is-visible .skillgrid__item:nth-child(9) { animation-delay: 0.72s; }
.js .bk-section.is-visible .skillgrid__item:nth-child(10) { animation-delay: 0.80s; }
.js .bk-section.is-visible .skillgrid__item:nth-child(11) { animation-delay: 0.88s; }
.js .bk-section.is-visible .skillgrid__item:nth-child(12) { animation-delay: 0.96s; }

@keyframes skill-pop {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .bk-section.is-visible .skillgrid__item,
  .js .work.is-visible .wcard {
    animation: none;
  }
  .skillgrid__item,
  .skillgrid__item::after {
    transition: none;
  }
}

@media (max-width: 720px) {
  .skillgrid {
    grid-template-columns: 1fr;
  }
}

.bk__photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px 0 0;
}

.bk__photos img {
  width: 100%;
  height: 389px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-1);
}

.bk__img {
  width: 100%;
  height: 389px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-1);
  margin: 88px 0;
}

/* faint full-bleed background watermark behind a panel */
.bk-panel {
  position: relative;
}

.bk-panel__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

.bk-panel .container {
  position: relative;
  z-index: 1;
}

.quote {
  background: #f4e7df;
  border-radius: var(--radius-card);
  padding: 24px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--tag);
  margin: 88px 0;
  padding: 36px 40px;
}

/* timeline */
.timeline__item {
  padding: 22px 0;
  border-bottom: 1px solid var(--border-light);
}

.timeline__period {
  display: inline-block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.timeline__role {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.5px;
  color: var(--fg);
}

/* Narrow screens: no room for a gutter, so the timeline collapses and the year
   becomes a plain line above the client tag. */
@media (max-width: 720px) {
  /* bigger hit area for the table-of-contents links */
  .toc__item a {
    display: block;
    padding: 7px 0;
  }
  /* lives here, not in styles.css: pages.css loads later and would win */
  .tab {
    height: 44px;
    padding: 0 20px;
  }
  .toc__list {
    padding-left: 28px;
  }
  .toc__list::before {
    left: 4px;
  }
  .toc__item::before {
    left: -28px;
  }
  .toc-section {
    padding-bottom: 80px;
  }
  .tl-curve {
    display: none;
  }
  .timeline {
    padding-left: var(--pad);
  }
  .timeline::before {
    display: none;
  }
  .project__year {
    position: static;
    display: block;
    transform: none;
    margin-bottom: 10px;
  }
  .project__year::before {
    display: none;
  }
}

@media (max-width: 560px) {
  .pcard {
    flex-direction: column;
    /* stacked: content sets the height again */
    height: auto;
  }
  .pcard__thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .bk__photos {
    grid-template-columns: 1fr;
  }
}
