/* -------------------------------------------------------------
   MC Software ltd — Warm Paper
   Single stylesheet, no preprocessor, no framework.
   ------------------------------------------------------------- */

:root {
  --bg: #FAF7F2;
  --bg-elevated: #FFFFFF;
  --ink: #1A1A1A;
  --ink-muted: #5C5955;
  --rule: #E8E2D6;
  --accent: #B2462D;
  --accent-ink: #7A2E18;

  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --fs-h1: 4.0rem;
  --fs-h2: 2.6rem;
  --fs-h3: 1.5rem;
  --fs-body: 1.0625rem;
  --fs-meta: 0.75rem;

  --measure: 38rem;
  --container-max: 68rem;
  --gutter: 2rem;
  --section-rhythm: 6rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151412;
    --bg-elevated: #1F1E1B;
    --ink: #F0EBE0;
    --ink-muted: #9A9690;
    --rule: #2E2C27;
    --accent: #D76545;
    --accent-ink: #E98762;
  }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
img, svg { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: calc(var(--measure) + var(--gutter) * 2);
}

.site-main {
  flex: 1 0 auto;
  padding-block: var(--section-rhythm);
}

/* Header */
.site-header {
  padding-block: 2rem;
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--ink);
}

.wordmark__mark {
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.wordmark__text {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.wordmark__ltd {
  color: var(--ink-muted);
  font-weight: 400;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  border-bottom-color: var(--accent);
}

/* Footer */
.site-footer {
  flex-shrink: 0;
  padding-block: 3rem 2rem;
  border-top: 1px solid var(--rule);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: baseline;
  justify-content: space-between;
}

.site-footer__legal {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  max-width: 40ch;
}

.site-footer__nav {
  display: flex;
  gap: 1.5rem;
}

.site-footer__nav a {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-block: 0.125rem;
  transition: color 160ms ease, border-color 160ms ease;
}

.site-footer__nav a:hover,
.site-footer__nav a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.1;
}

h1 { font-size: clamp(2.75rem, 6vw, var(--fs-h1)); }
h2 { font-size: clamp(2rem, 4.5vw, var(--fs-h2)); line-height: 1.15; }
h3 { font-size: var(--fs-h3); line-height: 1.2; }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-meta);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.page__title {
  margin-bottom: 1.5rem;
}

.page__lede {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  line-height: 1.4;
  color: var(--ink-muted);
  font-style: italic;
  max-width: var(--measure);
  margin-bottom: 3rem;
}

/* Prose */
.prose {
  max-width: var(--measure);
  color: var(--ink);
}

.prose > * + * { margin-top: 1.25rem; }
.prose h2 { margin-top: 3.5rem; margin-bottom: 1rem; }
.prose h3 { margin-top: 2.5rem; margin-bottom: 0.5rem; }
.prose p { font-size: var(--fs-body); line-height: 1.7; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li + li { margin-top: 0.5rem; }
.prose li { line-height: 1.7; }

.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 160ms ease;
}

.prose a:hover,
.prose a:focus-visible {
  color: var(--accent-ink);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin-block: 3rem;
}

.prose strong { color: var(--ink); font-weight: 600; }

.prose blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
  color: var(--ink-muted);
  font-style: italic;
}

.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9375em;
  background: var(--bg-elevated);
  padding: 0.125em 0.35em;
  border-radius: 3px;
  border: 1px solid var(--rule);
}

/* Home hero */
.home-hero {
  padding-block: 4rem 3rem;
}

.home-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 7.5vw, var(--fs-h1));
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 16ch;
  margin-bottom: 1.5rem;
}

.home-hero__sub {
  font-family: var(--font-body);
  font-size: 1.125rem;
  color: var(--ink-muted);
  max-width: 48ch;
}

/* Projects section */
.projects-section {
  padding-block: var(--section-rhythm) 3rem;
}

.projects-section__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.projects-section__label {
  font-size: var(--fs-meta);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.projects-section__count {
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}

.project-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.project-list > li + li {
  border-top: 1px solid var(--rule);
}

/* Project card */
.project-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  padding-block: 2.75rem;
  align-items: start;
}

@media (max-width: 640px) {
  .project-card {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-block: 2.25rem;
  }
}

.project-card__icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

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

.project-card__icon--placeholder {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--accent);
}

.project-card__body {
  min-width: 0;
}

.project-card__name {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.project-card__desc {
  color: var(--ink-muted);
  font-size: 1.0625rem;
  line-height: 1.6;
  max-width: 50ch;
  margin-bottom: 1.25rem;
}

.project-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1rem;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.project-card__platforms {
  font-variant: small-caps;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.project-card__sep {
  color: var(--rule);
  user-select: none;
}

.project-card__link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color 160ms ease;
}

.project-card__link:hover,
.project-card__link:focus-visible {
  color: var(--accent-ink);
}

.project-card__link[data-external]::after {
  content: " ↗";
  font-size: 0.9em;
}

/* Project marketing page hero */
.product-hero {
  text-align: center;
  padding-block: 2rem 4rem;
}

.product-hero__icon {
  width: 128px;
  height: 128px;
  border-radius: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  margin: 0 auto 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.product-hero__title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.product-hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  font-style: italic;
  color: var(--ink-muted);
  max-width: 32ch;
  margin: 0 auto 2.5rem;
}

.product-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.875rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: transform 160ms ease, background 160ms ease;
}

.product-hero__cta:hover,
.product-hero__cta:focus-visible {
  background: var(--accent);
  transform: translateY(-1px);
}

/* Section headings inside product pages */
.product-section {
  padding-block: 3.5rem;
  border-top: 1px solid var(--rule);
}

.product-section:first-of-type {
  border-top: 0;
}

.product-section__label {
  font-size: var(--fs-meta);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.product-section__title {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 3.5vw, 2.4rem);
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.product-section__body {
  max-width: var(--measure);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.product-section__body p + p { margin-top: 1.25rem; }

/* Screenshots */
.screenshots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.screenshots figure {
  margin: 0;
}

.screenshots img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--rule);
  background: var(--bg-elevated);
  aspect-ratio: 9/19.5;
  object-fit: cover;
}

.screenshots figcaption {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
  text-align: center;
}

/* About page sections */
.about-section {
  margin-block: 4rem;
}

.about-section__label {
  font-size: var(--fs-meta);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* Legal pages */
.legal .page__title {
  margin-bottom: 0.75rem;
}

.legal__effective {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-bottom: 2.5rem;
}

.legal__prose h2 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
}

.legal__prose p, .legal__prose li {
  font-size: 1rem;
  line-height: 1.7;
}

.legal__back {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.legal__back a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

/* Focus rings */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1rem;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}
