/* =============================================================================
   style.css — mrps.in
   Fluid from 320px mobile to 4K. Single file. No frameworks.
   ============================================================================= */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --bg:         #202123;
  --surface:    #2d2d30;
  --border:     #343541;
  --border-mid: #4a4b53;

  --text:       #ececf1;
  --muted:      #c5c5d2;
  --faint:      #565869;

  --accent:     #10a37f;
  --accent-dim: #0e8c6d;

  --sans:  'IBM Plex Sans',  system-ui, sans-serif;
  --mono:  'IBM Plex Mono',  'Courier New', monospace;

  /* Fluid type scale — min @ 320px, max @ 2560px */
  --step--1: clamp(0.7rem,   0.65rem + 0.35vw,  1.0rem);
  --step-0:  clamp(0.875rem, 0.8rem  + 0.5vw,   1.3rem);
  --step-1:  clamp(1.05rem,  0.95rem + 0.75vw,  1.65rem);
  --step-2:  clamp(1.25rem,  1.1rem  + 1.0vw,   2.1rem);
  --step-3:  clamp(1.5rem,   1.3rem  + 1.5vw,   2.85rem);
  --step-4:  clamp(1.85rem,  1.6rem  + 2.0vw,   4.2rem);
  --step-5:  clamp(2.2rem,   1.8rem  + 3.0vw,   6.2rem);

  /* Fluid space */
  --s-xs:  clamp(0.5rem,   0.4rem  + 0.5vw,  1rem);
  --s-sm:  clamp(0.75rem,  0.6rem  + 0.75vw, 1.5rem);
  --s-md:  clamp(1rem,     0.8rem  + 1vw,    2rem);
  --s-lg:  clamp(1.5rem,   1.2rem  + 1.5vw,  3rem);
  --s-xl:  clamp(2rem,     1.5rem  + 2.5vw,  5rem);
  --s-2xl: clamp(3rem,     2rem + 4vw,    8rem);

  /* Layout */
  --measure:   68ch;       /* prose width */
  --wide:      120ch;      /* wide content layout */
  --pad:       clamp(1rem, 6vw, 6rem);   /* outer horizontal padding */

  --radius:    3px;
  --trans:     140ms ease;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--step-0);
  line-height: 1.7;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img, video, svg { max-width: 100%; height: auto; display: block; }

a {
  color: inherit;
  text-decoration-color: var(--faint);
  text-underline-offset: 4px;
  transition: color var(--trans), text-decoration-color var(--trans);
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius); }

/* ── Skip link ────────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute; top: -4rem; left: var(--s-md);
  background: var(--accent); color: #000;
  padding: var(--s-xs) var(--s-md);
  z-index: 9999; border-radius: var(--radius);
  font-family: var(--sans); font-size: var(--step--1);
  text-decoration: none; transition: top var(--trans);
}
.skip-link:focus { top: var(--s-md); }

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: var(--s-sm) var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-lg);
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--sans);
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
}
.site-title:hover { color: var(--accent); }

.site-nav {
  display: flex;
  gap: var(--s-lg);
  flex-wrap: wrap;
  align-items: center;
}

.site-nav a {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 1rem;
  border: 1px solid transparent;
  border-radius: 20px;
  transition: all var(--trans);
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-color: var(--border-mid);
  background: var(--surface);
}

/* ── Main ─────────────────────────────────────────────────────────────────── */
main { flex: 1; }

/* ── Page layout wrapper (non-homepage) ───────────────────────────────────── */
.main-content {
  max-width: var(--wide);
  margin: 0 auto;
  padding: var(--s-xl) var(--pad);
  width: 100%;
}

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: var(--s-xl);
  padding-bottom: var(--s-lg);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-family: var(--sans);
  font-size: var(--step-4);
  font-weight: 200;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-xs);
}

.page-description { font-size: var(--step-1); color: var(--muted); line-height: 1.5; }

.page-meta {
  font-size: var(--step--1);
  color: var(--muted);
  margin-top: var(--s-sm);
}

/* ── Prose ────────────────────────────────────────────────────────────────── */
.content > * + * { margin-top: var(--s-md); }

.content h1, .content h2, .content h3,
.content h4, .content h5, .content h6 {
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.2;
  margin-top: var(--s-xl);
  margin-bottom: var(--s-sm);
}

.content h1 { font-size: var(--step-4); font-weight: 200; }
.content h2 { font-size: var(--step-2); border-bottom: 1px solid var(--border); padding-bottom: var(--s-xs); }
.content h3 { font-size: var(--step-1); }
.content h4 { font-size: var(--step-0); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.content ul, .content ol { padding-left: var(--s-lg); }
.content li + li { margin-top: var(--s-xs); }

.content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--s-md);
  color: var(--muted);
  font-style: italic;
}

.content hr { border: none; border-top: 1px solid var(--border); }
.content strong { color: var(--text); font-weight: 700; }
.content a { color: var(--accent); }
.content a:hover { color: var(--text); }

/* ── Code ─────────────────────────────────────────────────────────────────── */
code, kbd { font-family: var(--mono); font-size: 0.875em; }

.content code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
  border-radius: var(--radius);
  color: var(--accent);
}

.content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-md);
  overflow-x: auto;
  line-height: 1.5;
}

.content pre code {
  background: none; border: none; padding: 0; color: var(--text);
  font-size: var(--step--1);
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.content th {
  background: var(--surface);
  text-align: left;
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.content th, .content td { padding: var(--s-xs) var(--s-sm); border: 1px solid var(--border); }
.content tr:nth-child(even) { background: var(--surface); }

/* ── EXIF table ───────────────────────────────────────────────────────────── */
.exif-table {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--s-xs) var(--s-md);
  font-size: var(--step--1);
  color: var(--muted);
}
.exif-table dt {
  font-family: var(--sans); font-size: var(--step--1);
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint);
}

/* ── Post list ────────────────────────────────────────────────────────────── */
.post-list { list-style: none; }

.post-list-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-md);
  padding: var(--s-sm) 0;
  border-bottom: 1px solid var(--border);
}
.post-list-item:first-child { border-top: 1px solid var(--border); }

.post-list-title { font-size: var(--step-0); text-decoration: none; flex: 1; min-width: 0; }
.post-list-title:hover { color: var(--accent); }

.post-list-date {
  font-size: var(--step--1);
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Card grid ────────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--s-sm);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--trans), transform var(--trans);
}
.card:hover { border-color: var(--border-mid); transform: translateY(-2px); }

.card-img { width: 100%; aspect-ratio: 3/2; object-fit: cover; background: var(--surface); }

.card-body { padding: var(--s-md); }

.card-title { font-family: var(--sans); font-size: var(--step-0); text-decoration: none; display: block; margin-bottom: var(--s-xs); }
.card-title:hover { color: var(--accent); }

.card-excerpt { font-size: var(--step--1); color: var(--muted); line-height: 1.6; }

/* ── Photo grid ───────────────────────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: var(--s-xs);
}

.photo-grid a { display: block; overflow: hidden; border-radius: var(--radius); background: var(--surface); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; aspect-ratio: 4/3; }
.photo-grid a:hover img { transform: scale(1.04); }

/* ── Social / tag lists ───────────────────────────────────────────────────── */
.tag {
  display: inline-block; font-size: var(--step--1);
  color: var(--muted); text-decoration: none; font-family: var(--mono);
}
.tag:hover { color: var(--accent); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-xs);
  padding: var(--s-xs) var(--s-md);
  background: transparent; border: 1px solid var(--border-mid);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--mono); font-size: var(--step--1);
  text-decoration: none; cursor: pointer;
  transition: border-color var(--trans), color var(--trans);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

.back-nav {
  margin-bottom: var(--s-lg);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  font-size: var(--step--1);
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  transition: all var(--trans);
}

.btn-back:hover {
  color: var(--text);
  border-color: var(--border-mid);
  background: var(--bg);
}

/* ── Homepage ─────────────────────────────────────────────────────────────── */
.hero {
  min-height: calc(100svh - 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--s-2xl) var(--pad);
  max-width: calc(var(--measure) + 2 * var(--pad));
  margin: 0 auto;
  width: 100%;
}

.hero h1 {
  font-family: var(--sans);
  font-size: var(--step-5);
  font-weight: 200;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: var(--s-md);
}

.hero-bio {
  font-size: var(--step-1);
  color: var(--muted);
  margin-bottom: var(--s-xs);
}

.hero-tagline {
  font-size: var(--step-0);
  color: var(--faint);
  margin-bottom: var(--s-xl);
  font-style: italic;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
  list-style: none;
}

.hero-links a {
  font-size: var(--step-0);
  color: var(--text);
  text-decoration: none;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--border-mid);
  border-radius: 30px;
  background: var(--surface);
  transition: all var(--trans);
}
.hero-links a:hover {
  color: var(--bg);
  border-color: var(--accent);
  background: var(--accent);
}

/* Homepage sections */
.home-section {
  padding: var(--s-xl) var(--pad);
  max-width: calc(var(--measure) + 2 * var(--pad));
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--s-md);
}

.home-section-header h2 {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.home-section-header a {
  font-size: var(--step--1);
  color: var(--faint);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.home-section-header a:hover { color: var(--accent); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--s-xl) var(--pad);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
}

.footer-name a {
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--muted);
  text-decoration: none;
}
.footer-name a:hover { color: var(--accent); }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs) var(--s-md);
}

.footer-nav a {
  font-size: var(--step--1);
  color: var(--faint);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color var(--trans);
}
.footer-nav a:hover { color: var(--accent); }

.footer-meta { font-size: var(--step--1); color: var(--faint); }
.footer-meta a { color: var(--faint); }
.footer-meta a:hover { color: var(--accent); }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
}

/* ── Mobile Layout Adjustments ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .header-inner {
    flex-direction: column;
    align-items: center;
    gap: var(--s-sm);
    padding: var(--s-sm) var(--pad);
  }
  .site-nav {
    justify-content: center;
    gap: var(--s-xs);
  }
  .site-nav a {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
  .post-list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}
