/* The Listing Sheet, business-card edition — ekaterina.biz */
:root {
  --green: #0f3b2e;
  --green-deep: #0a2b21;
  --green-tint: #b9d3c3;   /* secondary text on green, 7:1 */
  --green-line: rgba(247, 245, 239, 0.22);
  --sheet: #f7f5ef;
  --ink: #101512;
  --ink-soft: #3f5f4f;     /* secondary text on sheet, ~6:1 */
  --rule: rgba(15, 59, 46, 0.18);
  --rice: #cfe66a;
  --rice-deep: #a9c437;
  --display: "Unbounded", "Arial Black", sans-serif;
  --text: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad-x: clamp(22px, 4.2vw, 64px);
  --pad-y: clamp(22px, 3.2vw, 44px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--green) var(--sheet); }
body {
  margin: 0;
  background: var(--green-deep);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--rice); color: var(--ink); }
:focus-visible { outline: 3px solid var(--rice-deep); outline-offset: 3px; border-radius: 2px; }
.contacts :focus-visible { outline-color: var(--rice); }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, p, figure { margin: 0; }
b, strong { font-weight: inherit; }

/* Language switching: markup carries both languages; the root attribute picks one. */
:root[data-lang="en"] [lang="ru"], :root[data-lang="ru"] [lang="en"] { display: none !important; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--rice); color: var(--ink); padding: 10px 14px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- The card: photo left, sheet right, one viewport ---------- */
.card {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  min-height: 100svh;
}
.card > * { min-width: 0; }
.portrait { position: relative; overflow: hidden; background: var(--green-deep); }
.portrait img {
  display: block; width: 100%; height: 100%; min-height: 100svh;
  object-fit: cover; object-position: 50% 18%;
}
.sheet {
  background: var(--sheet);
  padding: var(--pad-y) var(--pad-x);
  display: flex; flex-direction: column; gap: clamp(18px, 2.4vh, 28px);
  position: relative;
}

.lang {
  position: absolute; top: var(--pad-y); right: var(--pad-x);
  display: inline-flex; padding: 3px;
  border: 1px solid var(--rule); border-radius: 999px;
  --pill: 44px;
}
.lang::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: var(--pill); height: calc(100% - 6px);
  background: var(--rice); border-radius: 999px;
  transition: transform 0.5s var(--ease);
}
:root[data-lang="ru"] .lang::before { transform: translateX(var(--pill)); }
.lang-btn {
  appearance: none; border: 0; background: transparent; color: var(--ink-soft);
  font: 600 0.75rem/1 var(--text); letter-spacing: 0.06em;
  width: var(--pill); padding: 7px 0; border-radius: 999px; cursor: pointer; position: relative;
  transition: color 0.35s var(--ease);
}
.lang-btn:hover { color: var(--ink); }
.lang-btn[aria-pressed="true"] { color: var(--ink); }

.title { padding-right: 120px; }
.name {
  font-family: var(--display); font-weight: 800; color: var(--green);
  font-size: clamp(1.7rem, 2.9vw, 2.7rem); line-height: 1.02; letter-spacing: -0.03em;
  text-wrap: balance; max-width: 14ch;
}
.headline {
  margin-top: 12px;
  font-size: clamp(1rem, 1.25vw, 1.2rem); line-height: 1.35; font-weight: 500;
  max-width: 34ch; text-wrap: balance;
}
.where {
  margin-top: 8px; display: flex; gap: 7px; align-items: flex-start;
  color: var(--ink-soft); font-size: 0.875rem; line-height: 1.45; max-width: 52ch;
}
.pin { flex: 0 0 auto; margin-top: 2px; color: var(--green); }

.bio { max-width: 62ch; font-size: clamp(0.9375rem, 1.05vw, 1.0625rem); line-height: 1.5; }

/* ---------- Two compact lists ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 8px clamp(24px, 3vw, 48px); }
.list h2 {
  font-family: var(--display); font-weight: 600; font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--green); padding-bottom: 8px; border-bottom: 1px solid var(--green);
}
.list li {
  display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 2px 12px; align-items: baseline;
  padding: 8px 0; border-top: 1px solid var(--rule); font-size: 0.875rem; line-height: 1.35;
}
.list li:first-child { border-top: 0; }
.list time { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: 0.8125rem; white-space: nowrap; }
.list strong { display: block; font-weight: 600; color: var(--ink); }
.list div > span { display: block; color: var(--ink-soft); }

/* ---------- Contacts: three tiles on the green field ---------- */
.contacts {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr);
  background: var(--green); color: var(--sheet);
}
.contacts a {
  position: relative; display: block; padding: 12px 40px 12px 16px;
  border-left: 1px solid var(--green-line); text-decoration: none;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.contacts a:first-child { border-left: 0; }
.contacts .k { display: block; font-size: 0.75rem; letter-spacing: 0.04em; color: var(--green-tint); margin-bottom: 4px; }
.contacts b { display: block; font-weight: 600; font-size: 0.9rem; line-height: 1.3; overflow-wrap: anywhere; }
.contacts .arrow { position: absolute; right: 14px; top: 13px; color: var(--rice); transition: transform 0.45s var(--ease); }
.contacts a:hover, .contacts a:focus-visible { background: var(--rice); color: var(--ink); }
.contacts a:hover .k, .contacts a:focus-visible .k { color: var(--ink-soft); }
.contacts a:hover .arrow, .contacts a:focus-visible .arrow { color: var(--ink); transform: translate(2px, -2px); }

.foot {
  margin-top: auto;
  display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between;
  font-size: 0.75rem; color: var(--ink-soft); letter-spacing: 0.02em;
}

/* ---------- Motion: one entrance, one re-print on language switch ---------- */
@media (prefers-reduced-motion: no-preference) {
  .sheet > [style*="--i"] {
    animation: rise 1s var(--ease) both;
    animation-delay: calc(var(--i) * 70ms + 60ms);
  }
  .portrait img { animation: reveal 1.4s var(--ease) both; }
  :root.switching .sheet { animation: reprint 0.55s var(--ease); }
}
@keyframes rise { from { transform: translateY(10px); filter: blur(3px); } to { transform: none; filter: blur(0); } }
@keyframes reveal { from { transform: scale(1.03); filter: blur(4px); } to { transform: none; filter: blur(0); } }
@keyframes reprint { 0% { opacity: 0.35; transform: translateY(3px); } 100% { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-height: 760px) and (min-width: 821px) {
  :root { --pad-y: 18px; }
  .sheet { gap: 12px; }
  .name { font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
  .headline { margin-top: 8px; }
  .bio { font-size: 0.9rem; line-height: 1.45; }
  .list li { padding: 5px 0; font-size: 0.8125rem; }
  .list h2 { padding-bottom: 6px; }
  .contacts a { padding: 9px 36px 9px 14px; }
}
@media (max-width: 1100px) and (min-width: 821px) {
  .card { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
  .cols { grid-template-columns: 1fr; gap: 18px; }
  .contacts { grid-template-columns: 1fr; }
  .contacts a { border-left: 0; border-top: 1px solid var(--green-line); }
  .contacts a:first-child { border-top: 0; }
}
@media (max-width: 820px) {
  .card { grid-template-columns: 1fr; min-height: 0; }
  .portrait img { min-height: 0; height: min(40svh, 100vw); object-position: 50% 12%; }
  .sheet { padding: 18px 20px 24px; gap: 18px; }
  .lang { position: relative; top: auto; right: auto; align-self: flex-end; margin-bottom: -6px; order: 0; }
  .title { padding-right: 0; order: 1; }
  .contacts { order: 2; grid-template-columns: 1fr; }
  .bio { order: 3; }
  .cols { order: 4; grid-template-columns: 1fr; gap: 18px; }
  .foot { order: 5; margin-top: 4px; }
  .name { font-size: clamp(1.6rem, 7.6vw, 2.2rem); max-width: none; }
  .contacts a { display: flex; align-items: center; gap: 10px; padding: 11px 40px 11px 14px; border-left: 0; border-top: 1px solid var(--green-line); }
  .contacts a:first-child { border-top: 0; }
  .contacts .k { margin: 0; flex: 0 0 72px; }
  .contacts b { flex: 1; font-size: 0.9375rem; }
  .contacts .arrow { top: 50%; transform: translateY(-50%); }
  .contacts a:hover .arrow, .contacts a:focus-visible .arrow { transform: translate(2px, calc(-50% - 2px)); }
}
