/* Roboto (variable, SIL OFL 1.1, see fonts/LICENSE-Roboto.txt).
   One file per alphabet; the browser fetches only what a page uses. */
@font-face {
  font-family: "Roboto";
  src: url("/static/fonts/roboto-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Roboto";
  src: url("/static/fonts/roboto-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto";
  src: url("/static/fonts/roboto-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Colours are roles, not values. Only these lines change between themes. */
:root {
  color-scheme: light dark;
  --bg:       #f6f7f9;
  --panel:    #ffffff;
  --panel-2:  #f0f1f4;
  --border:   #dfe1e6;
  --text:     #1f2328;
  --muted:    #5f6670;
  --danger:   #b42318;
  --verified: #087f45;       /* green: verified fact, never anything else */
  --yours:        #cca247;   /* amber text: readable on light backgrounds */
  --yours-accent: #cca247;   /* amber borders and edges */
  --yours-bg:     #faf3e1;   /* amber tint behind things waiting for you */
  --endorsed:     #7048e8;   /* violet: endorsed */
  --radius:   6px;
  --narrow:   760px;   /* single-column pages */
  --wide:     1080px;  /* the two-column profile */
  --banner-h: 140px;
  --nav-h:    46px;
  --gap:      12px;
  --font:     "Roboto", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #1b1c1f;
    --panel:    #232428;
    --panel-2:  #2a2c31;
    --border:   #34363b;
    --text:     #e4e5e7;
    --muted:    #9a9ea6;
    --danger:   #ff8a80;
    --verified: #3fbf7f;
    --yours:        #cca247;
    --yours-accent: #cca247;
    --yours-bg:     #3a2f1a;
    --endorsed:     #a98bff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
}

a { color: inherit; text-decoration-color: var(--muted); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }

/* Banner and nav pinned together, at the width of the wide column */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 8px 16px 0;
  background: var(--bg);
}

nav {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--nav-h);
  padding: 0 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
nav a { text-decoration: none; }
nav > a:first-child { font-weight: 600; }
nav form { margin: 0 0 0 auto; }

/* Page column */
main {
  max-width: var(--narrow);
  margin: 24px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
main.wide { max-width: var(--wide); }

/* Panels: thin border, subtle rounding */
main > header,
main > details,
main > section,
main > form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

h1 { font-size: 22px; font-weight: 500; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 500; margin: 0 0 8px; }
h3 { font-size: 15px; font-weight: 500; margin: 0 0 2px; }
p  { margin: 4px 0; }

/* Drawers */
details > summary {
  cursor: pointer;
  font-weight: 500;
}
details[open] > summary { margin-bottom: 10px; }

/* Entries inside a drawer, separated by hairlines */
article { padding: 10px 0; }
article + article { border-top: 1px solid var(--border); }

/* Forms */
input, textarea, select {
  font: inherit;
  color: inherit;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
  width: 100%;
  max-width: 480px;
}
input[type="radio"], input[type="checkbox"] { width: auto; }
fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
}
form p { margin: 10px 0; }

button {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
}
button:hover { border-color: var(--muted); }

:focus-visible { outline: 2px solid var(--verified); outline-offset: 1px; }

[role="alert"] { color: var(--danger); }

/* Any panel, where structure alone doesn't make one */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

/* Profile: banner, then main column (2/3) and side column (1/3) */
.banner {
  height: var(--banner-h);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(120deg, var(--panel-2), var(--border));
}
.banner + nav { border-radius: 0 0 var(--radius) var(--radius); }

.profile-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-areas: "main side";
  gap: var(--gap);
  align-items: start;
}
.profile-main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
}
.profile-side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  position: sticky;
  top: calc(8px + var(--banner-h) + var(--nav-h) + var(--gap));
}

@media (max-width: 720px) {
  :root { --banner-h: 48px; }
  .profile-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "side" "main";
  }
  .profile-side { position: static; }
}

.bio { white-space: pre-line; }
.dot { color: var(--endorsed); }
a { overflow-wrap: anywhere; }

/* Amber: your own controls, and what's waiting for your answer.
   On someone else's page none of it appears. */
.yours, .yours a { color: var(--yours); }
.yours button {
  color: var(--yours);
  border-color: var(--yours-accent);
  background: transparent;
}
.pending {
  background: var(--yours-bg);
  border-left: 3px solid var(--yours-accent);
  border-radius: 4px;
  padding: 8px 10px;
  margin: 6px 0;
}

/* Teal: verified fact, and nothing else */
.verified { color: var(--verified); }
.panel > h2 a, .profile-side h1 a { text-decoration: none; }

/* Jumping to #portfolio lands below the pinned banner and nav, not under them */
.profile-main > details {
  scroll-margin-top: calc(8px + var(--banner-h) + var(--nav-h) + var(--gap));
}