/* Static pages of samdzimari.com (epic F-0). No JS, no inline styles (CSP style-src 'self').
   Desktop layout rules: Backlog Frontend, "Требование: десктоп-макет". Colors: Design §2.2. */

:root {
  --midnight-indigo: #12141f;
  --deep-slate: #1c2030;
  --aged-gold: #c9a24b;
  --candle-amber: #e8a15c;
  --oxblood: #5c2430;
  --parchment: #f3ecdd;
  --muted-parchment: #b9b2a0;
  --content-max: 40rem;
  --font-heading: Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--midnight-indigo);
  color: var(--parchment);
  font: 1rem/1.6 var(--font-body);
}

a {
  color: var(--aged-gold);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--candle-amber);
}

a:focus-visible {
  outline: 2px solid var(--candle-amber);
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
}

/* ---------- Fixed photo background (rule 7) + darkening (Design §1.8) ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgb(18 20 31 / 0.6), rgb(18 20 31 / 0.4)),
    url("/img/samdzimari_background-mobile.webp") 50% 100% / cover no-repeat,
    var(--midnight-indigo);
}

@media (orientation: landscape) {
  .bg {
    background:
      linear-gradient(rgb(18 20 31 / 0.6), rgb(18 20 31 / 0.4)),
      url("/img/samdzimari_background-desktop.webp") 50% 100% / cover no-repeat,
      var(--midnight-indigo);
  }
}

/* ---------- Shell: mobile (one column) ---------- */

.shell {
  width: 100%;
}

.char {
  height: min(62svh, 34rem);
  overflow: hidden;
}

.page-compact .char {
  height: min(30svh, 14rem);
}

.char img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 15%;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}

/* Header, text and footer share one dark panel: contrast does not depend on the photo behind.
   Gold gradient border + thin inner line separate the content block from the background photo;
   on desktop the frame moves to .shell so picture and text read as one block. */
.main,
.shell {
  --frame-fill: linear-gradient(160deg, rgb(28 32 48 / 0.94), rgb(18 20 31 / 0.96));
  --frame-gold: linear-gradient(135deg, #e6c87a, var(--aged-gold) 30%, #6e5523 55%, var(--aged-gold) 80%, #e6c87a);
}

.main {
  position: relative;
  width: min(100% - 2rem, var(--content-max));
  margin: -2rem auto 1rem;
  padding: 0 1.25rem 1rem;
  border: 2px solid transparent;
  border-radius: 0.75rem;
  background: var(--frame-fill) padding-box, var(--frame-gold) border-box;
  box-shadow: 0 0 2rem rgb(201 162 75 / 0.18), 0 0 1.5rem rgb(0 0 0 / 0.5);
}

.main::after,
.shell::after {
  content: "";
  position: absolute;
  inset: 0.375rem;
  border: 1px solid rgb(201 162 75 / 0.35);
  border-radius: 0.5rem;
  pointer-events: none;
}

.shell::after {
  content: none;
}

.site-header {
  padding: 1rem 0 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--aged-gold);
  font: 1.25rem/1 var(--font-heading);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
}

h1,
h2 {
  margin: 0 0 0.75rem;
  color: var(--aged-gold);
  font-family: var(--font-heading);
  font-weight: normal;
  line-height: 1.25;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  margin-top: 1.75rem;
  font-size: 1.25rem;
}

p,
ul {
  margin: 0 0 1rem;
}

ul {
  padding-left: 1.25rem;
}

.updated,
.note {
  color: var(--muted-parchment);
  font-size: 0.875rem;
}

.price {
  color: var(--aged-gold);
  font-weight: 600;
}

.seller {
  font-style: normal;
}

/* Long emails must not break the layout (Design §3.4) */
.seller a,
.panel a[href^="mailto:"] {
  overflow-wrap: anywhere;
}

.doc-links a,
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

/* ---------- Footer / link row ---------- */

.site-footer {
  padding-top: 1rem;
  color: var(--muted-parchment);
  font-size: 0.875rem;
  text-align: center;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.links li {
  display: flex;
  align-items: center;
}

.links li + li::before {
  content: "\00b7";
  color: var(--muted-parchment);
}

.links a {
  padding: 0 0.3rem;
}

.main .site-footer {
  margin-top: 1.5rem;
  border-top: 1px solid var(--oxblood);
}

.copyright {
  margin: 0.25rem 0 0;
}

/* ---------- Desktop: two columns (rules 1-6) ---------- */

@media (min-width: 64rem) and (min-height: 40rem) {
  :root {
    --block-h: min(100dvh - 3rem, 56rem);
  }

  /* Centered block of fixed height: the page itself never scrolls */
  body {
    display: flex;
    align-items: center;
  }

  .shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(32.5rem, 52vw, 40rem);
    gap: 0;
    width: min(100% - 3rem, 75rem);
    height: var(--block-h);
    margin: 0 auto;
  }

  /* Frame and picture stay put; only the text column scrolls inside the frame */
  .char,
  .page-compact .char {
    height: 100%;
  }

  .char img {
    object-position: 50% 20%;
    -webkit-mask-image: linear-gradient(to right, #000 75%, transparent);
    mask-image: linear-gradient(to right, #000 75%, transparent);
  }

  .shell {
    position: relative;
    overflow: clip;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    background: var(--frame-fill) padding-box, var(--frame-gold) border-box;
    box-shadow: 0 0 2rem rgb(201 162 75 / 0.18), 0 0 1.5rem rgb(0 0 0 / 0.5);
  }

  .shell::after {
    content: "";
    z-index: 1;
  }

  .main {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: rgb(201 162 75 / 0.5) transparent;
    scrollbar-width: thin;
    margin: 0;
    padding: 0.5rem 2rem 1rem;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .main::after {
    content: none;
  }

  .panel {
    flex: 1 0 auto;
  }

  h1 {
    font-size: 2rem;
  }
}

/* ---------- Root "/": full-screen coming soon picture + link row (F-03) ---------- */

/* Text in the picture is centered, so cover-cropping only trims sky and edges */
.coming-soon {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #05070b;
}

.coming-soon picture {
  position: absolute;
  inset: 0;
}

.coming-soon picture img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.coming-soon .site-footer {
  position: absolute;
  inset: auto 0 0;
  font-size: 0.8125rem;
  padding: 2rem 0.5rem max(0.75rem, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgb(5 7 11 / 0.85));
}
