/* src/styles.css */
:root {
  --bg: #000;
  --bg-soft: #0c0a08;
  --fg: #efe9da;
  --fg-soft: #b4ab93;
  --fg-mute: #6c6452;
  --rule: #2a261f;
  --rule-soft: #1a1813;
  --accent: #e8d8a8;
  --warn: #d28a6b;
}

* {
  box-sizing: border-box;
}

html, body, #root {
  background: var(--bg);
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--fg);
  font-feature-settings: "liga", "dlig", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-family: EB Garamond, Iowan Old Style, Georgia, serif;
  font-size: 19px;
  line-height: 1.55;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: none;
}

::-webkit-scrollbar-thumb {
  background: #1f1c17;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2e2a23;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--fg-mute);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--fg);
}

button {
  font-family: inherit;
}

.page {
  position: relative;
  min-height: 100vh;
  padding: clamp(20px, 2.6vw, 40px) clamp(22px, 5vw, 80px) clamp(60px, 6vw, 120px);
}

.top {
  display: flex;
  border-bottom: 1px solid var(--rule);
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 16px;
}

.brand {
  font-variation-settings: "opsz" 144;
  letter-spacing: -.01em;
  font-family: Fraunces, serif;
  font-size: 26px;
  font-style: italic;
  font-weight: 400;
}

.top-meta {
  display: flex;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-soft);
  align-items:  center;
  gap: 14px;
  font-family: Fraunces, serif;
  font-size: 12px;
}

.conn {
  background: var(--fg-mute);
  border-radius: 50%;
  width: 7px;
  height: 7px;
  transition: background .3s;
}

.conn.on {
  background: #9bbf86;
  box-shadow: 0 0 8px #9bbf86aa;
}

.conn.off {
  background: var(--warn);
}

.role {
  font-style: italic;
}

.role-switch {
  color: var(--fg-mute);
  cursor: pointer;
  letter-spacing: .18em;
  text-transform: uppercase;
  background: none;
  border: none;
  padding: 0;
  transition: color .3s;
  font-size: 11px;
  font-style: italic;
}

.role-switch:hover {
  color: var(--fg);
}

.picker {
  position: fixed;
  display: grid;
  background: var(--bg);
  place-items:  center;
  padding: 40px;
  inset: 0;
}

.picker-inner {
  text-align: center;
  width: 100%;
  max-width: 680px;
}

.picker-mark {
  font-variation-settings: "opsz" 144;
  letter-spacing: -.04em;
  margin: 0;
  font-family: Fraunces, serif;
  font-size: clamp(80px, 12vw, 160px);
  font-weight: 300;
  line-height: 1;
}

.picker-q {
  color: var(--fg-soft);
  letter-spacing: .04em;
  margin: 18px 0 clamp(40px, 6vw, 80px);
  font-size: clamp(20px, 2vw, 26px);
}

.picker-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 2vw, 28px);
}

@media (width <= 600px) {
  .picker-row {
    grid-template-columns: 1fr;
  }
}

.picker-btn {
  display: grid;
  border: 1px solid var(--rule);
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  background: none;
  gap: 8px;
  padding: clamp(28px, 4vw, 44px) clamp(22px, 3vw, 36px);
  transition: background .4s, border-color .4s, transform .4s;
}

.picker-btn:hover {
  background: var(--bg-soft);
  border-color: var(--fg-mute);
  transform: translateY(-2px);
}

.picker-label {
  letter-spacing: -.01em;
  font-family: Fraunces, serif;
  font-size: clamp(28px, 3.6vw, 44px);
  font-style: italic;
  font-weight: 400;
}

.picker-hint {
  color: var(--fg-soft);
  letter-spacing: .04em;
  font-size: 14px;
}

.teacher {
  max-width: 1500px;
  margin: 0 auto;
  padding-top: clamp(36px, 5vw, 70px);
}

.search {
  position: relative;
  display: flex;
  border-bottom: 1px solid var(--fg);
  align-items:  center;
  margin-bottom: clamp(40px, 5vw, 80px);
  padding: 12px 0 14px;
}

.search input {
  outline: none;
  color: var(--fg);
  background: none;
  border: none;
  flex: 1;
  padding: 4px 0;
  font-family: inherit;
  font-size: clamp(24px, 3.4vw, 44px);
}

.search input::placeholder {
  color: var(--fg-mute);
  font-style: italic;
}

.search-spin {
  border: 1.5px solid var(--fg-soft);
  animation: spin .8s linear infinite;
  border-top-color: #0000;
  border-radius: 50%;
  width: 14px;
  height: 14px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.note {
  color: var(--fg-soft);
  text-align: center;
  letter-spacing: .05em;
  padding: 48px 0;
  font-family: Fraunces, serif;
  font-style: italic;
}

.note.err {
  color: var(--warn);
}

.grid {
  columns: 3 320px;
  column-gap: clamp(20px, 2.8vw, 44px);
}

@media (width <= 700px) {
  .grid {
    columns: 1;
  }
}

.plate {
  break-inside: avoid;
  cursor: pointer;
  display: block;
  margin: 0 0 clamp(40px, 5vw, 72px);
}

.plate-frame {
  position: relative;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--rule-soft);
  transition: border-color .5s, transform .5s;
}

.plate-frame img {
  display: block;
  filter: brightness(.96);
  width: 100%;
  height: auto;
  transition: transform 1s cubic-bezier(.2,.7,.2,1), filter .6s;
}

.plate:hover .plate-frame {
  border-color: var(--fg-mute);
}

.plate:hover .plate-frame img {
  filter: brightness(1.05);
  transform: scale(1.04);
}

.plate-no {
  position: absolute;
  letter-spacing: .22em;
  color: var(--bg);
  background: var(--fg);
  opacity: 0;
  padding: 4px 10px;
  transition: opacity .4s, transform .4s;
  font-family: Fraunces, serif;
  font-size: 10px;
  font-style: italic;
  top: 10px;
  left: 10px;
  transform: translateY(-4px);
}

.plate:hover .plate-no {
  opacity: 1;
  transform: translateY(0);
}

.plate figcaption {
  display: grid;
  border-top: 1px solid var(--rule);
  gap: 4px;
  margin-top: 12px;
  padding-top: 12px;
  font-size: 14px;
}

.plate figcaption .src {
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--accent);
  font-family: Fraunces, serif;
  font-size: 10px;
  font-style: italic;
}

.plate figcaption .title {
  color: var(--fg);
  font-size: 16px;
  font-style: italic;
  line-height: 1.32;
}

.plate figcaption .dims {
  color: var(--fg-mute);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-family: Fraunces, serif;
  font-size: 11px;
}

.proj {
  position: fixed;
  z-index: 600;
  display: grid;
  cursor: zoom-out;
  background: #000;
  place-items:  center;
  padding: 0;
  inset: 0;
}

.proj-frame {
  position: relative;
  display: block;
  cursor: default;
  box-shadow: none;
  width: 100vw;
  height: 100vh;
}

.proj-base, .proj-hires {
  display: block;
  object-fit: contain;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
}

.proj-hires {
  position: absolute;
  transition: opacity .9s ease-out;
  inset: 0;
}

.proj-loading {
  position: absolute;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--fg-soft);
  background: #0009;
  padding: 6px 14px;
  font-family: Fraunces, serif;
  font-size: 11px;
  font-style: italic;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.proj-close {
  position: absolute;
  color: var(--fg-soft);
  letter-spacing: .22em;
  text-transform: uppercase;
  cursor: pointer;
  background: none;
  border: 1px solid #efe9da4d;
  padding: 8px 16px;
  transition: background .3s, color .3s, border-color .3s;
  font-family: Fraunces, serif;
  font-size: 11px;
  font-style: italic;
  top: clamp(16px, 3vw, 28px);
  right: clamp(16px, 3vw, 28px);
}

.proj-close:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.student {
  max-width: 1300px;
  margin: 0 auto;
  padding-top: clamp(30px, 4vw, 60px);
}

.waiting {
  display: grid;
  text-align: center;
  color: var(--fg-soft);
  place-items:  center;
  gap: 22px;
  padding: clamp(80px, 14vw, 180px) 0;
  font-size: clamp(18px, 2vw, 22px);
}

.dot-pulse {
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
  border-radius: 50%;
  width: 10px;
  height: 10px;
}

@keyframes pulse {
  0%, 100% {
    opacity: .3;
    transform: scale(.7);
  }

  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items:  start;
  gap: clamp(28px, 4vw, 64px);
}

@media (width <= 980px) {
  .card {
    grid-template-columns: 1fr;
  }
}

.card-img {
  position: sticky;
  border: 1px solid var(--rule);
  background: #0a0807;
  top: 24px;
}

@media (width <= 980px) {
  .card-img {
    position: static;
  }
}

.card-img img {
  display: block;
  object-fit: contain;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 80px);
}

.card-body {
  min-width: 0;
}

.head {
  display: flex;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--fg-mute);
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 18px;
  font-family: Fraunces, serif;
  font-size: 12px;
}

.head-label {
  color: var(--fg-mute);
}

.head-value {
  color: var(--fg-soft);
  text-transform: none;
  letter-spacing: .02em;
  font-style: italic;
}

.head-sep {
  color: var(--rule);
}

.raw-title {
  font-variation-settings: "opsz" 144;
  letter-spacing: -.015em;
  color: var(--fg);
  margin: 0 0 18px;
  font-family: Fraunces, serif;
  font-size: clamp(26px, 3.4vw, 44px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.12;
}

.searches {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: 6px 10px;
  margin: 0 0 20px;
  font-size: 12px;
}

.search-label {
  color: var(--accent);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-family: Fraunces, serif;
  font-style: italic;
}

.search-pill {
  display: inline-block;
  border: 1px solid var(--rule);
  color: var(--fg-soft);
  letter-spacing: .04em;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}

.markdown {
  font-size: 18px;
  line-height: 1.6;
}

.markdown.streaming {
  color: var(--fg);
}

.markdown h1, .markdown h2, .markdown h3 {
  letter-spacing: -.01em;
  color: var(--fg);
  margin: 28px 0 10px;
  font-family: Fraunces, serif;
  font-weight: 400;
  line-height: 1.15;
}

.markdown h1 {
  font-size: 28px;
}

.markdown h2 {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
  font-size: 22px;
}

.markdown h2:first-child {
  margin-top: 4px;
}

.markdown h3 {
  font-size: 18px;
  font-style: italic;
}

.markdown p {
  margin: 0 0 14px;
}

.markdown ul, .markdown ol {
  margin: 0 0 14px;
  padding-left: 1.4em;
}

.markdown li {
  margin-bottom: 6px;
}

.markdown li::marker {
  color: var(--fg-mute);
}

.markdown strong {
  color: var(--fg);
  font-weight: 600;
}

.markdown em {
  color: var(--fg-soft);
  font-style: italic;
}

.markdown code {
  background: var(--bg-soft);
  color: var(--accent);
  border-radius: 3px;
  padding: 1px 6px;
  font-family: Iosevka, ui-monospace, monospace;
  font-size: .92em;
}

.markdown blockquote {
  border-left: 2px solid var(--accent);
  color: var(--fg-soft);
  margin: 18px 0;
  padding: 4px 18px;
  font-style: italic;
}

.markdown a {
  color: var(--accent);
  text-decoration-color: var(--rule);
}

.markdown a:hover {
  text-decoration-color: var(--accent);
}

.markdown hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 24px 0;
}

.markdown table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  font-size: 15px;
}

.markdown th, .markdown td {
  text-align: left;
  border-bottom: 1px solid var(--rule);
  padding: 8px 12px;
}

.markdown th {
  color: var(--fg-soft);
  font-style: italic;
  font-weight: 600;
}

.cursor {
  display: inline-block;
  background: var(--fg);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
  width: 8px;
  height: 1em;
  margin-left: 2px;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.source-link {
  display: inline-block;
  color: var(--fg-soft);
  letter-spacing: .06em;
  margin-top: 28px;
  font-family: Fraunces, serif;
  font-size: 14px;
  font-style: italic;
}

.gpage {
  position: relative;
  color: #202124;
  -webkit-font-smoothing: antialiased;
  background: #fff;
  min-height: 100vh;
  padding: 0 0 80px;
  font-family: Roboto, arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.gpage ::selection {
  color: inherit;
  background: #b3d4fc;
}

.gtop {
  display: flex;
  justify-content: flex-end;
  align-items:  center;
  gap: 18px;
  height: 60px;
  padding: 0 22px;
}

.gtop-right {
  display: flex;
  align-items:  center;
  gap: 14px;
}

.gpage .glink {
  color: #5f6368;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
}

.gpage .glink:hover {
  color: #202124;
  text-decoration: underline;
}

.gpage .conn {
  background: #bdc1c6;
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

.gpage .conn.on {
  box-shadow: none;
  background: #34a853;
}

.gpage .conn.off {
  background: #ea4335;
}

.gcenter {
  display: flex;
  flex-direction: column;
  align-items:  center;
}

.gpage.home .gcenter {
  margin-top: clamp(90px, 18vh, 200px);
}

.gpage.results .gcenter {
  border-bottom: 1px solid #ebebeb;
  flex-direction: row;
  justify-content: flex-start;
  align-items:  center;
  gap: 26px;
  margin-top: -30px;
  padding: 4px 28px 18px;
}

.glogo {
  display: block;
  user-select: none;
  width: 272px;
  max-width: 78vw;
  height: auto;
  margin: 0 0 26px;
}

.glogo.small {
  width: auto;
  height: 30px;
  margin: 0;
}

.gsearch {
  display: flex;
  background: #fff;
  border: 1px solid #dfe1e5;
  border-radius: 24px;
  align-items:  center;
  gap: 12px;
  width: min(584px, 90vw);
  height: 46px;
  padding: 0 16px;
  transition: box-shadow .18s, border-color .18s;
}

.gsearch:hover, .gsearch:focus-within {
  border-color: #dfe1e500;
  box-shadow: 0 1px 6px #20212447;
}

.gpage.results .gsearch {
  flex: 0 640px;
  height: 44px;
}

.gsearch input {
  outline: none;
  color: #202124;
  background: none;
  border: none;
  flex: 1;
  min-width: 0;
  font-family: arial, sans-serif;
  font-size: 16px;
}

.gsearch input::placeholder {
  color: #9aa0a6;
  font-style: normal;
}

.gicon {
  display: block;
  flex: none;
}

.gmic {
  cursor: pointer;
}

.gpage .search-spin.gspin {
  border-color: #0000 #4285f4 #4285f4;
}

.gbtns {
  display: flex;
  gap: 11px;
  margin-top: 30px;
}

.gbtns button {
  color: #3c4043;
  cursor: pointer;
  background: #f8f9fa;
  border: 1px solid #f8f9fa;
  border-radius: 4px;
  height: 36px;
  padding: 0 16px;
  transition: border-color .15s, box-shadow .15s;
  font-size: 14px;
}

.gbtns button:hover {
  color: #202124;
  border-color: #dadce0;
  box-shadow: 0 1px 1px #0000001a;
}

.gresults {
  max-width: 1400px;
  padding: 18px 28px 0;
}

.gtabs {
  display: flex;
  color: #5f6368;
  border-bottom: 1px solid #ebebeb;
  gap: 26px;
  margin-bottom: 14px;
  font-size: 13px;
}

.gtab {
  cursor: default;
  padding: 8px 0 12px;
}

.gtab.active {
  color: #1a73e8;
  box-shadow: inset 0 -3px #1a73e8;
}

.gcount {
  color: #70757a;
  margin: 0 0 22px;
  font-size: 13px;
}

.gpage .note {
  color: #70757a;
  text-align: left;
  letter-spacing: 0;
  padding: 24px 0;
  font-family: arial, sans-serif;
  font-style: normal;
}

.gpage .note.err {
  color: #d93025;
}

.gpage .grid {
  columns: 4 240px;
  column-gap: 18px;
}

@media (width <= 700px) {
  .gpage .grid {
    columns: 2;
  }
}

.gpage .plate {
  margin: 0 0 22px;
}

.gpage .plate-frame {
  background: #f1f3f4;
  border: 1px solid #ebebeb;
  border-radius: 8px;
}

.gpage .plate-frame img {
  filter: none;
}

.gpage .plate:hover .plate-frame {
  border-color: #1a73e8;
}

.gpage .plate:hover .plate-frame img {
  filter: none;
}

.gpage .plate-no {
  letter-spacing: .04em;
  color: #fff;
  background: #1a73e8;
  border-radius: 4px;
  font-family: arial, sans-serif;
  font-style: normal;
}

.gpage .plate figcaption {
  border-top: none;
  gap: 2px;
  margin-top: 8px;
  padding-top: 8px;
}

.gpage .plate figcaption .src {
  text-transform: none;
  letter-spacing: 0;
  color: #202124;
  font-family: arial, sans-serif;
  font-size: 12px;
  font-style: normal;
}

.gpage .plate figcaption .title {
  color: #1a0dab;
  font-family: arial, sans-serif;
  font-size: 14px;
  font-style: normal;
  line-height: 1.3;
}

.gpage .plate:hover figcaption .title {
  text-decoration: underline;
}

.gpage .plate figcaption .dims {
  text-transform: none;
  letter-spacing: 0;
  color: #70757a;
  font-family: arial, sans-serif;
  font-size: 12px;
}

@media (width <= 600px) {
  .gpage.results .gcenter {
    flex-direction: column;
    align-items:  flex-start;
    gap: 14px;
    margin-top: 0;
  }

  .glogo {
    font-size: 64px;
  }
}
