/* ==========================================================================
   Fozmu Studios — product news blog
   Monochrome dark system. Tokens in :root.
   ========================================================================== */

:root {
  /* Palette — near-black navy, white-only accent (monochrome). */
  --bg: #070b14;
  --surface: #0e1525;
  --surface-2: #141c30;
  --line: #1c2540;
  --line-strong: #2a3556;

  --text: #ffffff;
  --muted: #8a93a6;
  --muted-2: #6b7490;

  --accent: #ffffff; /* white-only accent: links, buttons, focus */
  --accent-contrast: #070b14;

  /* Typography */
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Rhythm */
  --container: 1120px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 9px;
  --card-pad: clamp(1.4rem, 3vw, 2rem);

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

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img,
picture,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Layout helpers --- */
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.6rem 1rem;
  font-weight: 600;
  z-index: 100;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.muted {
  color: var(--muted);
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(7, 11, 20, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(7, 11, 20, 0.92);
}
.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.9rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.brand img {
  border-radius: 6px;
}
.nav {
  display: flex;
  gap: 1.6rem;
  font-size: 0.95rem;
}
.nav__link {
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.nav__link:hover {
  color: var(--text);
}

/* --- Hero --- */
.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(4rem, 11vh, 7.5rem) var(--gutter) clamp(2.5rem, 6vh, 4rem);
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  font-size: clamp(2.5rem, 7vw, 4.8rem);
  margin: 1.1rem 0 1.4rem;
}
.hero__sub {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 46ch;
}
.hero__actions {
  margin-top: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  font-size: 0.96rem;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn--ghost:hover {
  border-color: var(--text);
  opacity: 1;
}

/* --- Cards / grid --- */
.featured {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter) 2.5rem;
}
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--card-pad);
  overflow: hidden;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease),
    background 0.25s var(--ease);
}
.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  background: var(--surface-2);
}
.card__media {
  position: relative;
  display: block;
  width: calc(100% + var(--card-pad) * 2);
  margin: calc(var(--card-pad) * -1) calc(var(--card-pad) * -1) 1.3rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}
.card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* top fades to black */
.card__media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, transparent 55%, #000);
  pointer-events: none;
}
/* bottom fades into card toward the title */
.card__media::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60%;
  background: linear-gradient(to bottom, transparent, var(--surface));
  pointer-events: none;
}
/* full-bleed image fills the whole card; text overlaid at the bottom */
.card--featured {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(220px, 26vw, 320px);
  border-color: var(--line-strong);
  overflow: hidden;
}
.card--featured .card__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: inherit;
  z-index: 0;
}
.card--featured .card__media img {
  position: absolute;
  inset: 0;
  z-index: 0;
}
/* diagonal fade: dark in the bottom-left (title), clearing to image at top-right */
.card--featured .card__media::before {
  z-index: 1;
  background:
    radial-gradient(
      140% 110% at 0% 100%,
      rgba(9, 13, 24, 1) 0%,
      rgba(9, 13, 24, 0.72) 45%,
      rgba(9, 13, 24, 0) 82%
    ),
    linear-gradient(
    to top right,
    rgba(9, 13, 24, 1) 0%,
    rgba(9, 13, 24, 1) 18%,
    rgba(9, 13, 24, 0.98) 30%,
    rgba(9, 13, 24, 0.94) 42%,
    rgba(9, 13, 24, 0.88) 54%,
    rgba(9, 13, 24, 0.78) 66%,
    rgba(9, 13, 24, 0.64) 76%,
    rgba(9, 13, 24, 0.46) 86%,
    rgba(9, 13, 24, 0.26) 95%,
    rgba(9, 13, 24, 0.08) 100%
  );
}
.card--featured .card__media::after {
  content: none;
}
/* lift the text above the image */
.card--featured .card__top,
.card--featured .card__title,
.card--featured .card__excerpt,
.card--featured .card__cta {
  position: relative;
  z-index: 1;
}
.card--featured .card__excerpt {
  color: rgba(255, 255, 255, 0.82);
}
.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
}
.card__meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted-2);
}
.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-size: 1.4rem;
}
.card--featured .card__title {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
}
.card__excerpt {
  color: var(--muted);
  margin-top: 0.7rem;
  font-size: 0.97rem;
}
.card__cta {
  display: inline-block;
  margin-top: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
}

.grid-section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(2rem, 5vh, 3.5rem) var(--gutter) 4rem;
}
.grid-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}
.grid-section__head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.6rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* --- Post --- */
.post {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vh, 4.5rem) var(--gutter) 5rem;
}
.post__head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2rem;
  margin-bottom: 2.4rem;
}
.post__cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 1.6rem;
}
.post__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* top fades to black */
.post__cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, transparent 55%, #000);
  pointer-events: none;
}
/* bottom fades into the page toward the title */
.post__cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60%;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.post__title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0.9rem 0 1rem;
}
.post__excerpt {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 60ch;
}
.post__meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted-2);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}
.post__back {
  margin-top: 3rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.post__links {
  margin-top: 2.6rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.post__links .kicker {
  margin-bottom: 0.8rem;
  display: block;
}
.post__links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.post__links a {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.post__links a:hover {
  border-color: var(--text);
  background: var(--surface-2);
}
.post__back a {
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
}
.post__back a:hover {
  border-color: var(--text);
}

/* --- Prose (rendered markdown) --- */
.prose {
  font-size: 1.08rem;
  line-height: 1.75;
}
.prose > * + * {
  margin-top: 1.4rem;
}
.prose h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.6rem;
  margin-top: 2.6rem;
}
.prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  margin-top: 2rem;
}
.prose a {
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
}
.prose a:hover {
  border-color: var(--text);
}
.prose strong {
  color: var(--text);
  font-weight: 600;
}
.prose ul,
.prose ol {
  padding-left: 1.3rem;
}
.prose li + li {
  margin-top: 0.5rem;
}
.prose blockquote {
  border-left: 2px solid var(--line-strong);
  padding: 0.3rem 0 0.3rem 1.2rem;
  color: var(--muted);
  font-style: italic;
}
.prose img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.12em 0.4em;
}
.prose pre {
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}
.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.6rem 0;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: auto;
}
.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(2.5rem, 5vh, 3.5rem) var(--gutter) 2rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
}
.site-footer__col a {
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer__col a:hover {
  color: var(--text);
}
.site-footer__col .kicker {
  margin-bottom: 0.8rem;
  display: block;
}
.brand--footer {
  font-size: 1.1rem;
  margin-bottom: 0.7rem;
}
.site-footer__tag {
  font-family: var(--font-mono);
  color: var(--muted-2);
  font-size: 0.85rem;
}
.site-footer__base {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.3rem var(--gutter);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted-2);
}
.site-footer__base a {
  color: var(--muted);
}
.site-footer__base a:hover {
  color: var(--text);
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* --- Responsive --- */
@media (max-width: 720px) {
  .nav {
    gap: 1.1rem;
    font-size: 0.9rem;
  }
  .brand__name {
    display: none;
  }
  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }
  .site-footer__base {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}

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