/* ==========================================================================
   Roman Gnizdiukh — private client & business advisory
   Editorial, typographic, no imagery, no scripts.
   ========================================================================== */

:root {
  color-scheme: light;

  --paper:      #f3f1ec;
  --paper-sunk: #eceae3;
  --ink:        #17181a;
  --ink-soft:   #55565a;
  --ink-faint:  #8b8b87;
  --rule:       rgba(23, 24, 26, .16);
  --rule-soft:  rgba(23, 24, 26, .09);
  --accent:     #7c3a2e;

  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans:  "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --bar: 3.5rem;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 60ch;
}
*, *::before, *::after { box-sizing: border-box; }

html {
  /* The plates bleed past the right edge on purpose. Clip, never hidden:
     hidden here would make this a scroll container and kill both sticky
     headers. It belongs on html, not body — body's overflow is propagated
     to the viewport and so has no effect on body itself. */
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 1rem);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.0125rem, .55vw + .9rem, 1.125rem);
  line-height: 1.62;
  font-weight: 300;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper tooth — a hint of texture instead of photography. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .30;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
}
.wrap {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: .6rem 1rem;
  font-family: var(--sans);
  font-size: .75rem;
  z-index: 200;
}
.skip:focus { left: 0; }

a { color: inherit; }

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

/* ── Engraved plates ──────────────────────────────────────────────────────
   Swiss-style shaded relief and engraved panoramas, carried as CSS masks so
   the ink is painted with var(--ink) and inverts with the theme by itself.
   Generated, not photographed; kept faint enough to read as paper, not image.
   ------------------------------------------------------------------------ */

.plate {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  background-color: var(--ink);
  -webkit-mask-repeat: no-repeat;  mask-repeat: no-repeat;
}

.plate--relief {
  top: -5rem;
  right: -8%;
  width: min(82vw, 68rem);
  aspect-ratio: 1300 / 1092;
  opacity: .085;
  -webkit-mask-image: url("img/relief.webp");  mask-image: url("img/relief.webp");
  -webkit-mask-size: contain;  mask-size: contain;
  -webkit-mask-position: top right;  mask-position: top right;
}

.plate--contours {
  z-index: 0; /* the sunk band has its own background, so this plate sits above it */
  inset: 0 -6% 0 auto;
  width: min(58vw, 46rem);
  opacity: .11;
  -webkit-mask-image: url("img/contours.webp");  mask-image: url("img/contours.webp");
  -webkit-mask-size: cover;  mask-size: cover;
  -webkit-mask-position: center right;  mask-position: center right;
}

.plate--panorama {
  inset: auto 0 clamp(1rem, 3vw, 2.5rem) 0;
  height: clamp(7rem, 16vw, 13rem);
  opacity: .14;
  -webkit-mask-image: url("img/panorama.webp");  mask-image: url("img/panorama.webp");
  -webkit-mask-size: cover;  mask-size: cover;
  -webkit-mask-position: center bottom;  mask-position: center bottom;
}

.plate--tailpiece {
  inset: auto 0 1.75rem 0;
  height: clamp(4.5rem, 9vw, 7rem);
  opacity: .16;
  -webkit-mask-image: url("img/tailpiece.webp");  mask-image: url("img/tailpiece.webp");
  -webkit-mask-size: contain;  mask-size: contain;
  -webkit-mask-position: center bottom;  mask-position: center bottom;
}
/* ── Top bar: monogram, menu ──────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule-soft);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--bar);
}

/* Monogram — a printer's block, not a badge. */
/* Monogram logo — SVG mark. */
.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.125rem;
  height: 2.125rem;
  text-decoration: none;
  transition: opacity .2s ease;
}

.logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo:hover {
  opacity: .72;
}


.menu-toggle {
  display: none;
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: .25rem 0;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
}
.menu-toggle:hover { color: var(--ink); border-bottom-color: var(--ink); }

.topnav ul {
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.topnav a {
  display: block;
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: .2rem;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.topnav a:hover { color: var(--ink); border-bottom-color: var(--rule); }

/* Below the fold-out width the links become a panel under the bar.
   Without JS the .js class never lands and the row simply wraps. */
@media (max-width: 60rem) {
  .js .menu-toggle { display: inline-block; }
  .js .topnav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }
  .js .topnav[data-open="true"] { display: block; }
  .js .topnav ul { flex-direction: column; gap: 0; }
  .js .topnav li + li { border-top: 1px solid var(--rule-soft); }
  .js .topnav a { padding: .95rem var(--gutter); border-bottom: 0; }
  .js .topnav a:hover { color: var(--ink); background: var(--paper-sunk); }
  .topnav ul { flex-wrap: wrap; gap: .35rem 1.5rem; }
}

/* ── Masthead ─────────────────────────────────────────────────────────── */

.masthead {
  position: relative;
  padding-top: clamp(3rem, 9vw, 6.5rem);
}

.nameplate {
  margin: 0;
  font-weight: 200;
  font-size: clamp(2.6rem, 10.6vw, 9.25rem);
  line-height: .9;
  letter-spacing: -.035em;
  text-indent: -.04em;
  overflow-wrap: break-word;
}

.standfirst {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  margin: clamp(1.25rem, 2.5vw, 2rem) 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.standfirst .sep { color: var(--ink-faint); }

/* ── Opening ──────────────────────────────────────────────────────────── */

.opening { padding: clamp(4.5rem, 12vw, 9rem) 0 clamp(2.5rem, 6vw, 4.5rem); }

.opening .wrap {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: 1fr;
}
@media (min-width: 62rem) {
  .opening .wrap { grid-template-columns: 1.15fr .85fr; align-items: start; }
}

.lede-display {
  margin: 0;
  max-width: 20ch;
  font-size: clamp(1.95rem, 4.6vw, 3.65rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -.018em;
  text-wrap: balance;
}

.lede-body {
  max-width: var(--measure);
  color: var(--ink-soft);
}
.lede-body p { margin: 0 0 1.1em; }
.lede-body p:last-child { margin-bottom: 0; }
@media (min-width: 62rem) { .lede-body { padding-top: .75rem; } }

/* ── At a glance ──────────────────────────────────────────────────────── */

.facts { padding-bottom: clamp(3.5rem, 9vw, 7rem); }

.facts dl {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.facts dl > div {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
@media (min-width: 48rem) {
  .facts dl { grid-template-columns: repeat(4, 1fr); gap: 0 2rem; }
  .facts dl > div { border-bottom: 0; }
}

.facts dt {
  font-family: var(--sans);
  font-size: .625rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .5rem;
}
.facts dd {
  margin: 0;
  font-size: .95rem;
  line-height: 1.45;
  color: var(--ink);
}

/* ── Sections ─────────────────────────────────────────────────────────── */

.section {
  position: relative;
  overflow: clip; /* clip, not hidden — hidden would break the sticky heading */
  padding: clamp(3.5rem, 9vw, 7.5rem) 0;
}
.section--alt { background: var(--paper-sunk); }
.section--alt > .wrap { position: relative; z-index: 1; }

.section-grid {
  display: grid;
  gap: clamp(2.25rem, 5vw, 3.5rem);
  grid-template-columns: 1fr;
}
@media (min-width: 62rem) {
  .section-grid { grid-template-columns: 16rem 1fr; gap: clamp(2.5rem, 4.5vw, 5rem); }
  .section-head { position: sticky; top: calc(var(--bar) + clamp(1.5rem, 4vw, 3rem)); }
}

.eyebrow {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  margin: 0 0 1.25rem;
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.eyebrow .num { color: var(--accent); }

.section-head h2 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.06;
  letter-spacing: -.02em;
}

/* ── Numbered practice list ───────────────────────────────────────────── */

.items { margin: 0; padding: 0; list-style: none; }

.item {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: .25rem 1rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--rule-soft);
}
.item:first-child { border-top: 1px solid var(--rule); }

.item-num {
  grid-row: 1 / span 2;
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .08em;
  color: var(--ink-faint);
  padding-top: .45rem;
}
.item h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: -.005em;
}
.item p {
  margin: .45rem 0 0;
  max-width: 56ch;
  color: var(--ink-soft);
  font-size: .975rem;
  line-height: 1.6;
}

@media (min-width: 46rem) {
  .item {
    grid-template-columns: 3rem 13rem 1fr;
    gap: 0 1.75rem;
    align-items: baseline;
  }
  .item-num { grid-row: auto; padding-top: 0; }
  .item h3 { padding-right: 1.5rem; }
  .item p { margin-top: 0; }
}

/* ── Principles ───────────────────────────────────────────────────────── */

.principle {
  padding: 1.9rem 0;
  border-top: 1px solid var(--rule-soft);
  max-width: 46rem;
}
.principle:first-child { border-top: 1px solid var(--rule); }
.principle h3 {
  margin: 0 0 .7rem;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -.012em;
  text-wrap: balance;
}
.principle p {
  margin: 0;
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: .975rem;
}

/* ── Jurisdictions ────────────────────────────────────────────────────── */

.places { margin: 0; }
.places > div {
  padding: 1.9rem 0;
  border-top: 1px solid var(--rule-soft);
}
.places > div:first-child { border-top: 1px solid var(--rule); }
.places dt {
  font-size: 1.35rem;
  font-weight: 300;
  letter-spacing: -.012em;
  margin-bottom: .55rem;
}
.places dd {
  margin: 0;
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: .975rem;
}
@media (min-width: 46rem) {
  .places > div { display: grid; grid-template-columns: 13rem 1fr; gap: 1.75rem; align-items: baseline; }
  .places dt { margin-bottom: 0; }
}

/* ── Background ───────────────────────────────────────────────────────── */

/* Author portrait: duotone into the page palette, sized like a plate in a
   printed book rather than a hero image — the source is only 407px wide, so
   200px keeps it at true 2x on a retina screen. */
.portrait {
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  max-width: 12.5rem;
}
.portrait img {
  display: block;
  width: 100%;
  height: auto;
}
.portrait figcaption {
  margin-top: .8rem;
  padding-top: .7rem;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--sans);
  font-size: .625rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.15em; }
.prose p:last-child { margin-bottom: 0; }

.record { margin: 2.5rem 0 0; }
.record > div {
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule-soft);
}
.record > div:first-child { border-top: 1px solid var(--rule); }
.record dt {
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .35rem;
}
.record dd { margin: 0; font-size: .975rem; }
.record strong { font-weight: 500; }
@media (min-width: 46rem) {
  .record > div { display: grid; grid-template-columns: 12rem 1fr; gap: 2rem; align-items: baseline; }
  .record dt { margin-bottom: 0; }
}

/* ── Contact ──────────────────────────────────────────────────────────── */

.contact-note {
  margin: 0 0 2.5rem;
  max-width: 44ch;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 300;
  line-height: 1.32;
  letter-spacing: -.012em;
  text-wrap: balance;
}

.contact-list { margin: 0; padding: 0; list-style: none; }
.contact-list li {
  display: grid;
  grid-template-columns: 1fr;
  gap: .3rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule-soft);
}
.contact-list li:first-child { border-top: 1px solid var(--rule); }
.contact-list address {
  font-style: normal;
  line-height: 1.55;
}
.contact-list .label {
  font-family: var(--sans);
  font-size: .625rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.contact-list a {
  justify-self: start;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: .1rem;
  transition: border-color .2s ease, color .2s ease;
}
.contact-list a:hover { color: var(--accent); border-bottom-color: var(--accent); }
@media (min-width: 46rem) {
  .contact-list li { grid-template-columns: 10rem 1fr; gap: 2rem; align-items: baseline; }
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.footer {
  position: relative;
  overflow: clip;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--rule);
}
.footer-name {
  margin: 0 0 1.25rem;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 200;
  letter-spacing: -.025em;
}
.footer-note {
  margin: 0 0 2.5rem;
  max-width: 48ch;
  font-size: .8125rem;
  line-height: 1.55;
  color: var(--ink-faint);
}
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.5rem;
  margin: 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--sans);
  font-size: .625rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ── Print ────────────────────────────────────────────────────────────── */

@media print {
  .grain, .topbar, .skip, .plate { display: none; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .section, .section--alt { background: none; padding: 1.5rem 0; break-inside: avoid; }
  .section-head { position: static; }
  a { text-decoration: none; }
}
