/* viewmyday.com - shared stylesheet
   Paper + oxblood palette, Montserrat display / Open Sans body, mobile-first. */

:root {
  color-scheme: only light;

  --bg: #FBF8F3;
  --surface: #F1EAE0;
  --ink: #1F1B17;
  --muted: #6B6259;
  --accent: #8C2F2F;
  --accent-ink: #FFFFFF;
  --edge: rgba(107, 98, 89, 0.45);

  --display: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --body: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 6px;
  --gutter: clamp(16px, 5vw, 32px);
  --section-gap: clamp(56px, 9vw, 104px);

  --fs-body: clamp(1.0625rem, 1.02rem + 0.2vw, 1.125rem);
  --fs-small: 0.9375rem;
  --fs-h1: clamp(1.75rem, 1.25rem + 2vw, 2.5rem);
  --fs-h2: clamp(1.375rem, 1.1rem + 1.2vw, 1.875rem);
  --fs-dek: clamp(1.0625rem, 0.98rem + 0.45vw, 1.25rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--fs-body);
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

a {
  color: var(--accent);
}

/* ---------- Layout shell ---------- */

.layout {
  width: 100%;
  max-width: 744px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  background-color: var(--bg);
  color: var(--ink);
}

/* ---------- Masthead (sidebar on desktop) ---------- */

.masthead {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 22px 0 0;
  background-color: var(--bg);
  color: var(--ink);
}

.wordmark {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.2s ease;
}

.wordmark span {
  font-weight: 500;
  color: var(--accent);
}

.wordmark:hover {
  color: var(--accent);
}

.wordmark:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.label {
  margin: 0;
  font-family: var(--body);
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* ---------- Article head ---------- */

.article {
  counter-reset: item;
  background-color: var(--bg);
  color: var(--ink);
  padding-bottom: 8px;
}

.article-head {
  padding-top: clamp(28px, 6vw, 56px);
  text-align: center;
}

.meta {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.article-head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--fs-h1);
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.dek {
  max-width: 34em;
  margin: 1.25rem auto 0;
  font-size: var(--fs-dek);
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Two-image mosaic ---------- */

.mosaic {
  margin: clamp(28px, 5vw, 44px) 0 0;
}

.mosaic__grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  aspect-ratio: 5 / 4;
}

.mosaic__item {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background-color: var(--surface);
}

.mosaic__item img,
.mosaic__item video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mosaic__item--wide img {
  object-position: 28% 40%;
}

.mosaic__item--tall video {
  object-position: 50% 30%;
}

.mosaic figcaption {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

/* ---------- Prose ---------- */

.prose p {
  margin: 0 0 1.15em;
}

.prose p:last-child {
  margin-bottom: 0;
}

.opening {
  margin-top: clamp(36px, 6vw, 56px);
}

.opening p:first-child {
  font-size: clamp(1.1875rem, 1.1rem + 0.4vw, 1.3125rem);
  line-height: 1.6;
}

.nb {
  white-space: nowrap;
}

.item {
  margin-top: var(--section-gap);
}

.item h2 {
  margin: 0 0 1.1rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

.item h2::before {
  counter-increment: item;
  content: counter(item, decimal-leading-zero);
  display: block;
  margin-bottom: 0.85rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  letter-spacing: 0.16em;
  color: var(--accent);
}

/* ---------- Figures ---------- */

.figure {
  margin: 2rem 0;
}

.frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background-color: var(--surface);
  aspect-ratio: 3 / 2;
}

.frame img,
.frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame--wide {
  aspect-ratio: 1200 / 630;
}

.frame--portrait {
  aspect-ratio: 4 / 5;
}

.frame--portrait video {
  object-position: 50% 28%;
}

.figure--inset {
  max-width: 100%;
}

.split__media {
  max-width: 280px;
  margin: 2rem auto;
}

/* ---------- Pull line ---------- */

.pull {
  margin: 2.25rem 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.625rem);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-wrap: balance;
}

/* ---------- Question and answer (accordion look) ---------- */

.qa {
  margin: 1.5rem 0 0;
  color: var(--ink);
}

.qa + .qa {
  margin-top: 1.5rem;
}

.qa summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 10px 16px;
  background-color: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
  transition: color 0.2s ease;
}

.qa summary::-webkit-details-marker {
  display: none;
}

.qa summary::after {
  content: "+";
  flex: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent);
}

.qa[open] summary::after {
  content: "\2212";
}

.qa summary:hover {
  color: var(--accent);
}

.qa summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.qa p {
  margin: 0.9rem 0 0;
  padding: 0 4px;
}

/* ---------- Call to action: thick underlined text link ---------- */

.cta-row {
  margin: 2.25rem 0 0;
}

.cta {
  display: inline-block;
  min-height: 44px;
  margin-left: -0.2rem;
  padding: 0.4rem 0.2rem 0.3rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 4px solid var(--accent);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0;
  transition: background-size 0.25s ease, color 0.25s ease;
}

.cta span {
  display: inline-block;
  transition: transform 0.25s ease;
}

.cta:hover,
.cta:focus-visible {
  background-size: 100% 100%;
  color: var(--accent-ink);
}

.cta:hover span,
.cta:focus-visible span {
  transform: translateX(4px);
}

.cta:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

/* ---------- Footer: bordered imprint card ---------- */

.page-end {
  width: 100%;
  max-width: 1016px;
  margin: var(--section-gap) auto 0;
  padding: 0 var(--gutter) clamp(32px, 6vw, 64px);
  background-color: var(--bg);
  color: var(--ink);
}

.page-end__card {
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background-color: var(--bg);
  color: var(--ink);
  font-size: var(--fs-small);
  line-height: 1.65;
}

.page-credit {
  max-width: 46em;
  margin: 0 0 1.5rem;
  color: var(--ink);
}

.address p {
  margin: 0 0 0.4rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.address p:last-child {
  margin-bottom: 0;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  margin-top: 1.5rem;
}

.legal-links a,
.about-link a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.legal-links a:hover,
.about-link a:hover {
  color: var(--ink);
}

.legal-links a:focus-visible,
.about-link a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.about-link {
  margin: 0;
}

/* ---------- Legal and about documents ---------- */

.doc {
  background-color: var(--bg);
  color: var(--ink);
  padding-top: clamp(24px, 5vw, 48px);
}

.doc h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--fs-h1);
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.doc .version-line {
  margin: 1rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
}

.doc .doc__intro {
  margin: 1.25rem 0 0;
  font-size: var(--fs-dek);
  line-height: 1.6;
  color: var(--muted);
}

.doc section {
  margin-top: clamp(32px, 5vw, 48px);
}

.doc h2 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.4375rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.doc p {
  margin: 0 0 1em;
}

.doc ul {
  margin: 0 0 1em;
  padding-left: 1.25rem;
}

.doc li {
  margin-bottom: 0.4em;
}

.doc a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.doc a:hover {
  color: var(--ink);
}

.doc a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 480px ---------- */

@media (min-width: 480px) {
  .figure--inset {
    max-width: 82%;
    margin-left: auto;
  }

  .mosaic__grid {
    aspect-ratio: 4 / 3;
  }
}

/* ---------- 768px ---------- */

@media (min-width: 768px) {
  .masthead {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 20px;
    padding-top: 28px;
  }

  .mosaic__grid {
    aspect-ratio: 16 / 9;
    gap: 14px;
  }

  .split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 232px;
    gap: 40px;
    align-items: start;
    margin-bottom: 1.15em;
  }

  .split__media {
    max-width: none;
    margin: 0.5rem 0 0;
  }

  .legal-links {
    gap: 0 28px;
  }
}

/* ---------- 1024px: masthead becomes a sticky sidebar ---------- */

@media (min-width: 1024px) {
  .layout {
    max-width: 1016px;
    display: grid;
    grid-template-columns: 200px minmax(0, 680px);
    column-gap: 72px;
    justify-content: center;
    align-items: start;
    padding: 0 32px;
  }

  .masthead {
    position: sticky;
    top: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 6px;
    padding-top: 64px;
  }

  .wordmark {
    font-size: 1.625rem;
  }

  .article-head {
    padding-top: 64px;
  }

  .doc {
    padding-top: 64px;
  }
}
