/* 🦊 account.haru.by — чёрный фон, мягкие поверхности как в Material You, поля как в терминале.
   Цвета по умолчанию — золото haru.by; nt.js перекрашивает их под картинку на фоне. */

:root {
  color-scheme: dark;
  --bg: #000;
  --surface: #0d0c0f;
  --surface-2: #141217;
  --surface-3: #1c1920;
  --line: #2a2630;
  --line-strong: #463f4d;
  --ink: #f3eee7;
  --soft: #9d95a3;
  --primary: #f2c26b;          /* рыжее золото, как хвост */
  --on-primary: #1d1405;
  --tertiary: #c3b0ff;
  --tertiary-container: #241d36;
  --focus: #eadfb2;            /* светлая рамка у активного поля */
  --bad: #ff5d7a;
  --bad-container: #ff5d7a1f;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "Fira Code", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
.loading { min-height: 100dvh; display: grid; place-items: center; margin: 0; }

h1 { font-size: 30px; line-height: 1.15; font-weight: 650; margin: 0; letter-spacing: -0.015em; overflow-wrap: anywhere; }
h2 { font-size: 18px; font-weight: 600; margin: 0; }
p { margin: 0; }
a { color: var(--primary); }
.soft { color: var(--soft); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); }
.accent { color: var(--primary); }
[hidden] { display: none !important; }
::selection { background: var(--primary); color: var(--on-primary); }

.stack { display: grid; gap: 16px; }
.stack > * { min-width: 0; }
.stack.tight { gap: 6px; }
.stack.wide-gap { gap: 36px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .stack { flex: 1; min-width: 0; }
.row > input { width: 0; min-width: 0; }
.row.end { justify-content: flex-end; }

/* ——— кнопки: таблетки как в Material You ——— */
button, .btn { font: 600 15px/1 var(--sans); height: 46px; padding: 0 22px; border-radius: 23px; border: 0;
               display: inline-flex; align-items: center; justify-content: center; gap: 8px;
               background: var(--primary); color: var(--on-primary); cursor: pointer; text-decoration: none;
               transition: filter .15s, transform .1s, background .3s, color .3s; }
button:hover, .btn:hover { filter: brightness(1.08); }
button:active, .btn:active { transform: scale(.98); }
button:disabled { cursor: default; filter: none; transform: none; }
/* не готово: кнопка гаснет и зачёркнута; .busy — запрос в пути, вид прежний */
button:disabled:not(.busy) { background: transparent; color: var(--soft); border: 1px dashed var(--line-strong);
                             text-decoration: line-through; text-decoration-thickness: 1.5px; }
button.busy { cursor: progress; opacity: .7; }
:is(button, .btn).tonal { background: var(--tertiary-container); color: var(--tertiary); }
:is(button, .btn).quiet { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
:is(button, .btn).danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
:is(button, .btn).small { height: 36px; padding: 0 16px; font-size: 14px; }
/* круглая кнопка с одной иконкой */
.icon-btn { width: 46px; padding: 0; background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.icon-btn.small { width: 36px; padding: 0; }
/* поверх картинки: плотная подложка, без стекла */
:is(button, .btn).on-art { background: #000; color: #fff; border: 1px solid #ffffff38; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }
button.text { background: none; color: var(--primary); height: auto; padding: 0; font-weight: 500;
              text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ——— поля: подпись врезана в рамку, у активного — «>» слева ——— */
.field { position: relative; display: block; border: 1.5px solid var(--line-strong); border-radius: 6px;
         padding: 13px 14px 10px; transition: border-color .15s; cursor: text; }
.field > span { position: absolute; top: -0.75em; left: 10px; padding: 0 6px; background: var(--card-bg, var(--bg));
                font: 13px/1.4 var(--mono); color: var(--soft); transition: color .15s; }
.field :is(input, textarea) { all: unset; display: block; width: 100%; font: 15px/1.5 var(--mono); color: var(--ink); }
.field textarea { min-height: 4.5em; white-space: pre-wrap; resize: vertical; }
.field :is(input, textarea)::placeholder { color: color-mix(in srgb, var(--soft) 55%, transparent); }
.field:focus-within { border-color: var(--focus); }
.field:focus-within > span { color: var(--focus); }
.field:focus-within::before { content: ">"; position: absolute; left: -20px; top: 50%; translate: 0 -50%;
                              font: 15px var(--mono); color: var(--focus); }
.field.bad { border-color: var(--bad); }
.field.bad > span { color: var(--bad); }
.hint { justify-self: start; font: italic 13px/1.4 var(--mono); color: var(--bad); background: var(--bad-container);
        border-left: 2px solid var(--bad); padding: 5px 10px; }
/* ошибка поля — справа под ним, с номером; ↑ стоит на нижней рамке под нужным символом */
.field + .hint { justify-self: end; border-left: 0; border-right: 2px solid var(--bad); }
.field .mark { position: absolute; top: 100%; translate: 0 -55%; width: 1ch; padding: 0 2px; margin-left: -2px;
               left: clamp(12px, calc(14px + var(--at) * 1ch - var(--scroll, 0) * 1px), calc(100% - 14px - 1ch));
               font: 600 15px/1 var(--mono); font-style: normal; text-align: center; color: var(--bad);
               background: var(--card-bg, var(--bg)); pointer-events: none; scale: 1.3; }

.check { position: relative; display: inline-flex; gap: 8px; font: 14px var(--mono); color: var(--soft);
         cursor: pointer; user-select: none; width: fit-content; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check::before { content: "[ ]"; white-space: pre; }
.check:has(input:checked)::before { content: "[✓]"; color: var(--focus); }
.check:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ——— экран во весь рост: слева содержимое, справа картинка наискосок ——— */
.screen { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 1.15fr); }
.screen.wide { grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); }
.side { display: flex; flex-direction: column; gap: 28px; padding: 28px clamp(28px, 5vw, 88px) 56px; min-width: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; width: fit-content; color: var(--soft); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--ink); }
.side > * { width: 100%; max-width: 660px; }
.screen:not(.wide) .side { justify-content: center; }
.screen:not(.wide) .side > * { max-width: 420px; }
.screen:not(.wide) h1 { font-size: 40px; }

.art { position: sticky; top: 0; align-self: start; height: 100dvh; margin: 0; overflow: hidden;
       clip-path: polygon(20% 0, 100% 0, 100% 100%, 0 100%); }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art::after { content: ""; position: absolute; inset: 0; pointer-events: none;
              background: linear-gradient(to top, #000c, transparent 40%); }
.art figcaption { position: absolute; z-index: 1; right: 32px; bottom: 32px; text-align: right;
                  font-size: 28px; line-height: 1.2; font-weight: 650; text-shadow: 0 2px 12px #000; }
.art .over { position: absolute; z-index: 1; top: 20px; right: 20px; display: flex; gap: 8px; }
.art .dots { position: absolute; z-index: 1; right: 24px; bottom: 24px; display: flex; gap: 6px; }
.dots i { width: 18px; height: 18px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #0008; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px;
         color: var(--ink); text-decoration: none; width: fit-content; }
.brand img { width: 36px; height: 36px; border-radius: 50%; }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; }
.tabs a { position: relative; height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
          color: var(--soft); text-decoration: none; font-size: 14px; font-weight: 600; transition: color .2s; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--primary); }
.tabs a[aria-current]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px;
                               border-radius: 3px 3px 0 0; background: var(--primary); }

/* ——— карточка человека ——— */
.person { display: grid; gap: 22px; }
.person-head { display: flex; align-items: center; gap: 24px; min-width: 0; }
.person-name { display: grid; gap: 6px; min-width: 0; }
.person h1 { font-size: clamp(34px, 4.4vw, 54px); line-height: 1; letter-spacing: -0.03em; }
.handle { display: flex; flex-wrap: wrap; gap: 0 12px; font: 15px/1.5 var(--mono); color: var(--soft); }
.handle span::before { content: "/"; margin-right: 12px; color: var(--line-strong); }
.person-head .avatar { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--primary); }
.face { all: unset; position: relative; flex: none; border-radius: 50%; cursor: pointer; }
.face-edit { position: absolute; right: -2px; bottom: -2px; width: 36px; height: 36px; border-radius: 50%;
             display: grid; place-items: center; background: var(--primary); color: var(--on-primary);
             box-shadow: 0 0 0 4px var(--bg); transition: transform .15s; }
.face:hover .face-edit { transform: scale(1.1); }
.face:hover .avatar { filter: brightness(.85); }
.face:focus-visible { outline: 2px solid var(--focus); outline-offset: 8px; }

/* статус — строкой терминала, с мигающим курсором */
.prompt { font: 16px/1.5 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.prompt::before { content: ">"; margin-right: 1ch; color: var(--primary); }
.prompt::after { content: ""; display: inline-block; width: .6em; height: 1.1em; margin-left: .3ch; vertical-align: -.2em;
                 background: var(--primary); animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .prompt::after { animation: none; } }

.bio { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 18px; line-height: 1.55; max-width: 56ch; }
.meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--soft); font-size: 15px; }
.meta li { display: inline-flex; align-items: center; gap: 7px; }
.meta .icon { color: var(--primary); }

/* ссылки — строками: название, домен, стрелка */
.links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.links a { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; align-items: center; gap: 14px;
           padding: 13px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.links b { font-weight: 600; overflow-wrap: anywhere; }
.links span { font: 14px var(--mono); color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links .icon { color: var(--soft); transition: transform .15s, color .15s; }
.links a:hover .icon { color: var(--primary); transform: translate(2px, -2px); }
.links a:hover b { color: var(--primary); }

/* свои поля — табличкой как в терминале */
.fields { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); margin: 0;
          border: 1.5px solid var(--line-strong); border-radius: 6px; }
.fields > * { margin: 0; padding: 10px 14px; border-top: 1px dashed var(--line); overflow-wrap: anywhere; }
.fields > :nth-child(-n+2) { border-top: 0; }
.fields dt { font: 14px/1.5 var(--mono); color: var(--soft); }
.fields dd { white-space: pre-wrap; }

/* аватарка: картинка или первая буква на цвете человека */
.avatar { --size: 40px; width: var(--size); height: var(--size); flex: none; border-radius: 50%; overflow: hidden;
          display: inline-grid; place-items: center; font-weight: 700; font-size: calc(var(--size) * .42);
          background: color-mix(in srgb, var(--accent) 22%, #000); color: var(--accent); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ——— кабинет ——— */
.card { --card-bg: var(--surface-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 28px;
        padding: 24px 24px 24px 28px; display: grid; gap: 16px; }
.card > * { min-width: 0; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, transparent); }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list > li { display: flex; justify-content: space-between; align-items: center; gap: 12px;
             padding: 12px 14px; background: var(--surface-3); border-radius: 16px; min-width: 0; }
.list .item { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; flex: 1; }
.list .item > .icon { margin-left: auto; color: var(--soft); }
.list .item span { display: grid; min-width: 0; }
.list code { overflow-wrap: anywhere; }
.list .check { white-space: nowrap; }
.empty { padding: 28px; border: 1.5px dashed var(--line-strong); border-radius: 20px; color: var(--soft); text-align: center; }

code, .key { font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
.key { background: #000; border: 1.5px dashed var(--primary); border-radius: 12px; padding: 12px 14px; color: var(--primary); }

.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 12px; align-items: start; }
.pair > button { align-self: center; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch { width: 38px; height: 38px; padding: 0; border-radius: 50%; background: var(--c); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c); }

/* ——— окошко кадрирования ——— */
dialog.sheet { --card-bg: var(--surface-2); width: min(400px, calc(100vw - 32px)); padding: 24px; border-radius: 28px;
               border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); display: grid; gap: 14px; }
dialog.sheet:not([open]) { display: none; }
dialog::backdrop { background: #000b; backdrop-filter: blur(6px); }
.crop { width: 100%; aspect-ratio: 1; display: block; border-radius: 20px; background: #000; touch-action: none; cursor: grab; }
.crop:active { cursor: grabbing; }
.zoom { display: flex; align-items: center; gap: 12px; color: var(--soft); font: 18px var(--mono); }
.zoom input { flex: 1; accent-color: var(--primary); }

.toast { position: fixed; z-index: 10; left: 50%; bottom: 24px; translate: -50% 0; margin: 0; max-width: calc(100vw - 32px);
         padding: 14px 20px; border-radius: 14px; background: var(--ink); color: #000; font-weight: 500;
         box-shadow: 0 8px 30px #000a; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; translate: -50% 12px; } }

/* ——— телефон: картинка шапкой сверху, срез снизу ——— */
@media (max-width: 700px) {
  .screen, .screen.wide { grid-template-columns: 1fr; }
  .art { order: -1; position: relative; height: 32vh; min-height: 190px; max-height: 300px;
         clip-path: polygon(0 0, 100% 0, 100% 76%, 0 100%); }
  .art figcaption { font-size: 18px; top: 18px; left: 18px; right: auto; bottom: auto; text-align: left; }
  .art .over { top: 14px; right: 14px; }
  .art .dots { bottom: auto; top: 60px; right: 18px; }
  .screen:not(.wide) .art .over { display: none; }
  .side { padding: 4px 16px 40px 28px; gap: 24px; }
  .screen:not(.wide) .side { justify-content: start; }
  .screen:not(.wide) h1 { font-size: 30px; }
  .tabs { flex: 1; }
  .tabs a { flex: 1; padding: 0 6px; }
  .person-head { gap: 18px; }
  .person-head .avatar { --size: 88px !important; }
  .card { padding: 20px 18px 20px 26px; border-radius: 24px; }
  .pair { grid-template-columns: minmax(0, 1fr) auto; }
  .pair > :nth-child(2) { grid-row: 2; }
  .pair > button { grid-row: 1 / 3; grid-column: 2; align-self: center; }
}
