/* ============================================
   FRAMEREXPERT.SE — KillerPortfolio-inspired
   Ultra minimal, editorial, content-first
   ============================================ */

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

/* ============================================
   OSMO SCALING SYSTEM
   https://osmo.supply/
   ============================================ */

/* Desktop */
:root {
  --size-unit: 16;
  --size-container-ideal: 1440;
  --size-container-min: 992px;
  --size-container-max: 1920px;
  --size-container: clamp(var(--size-container-min), 100vw, var(--size-container-max));
  --size-font: calc(var(--size-container) / (var(--size-container-ideal) / var(--size-unit)));
}

/* Tablet */
@media screen and (max-width: 991px) {
  :root {
    --size-container-ideal: 834;
    --size-container-min: 768px;
    --size-container-max: 991px;
  }
}

/* Mobile Landscape */
@media screen and (max-width: 767px) {
  :root {
    --size-container-ideal: 550;
    --size-container-min: 480px;
    --size-container-max: 767px;
  }
}

/* Mobile Portrait */
@media screen and (max-width: 479px) {
  :root {
    --size-container-ideal: 390;
    --size-container-min: 320px;
    --size-container-max: 479px;
  }
}

/* --- Custom Properties --- */
:root {
  --bg: #27272A;
  --bg-card: #323236;
  --text: #F5F5F0;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --border: #3F3F46;
  --font: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
  --radius-pill: 9999px;
}

/* --- Base --- */
body {
  font-family: var(--font);
  font-size: var(--size-font);
  background: var(--bg);
  color: var(--text-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* --- Keyboard focus --- */
:focus { outline: none; }

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 2px;
}

.card:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 6px;
  border-radius: var(--radius);
}

/* --- Skip to content --- */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--text);
  color: var(--bg);
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0 0 var(--radius) 0;
  transform: translateY(-100%);
  transition: transform 150ms;
  z-index: 200;
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: 100%;
  max-width: var(--size-container);
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* ============================================
   UNDERLINE LINK ANIMATION
   ============================================ */
[data-underline-link] {
  text-decoration: none;
  position: relative;
}

[data-underline-link]::before {
  content: "";
  position: absolute;
  bottom: -0.0625em;
  left: 0;
  width: 100%;
  height: 0.0625em;
  background-color: currentColor;
  transition: transform 0.735s cubic-bezier(0.625, 0.05, 0, 1);
  transform-origin: right;
  transform: scaleX(0) rotate(0.001deg);
}

@media (hover: hover) and (pointer: fine) {
  [data-underline-link]:hover::before {
    transform-origin: left;
    transform: scaleX(1) rotate(0.001deg);
  }
}

/* ============================================
   TWO-STEP SCALING NAVIGATION
   ============================================ */
.twostep-nav {
  z-index: 100;
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.twostep-nav__bg {
  z-index: 0;
  opacity: 0;
  pointer-events: auto;
  visibility: hidden;
  background-color: #000000a0;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0% auto auto 0%;
}

.twostep-nav__wrap {
  justify-content: center;
  align-items: stretch;
  width: 100%;
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
}

.twostep-nav__width {
  flex-flow: column;
  flex: none;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  max-width: 48em;
  padding-top: 0.875em;
  padding-left: 1.25em;
  padding-right: 1.25em;
  display: flex;
}

.twostep-nav__bar {
  pointer-events: auto;
  color: var(--text);
  width: 100%;
  max-width: 22em;
  position: relative;
}

.twostep-nav__back {
  z-index: 0;
  position: absolute;
  inset: 0%;
}

.twostep-nav__back-bg {
  background-color: var(--bg-card);
  border-radius: .5em;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0%;
}

.twostep-nav__top {
  z-index: 1;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 3em;
  padding: 0.75em 1em;
  display: flex;
  position: relative;
}

.twostep-nav__bottom {
  grid-template-rows: 0fr;
  width: 100%;
  display: grid;
  position: relative;
  overflow: hidden;
}

.twostep-nav__logo {
  justify-content: flex-start;
  align-items: center;
  height: 100%;
  display: flex;
  font-size: 0.8125em;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.02em;
}

.twostep-nav__toggle {
  pointer-events: auto;
  cursor: pointer;
  background-color: transparent;
  justify-content: center;
  align-items: center;
  width: 2em;
  height: 2em;
  padding: 0;
  display: flex;
  position: relative;
  border: none;
}

.twostep-nav__toggle-bar {
  background-color: var(--text);
  width: 1.375em;
  height: .1em;
  position: absolute;
}

.twostep-nav__bottom-overflow {
  flex-flow: column;
  justify-content: flex-start;
  align-items: center;
  height: 100%;
  display: flex;
  position: relative;
  overflow: hidden;
}

.twostep-nav__bottom-inner {
  flex-flow: column;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  padding: 1em;
  display: flex;
  position: relative;
}

.twostep-nav__bottom-row {
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  display: flex;
}

.twostep-nav__bottom-col {
  flex: 1;
  min-height: 100%;
  display: flex;
}

.twostep-nav__info {
  grid-column-gap: 2em;
  grid-row-gap: 2em;
  flex-flow: column;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  display: flex;
}

.twostep-nav__ul {
  flex-flow: column;
  justify-content: flex-start;
  align-items: stretch;
  width: 100%;
  margin-bottom: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
}

.twostep-nav__ul.is--small {
  grid-column-gap: 1em;
  grid-row-gap: .25em;
  flex-flow: wrap;
  justify-content: flex-start;
  align-items: flex-start;
}

.twostep-nav__li {
  list-style: none;
}

.twostep-nav__link {
  color: inherit;
  width: 100%;
  padding-top: .375em;
  padding-bottom: .375em;
  text-decoration: none;
  position: relative;
  display: block;
}

.twostep-nav__link-span {
  letter-spacing: -.04em;
  font-family: var(--font);
  font-size: 2.125em;
  font-weight: 400;
  line-height: 1;
}

.twostep-nav__link-eyebrow {
  opacity: .7;
  letter-spacing: -.02em;
  font-family: var(--font);
  font-size: 1em;
  font-weight: 400;
  line-height: 1;
}

.twostep-nav__top-line {
  z-index: 2;
  background-color: #ffffff1a;
  height: 1px;
  position: absolute;
  bottom: 0;
  left: .5em;
  right: .5em;
}

/* Language Toggle */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.6875em;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.2em 0.25em;
  letter-spacing: 0.03em;
  transition: border-color 150ms;
}

.lang-toggle:hover {
  border-color: var(--text-muted);
}

.lang-toggle__option {
  padding: 0.15em 0.45em;
  border-radius: var(--radius-pill);
  transition: color 150ms, background-color 150ms;
  line-height: 1;
}

.lang-toggle__option.is-active {
  color: var(--bg);
  background: var(--text-secondary);
}

.lang-toggle__divider {
  display: none;
}

/* --- Two-step Nav Animation Variables --- */
[data-twostep-nav] {
  --cubic-default: cubic-bezier(0.625, 0.05, 0, 1);
  --animation-ease: 0.2s ease;
  --duration-default: 0.5s;
  --duration-default-long: 0.75s;
  --duration-default-half: 0.25s;
  --animation-default: var(--duration-default) var(--cubic-default);
  --animation-default-long: var(--duration-default-long) var(--cubic-default);
  --animation-default-half: var(--duration-default-half) var(--cubic-default);
}

/* Menu button animations */
.twostep-nav__toggle-bar {
  transition: transform var(--animation-default);
  transform: translateY(-0.25em) rotate(0.001deg);
}

.twostep-nav__toggle:hover .twostep-nav__toggle-bar {
  transform: translateY(0.25em) rotate(0.001deg);
}

.twostep-nav__toggle .twostep-nav__toggle-bar:nth-child(2) {
  transform: translateY(0.15em) rotate(0.001deg);
}

.twostep-nav__toggle:hover .twostep-nav__toggle-bar:nth-child(2) {
  transform: translateY(-0.15em) rotate(0.001deg);
}

[data-nav-status="active"] .twostep-nav__toggle .twostep-nav__toggle-bar {
  transform: translateY(0em) rotate(45deg);
}

[data-nav-status="active"] .twostep-nav__toggle .twostep-nav__toggle-bar:nth-child(2) {
  transform: translateY(0em) rotate(-45deg);
}

/* Page dark overlay */
.twostep-nav__bg {
  transition: opacity var(--animation-default), visibility var(--animation-default);
}

[data-nav-status="active"] .twostep-nav__bg {
  opacity: 1;
  visibility: visible;
}

/* Inner bar grow */
.twostep-nav__bar {
  transition: max-width var(--animation-default-long) 0.2s;
}

[data-nav-status="active"] .twostep-nav__bar {
  transition: max-width var(--animation-default) 0s;
  max-width: 100%;
}

/* Thin line in nav bar */
.twostep-nav__top-line {
  transition: opacity var(--animation-default) 0s;
  opacity: 0;
}

[data-nav-status="active"] .twostep-nav__top-line {
  transition: opacity var(--animation-default) 0.1s;
  opacity: 1;
}

/* Nav bar background */
[data-nav-status="active"] .twostep-nav__back-bg {
  transition: background-color var(--animation-ease);
}

.twostep-nav__back {
  transition: inset var(--animation-default);
  inset: 0em;
}

[data-nav-status="active"] .twostep-nav__back {
  inset: -0.25em;
}

/* Nav bottom */
.twostep-nav__bottom {
  transition: grid-template-rows var(--animation-default) 0s;
}

[data-nav-status="active"] .twostep-nav__bottom {
  transition: grid-template-rows var(--animation-default-long) 0.25s;
  grid-template-rows: 1fr;
}

/* Nav columns reveal */
.twostep-nav__bottom-row > * {
  transition: transform var(--animation-default) 0s, opacity var(--animation-default) 0s;
  transform: translateY(2em);
  opacity: 0;
}

.twostep-nav__bottom-row > *:nth-child(2) {
  transition-delay: 0.075s;
}

[data-nav-status="active"] .twostep-nav__bottom-row > * {
  transition: transform var(--animation-default-long) 0.5s, opacity var(--animation-default-long) 0.5s;
  transform: translateY(0em);
  opacity: 1;
}

[data-nav-status="active"] .twostep-nav__bottom-row > *:nth-child(2) {
  transition-delay: 0.575s;
}

/* ============================================
   HERO — KP-style: small refined type, massive whitespace
   ============================================ */
.hero {
  margin-top: clamp(9rem, 18vw, 13rem);
  padding-bottom: 0;
  text-align: center;
}

.hero__content {
  max-width: 40rem;
  margin: 0 auto;
}

.hero__title {
  font-size: clamp(1.25rem, 1.5vw, 1.5rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: normal;
}

.hero__title strong {
  font-weight: 600;
}

/* ============================================
   FILTER PILLS — Like KP
   ============================================ */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.filter-pills a,
.filter-pills button {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 150ms, color 150ms;
  text-decoration: none;
  line-height: 1.4;
}

.filter-pills a:hover,
.filter-pills button:hover {
  background: var(--border);
  color: var(--text);
}

.filter-pills a.is-active,
.filter-pills button.is-active,
.filter-pills a[aria-current="page"],
.filter-pills button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}

/* ============================================
   ARTICLE CARDS — KP style
   Large image + "Title — description" text
   ============================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5em;
  margin-top: clamp(5rem, 13vw, 10rem);
  padding-bottom: clamp(4rem, 10vh, 8rem);
}

.card {
  display: block;
  text-decoration: none;
  transition: opacity 200ms;
}

.card:hover {
  opacity: 0.7;
}

.card__image {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.75em;
}

.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
  opacity: 0.5;
}

.card__text {
  font-size: 0.9375em;
  line-height: 1.5;
  color: var(--text-secondary);
}

.card__text strong {
  font-weight: 600;
  color: var(--text);
}

/* ============================================
   FOOTER — Ultra minimal single line
   ============================================ */
.footer {
  padding: 3em 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__left {
  font-size: 0.8125em;
  color: var(--text-muted);
}

.footer__links {
  display: flex;
  gap: 1.25rem;
}

.footer__links a {
  font-size: 0.8125em;
  color: var(--text-secondary);
  transition: color 150ms;
}

.footer__links a:hover {
  color: var(--text);
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs {
  padding-top: clamp(5rem, 8vh, 7rem);
  padding-bottom: 0;
}

.breadcrumbs__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 720px;
  margin: 0 auto;
  font-size: 0.8125em;
  line-height: 1.4;
  color: var(--text-muted);
  list-style: none;
}

.breadcrumbs__list li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.breadcrumbs__list li:not(:last-child)::after {
  content: '/';
  margin-left: 0.5rem;
  color: var(--text-muted);
  opacity: 0.4;
}

.breadcrumbs__list a {
  color: var(--text-muted);
  transition: color 150ms;
}

.breadcrumbs__list a:hover {
  color: var(--text);
}

.breadcrumbs__list [aria-current="page"] {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* ============================================
   BLOG POST
   ============================================ */
.blog-post__header {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  max-width: 720px;
  margin: 0 auto;
}

.blog-post__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.75em;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.blog-post__category {
  padding: 0.2em 0.65em;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-weight: 500;
  color: var(--text);
}

.blog-post__title {
  font-size: clamp(1.75rem, 2.75em, 3em);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.blog-post__intro {
  font-size: 1.125em;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* Content body */
.blog-post__content {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.blog-post__content h2 {
  font-size: 1.25em;
  font-weight: 700;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.blog-post__content h3 {
  font-size: 1.125em;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.blog-post__content p {
  margin-bottom: 1.15rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.blog-post__content ul,
.blog-post__content ol {
  margin-bottom: 1.15rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.blog-post__content li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
  list-style-type: disc;
}

.blog-post__content ol li {
  list-style-type: decimal;
}

.blog-post__content strong {
  color: var(--text);
  font-weight: 600;
}

.blog-post__content a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.blog-post__content a:hover {
  opacity: 0.7;
}

/* Related articles */
.blog-post__related {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.blog-post__related-title {
  font-size: 0.9375em;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.blog-post__related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5em;
}

/* Blog listing heading */
.blog-listing__header {
  text-align: center;
  margin-top: clamp(9rem, 18vw, 13rem);
  padding-bottom: 0;
}

.blog-listing__title {
  font-size: clamp(1.25rem, 1.5vw, 1.5rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: normal;
}

.blog-listing__title strong {
  font-weight: 600;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
  .container {
    padding: 0 1.25rem;
  }

  .twostep-nav__top-line {
    bottom: -.5em;
    left: 1em;
    right: 1em;
  }

  [data-nav-status="active"] .twostep-nav__top-line {
    transition: inset var(--animation-default) 0.2s, opacity var(--animation-default) 0.2s;
    inset: auto 0em -0.5em;
  }

  [data-nav-status="active"] .twostep-nav__back {
    inset: -1.25em;
  }

  .twostep-nav__bottom {
    transition: grid-template-rows var(--animation-default) 0s, transform var(--animation-default) 0s;
    transform: translateY(-0.625em);
  }

  [data-nav-status="active"] .twostep-nav__bottom {
    transition: grid-template-rows var(--animation-default-long) 0.25s, transform var(--animation-default) 0.25s;
    transform: translateY(0em);
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .blog-post__related-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   REDUCED MOTION
   Respect users who prefer minimal animation
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
