/* Clicksaur's website. One screen, no scrolling on a computer: the left side stays put and the right side is where
 * things unfold, and where the menu answers.
 *
 * Every colour and font comes from the add-on's theme (shared/themes.js), painted onto <html> by site.js. The values
 * below are College's, so the first frame already looks right before the scripts arrive. */

:root {
  --paper: #fbf9f4;
  --paper-2: #f3efe6;
  --ink: #1d2131;
  --ink-2: #545a68;
  --ink-3: #6e7178;
  --hover: rgba(30, 42, 80, 0.065);
  --accent: #1f2d52;
  --accent-ink: #fbf9f4;
  --accent-2: #8e1f2f;
  --head-color: #8e1f2f;
  --card: #fffdf8;
  --desk: #efeae0;
  --sw-lemon: #cfa448;
  --sw-rose: #e06972;
  --sw-sky: #6791cc;
  --mark-lemon: rgba(251, 199, 22, 0.39);
  --note-lemon: #f5ebd5;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-label: var(--font-head);
  --font-note: var(--font-head);
  --note-style: italic;
  --rule: color-mix(in srgb, var(--ink) 30%, transparent);
  --bar: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --paper: #1d1a16;
    --paper-2: #26221d;
    --ink: #efe7d5;
    --ink-2: #b9ae97;
    --ink-3: #908674;
    --hover: rgba(200, 168, 106, 0.13);
    --accent: #c8a86a;
    --accent-ink: #1d1a16;
    --head-color: #c8a86a;
    --card: #221e19;
    --desk: #14120f;
    color-scheme: dark;
  }
}

:root[data-mode="dark"] {
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

button {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

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

/* ── The frame ────────────────────────────────────────────────────────────── */

.frame {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.left {
  display: grid;
  grid-template-rows: var(--bar) 1fr 44px auto;
  min-height: 0;
  border-right: 1px solid var(--rule);
}

.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--rule);
}

.cell:last-child {
  border-right: 0;
}

.bar {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  border-bottom: 1px solid var(--rule);
}

.brand {
  justify-content: flex-start;
  gap: 10px;
  padding: 0 20px;
  color: var(--ink);
  font: 600 18px var(--font-head);
  text-decoration: none;
}

.link {
  font-size: 14px;
  color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}

.link:hover,
.link[aria-expanded="true"] {
  background: var(--hover);
  color: var(--ink);
}

/* ── The headline ─────────────────────────────────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 0 clamp(24px, 6%, 80px);
}

h1 {
  margin: 0 0 clamp(14px, 3vh, 28px);
  font: 500 min(4.7vw, 9vh) / 1.02 var(--font-head);
  letter-spacing: -0.02em;
}

.lede {
  max-width: 46ch;
  margin: 0 0 clamp(16px, 3.5vh, 32px);
  color: var(--ink-2);
  font-size: clamp(14px, 1.9vh, 16.5px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.go {
  padding: 11px 18px;
  border-radius: var(--radius, 8px);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: transform 0.15s;
}

.go:hover {
  transform: translateX(2px);
}

.quiet {
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
}

.quiet:hover {
  text-decoration-color: currentColor;
}

/* The nine highlighter inks, as the logo's dots */
.inks {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4%;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.inks i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot);
}

.inks i:nth-child(even) {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  rotate: 45deg;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.fact {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  padding: clamp(14px, 2.6vh, 24px) 20px;
}

.fact strong {
  font: 600 17px var(--font-head);
}

.fact > span {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.4;
}

/* ── The right side ───────────────────────────────────────────────────────── */

.right {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.tiles {
  display: grid;
  height: 100%;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: var(--bar) 0.55fr 1fr 1fr 1fr;
  grid-template-areas:
    "c1 desk themes install"
    "c1 desk tape tape"
    "swipe l i cursor"
    "privacy note note c2"
    "k note note sites";
}

.tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  container-type: size;
}

/* The tiles in the last column and row draw no outer edge: the window is the edge. */
[style*="grid-area: install"],
[style*="grid-area: cursor"],
[style*="grid-area: c2"],
[style*="grid-area: sites"],
.tape {
  border-right: 0;
}

[style*="grid-area: k"],
[style*="grid-area: note"],
[style*="grid-area: sites"] {
  border-bottom: 0;
}

.letter {
  display: grid;
  place-items: center;
}

/* Sized by the tile, so the glyph fills it whatever the window */
.letter span {
  font: 400 min(118cqh, 140cqw) / 1 var(--font-head);
  translate: 0 -4%;
}

.letter span::selection {
  background: var(--mark-lemon);
}

.text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(12px, 2.2vh, 20px) 18px;
  color: var(--ink-2);
  font-size: clamp(12.5px, 1.7vh, 14px);
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}

.text i {
  align-self: flex-end;
  font-style: normal;
  font-size: 18px;
  transition: translate 0.15s;
}

.text:hover,
.text[aria-expanded="true"] {
  background: var(--hover);
  color: var(--ink);
}

.text:hover i {
  translate: 3px 0;
}

.top {
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.top:hover,
.top[aria-expanded="true"] {
  background: var(--hover);
}

.top.strong {
  background: var(--ink);
  color: var(--paper);
}

.top.strong:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Washi tape, out of the logo */
.tape {
  background: var(--paper-2);
}

.tape::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  top: 50%;
  height: 46%;
  translate: 0 -50%;
  rotate: -4deg;
  background: repeating-linear-gradient(115deg, transparent 0 14px, rgba(255, 255, 255, 0.35) 14px 20px), var(--sw-pink, #d7879c);
  opacity: 0.85;
}

/* A mildliner swipe, out of the logo */
.swipe {
  display: grid;
  place-items: center;
  padding: 10%;
  background: var(--paper-2);
}

.swipe p {
  margin: 0;
  font: var(--note-style, normal) 400 min(17cqh, 15cqw) / 1.15 var(--font-head);
  text-align: center;
}

.swiped {
  padding: 0 0.12em;
  border-radius: 0.25em 0.6em 0.35em 0.5em;
  background: var(--mark-lemon);
  box-decoration-break: clone;
}

/* The logo's fineliner cursor */
.cursor {
  display: grid;
  place-items: center;
  background: var(--sw-rose);
}

.cursor svg {
  max-height: 72%;
  rotate: -8deg;
}

/* The sticky note that asks you to right-click */
.pad {
  display: grid;
  place-items: center;
  padding: 8%;
  background: var(--sw-sky);
}

.note {
  position: relative;
  width: min(100%, 340px);
  padding: 30px 24px 22px;
  border-top: 3px solid var(--sw-lemon);
  border-radius: 3px;
  background: var(--note-lemon);
  box-shadow: 0 0 0 1px rgba(30, 30, 40, 0.08), 0 16px 30px -14px rgba(20, 20, 30, 0.5);
  color: #26241f;
  rotate: calc(-2deg * var(--note-tilt, 1));
}

[data-ornament="tape"] .note {
  border-top: 0;
}

[data-ornament="tape"] .note::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 92px;
  height: 22px;
  translate: -50% 0;
  rotate: 3deg;
  background: repeating-linear-gradient(115deg, transparent 0 9px, rgba(255, 255, 255, 0.4) 9px 13px), var(--sw-pink);
  opacity: 0.85;
}

[data-ornament="ribbon"] .note::after {
  content: "";
  position: absolute;
  top: -3px;
  right: 22px;
  width: 12px;
  height: 34px;
  background: var(--accent-2);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}

.note-big {
  margin: 0 0 8px;
  font: var(--note-style, normal) 500 clamp(22px, 3.4vh, 30px) / 1.1 var(--font-note);
}

.note-small {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(38, 36, 31, 0.8);
}

.note-go {
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(38, 36, 31, 0.35);
  text-underline-offset: 3px;
}

.note-go:hover {
  text-decoration-color: currentColor;
}

/* ── Panels: unfold over the right side ───────────────────────────────────── */

.panel {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.panel[hidden] {
  display: none;
}

.panel.unfold {
  animation: unfold 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes unfold {
  from {
    clip-path: var(--from);
  }
  to {
    clip-path: inset(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel.unfold {
    animation: none;
  }
}

.panel-head {
  display: flex;
  flex: none;
  height: var(--bar);
  border-bottom: 1px solid var(--rule);
}

.panel-head h2 {
  display: flex;
  align-items: center;
  flex: 1;
  margin: 0;
  padding: 0 28px;
  font: 500 22px var(--font-head);
}

.panel-x {
  width: var(--bar);
  border-left: 1px solid var(--rule);
  font-size: 26px;
  line-height: 1;
  text-align: center;
}

.panel-x:hover {
  background: var(--hover);
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: clamp(18px, 3vh, 32px) clamp(20px, 5%, 48px);
}

.panel-body > :first-child {
  margin-top: 0;
}

.intro {
  max-width: 56ch;
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 14px;
}

/* The page to try the menu on */
.sample {
  max-width: 62ch;
  font: 16px/1.6 var(--font-label);
}

.sample h3 {
  margin: 18px 0 10px;
  font: 500 clamp(22px, 3.4vh, 28px) / 1.2 var(--font-head);
}

.sample p {
  margin: 0 0 12px;
}

.sample a {
  color: var(--accent);
}

.hint {
  padding: 10px 14px;
  border: 1px dashed var(--rule);
  border-radius: var(--radius, 8px);
  color: var(--ink-2);
  font: 13.5px/1.45 var(--font-ui);
}

.sample-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 14px 0;
}

.sample-row img {
  flex: none;
  border-radius: 14px;
}

.sample pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: var(--radius-sm, 5px);
  background: var(--paper-2);
  font: 13px var(--font-mono, ui-monospace, monospace);
}

.sample .small {
  color: var(--ink-3);
  font: 12.5px/1.45 var(--font-ui);
}

/* The desk's tools */
.tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.tools li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 1px 12px;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--rule);
}

.tools .ico {
  grid-row: span 2;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--head-color);
}

.tools strong {
  font: 600 14.5px var(--font-head);
}

.tools span {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.35;
}

/* Sites it knows */
.site-names {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.site-names button {
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 13.5px;
}

.site-names button:hover {
  background: var(--hover);
}

.site-names button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.site-blurb {
  max-width: 56ch;
  margin: 0;
  padding-left: 14px;
  border-left: 3px solid var(--sw-lemon);
  font: 16px/1.55 var(--font-label);
}

/* Facts, as a definition list */
.facts-list {
  max-width: 60ch;
  margin: 0;
}

.facts-list dt {
  margin-top: 18px;
  color: var(--head-color);
  font: 600 12.5px var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts-list dt:first-child {
  margin-top: 0;
}

.facts-list dd {
  margin: 4px 0 0;
  font: 15.5px/1.55 var(--font-label);
}

/* Themes */
.themes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.theme {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius, 8px);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
}

.theme strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
}

.theme:hover {
  background: var(--hover);
}

.theme[aria-pressed="true"] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.theme-inks {
  display: flex;
  gap: 4px;
}

.theme-inks i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.modes {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 999px;
  overflow: hidden;
}

.modes button {
  padding: 7px 14px;
  font-size: 13.5px;
}

.modes button + button {
  border-left: 1px solid var(--rule);
}

.modes button[aria-checked="true"] {
  background: var(--ink);
  color: var(--paper);
}

.below,
.touch {
  display: none;
}

@media (hover: none) {
  .touch {
    display: inline;
  }
}

/* ── Phones and narrow windows: one column, and the page scrolls ─────────── */

@media (max-width: 860px), (max-height: 520px) {
  .frame {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .left {
    grid-template-rows: var(--bar) auto 40px auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .hero {
    padding: 48px 20px 40px;
  }

  h1 {
    font-size: clamp(36px, 11vw, 64px);
  }

  .right {
    height: min(150vw, 900px);
  }

  .beside {
    display: none;
  }

  .below {
    display: inline;
  }
}

@media (max-width: 560px) {
  :root {
    --bar: 52px;
  }

  .bar {
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
  }

  .brand {
    padding: 0 12px;
    font-size: 15px;
  }

  .brand img {
    width: 22px;
    height: 22px;
  }

  .link,
  .top {
    font-size: 12.5px;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .fact {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .fact:last-child {
    border-bottom: 0;
  }

  .text {
    padding: 10px;
    font-size: 11.5px;
  }

  .text i {
    font-size: 14px;
  }

  .tools,
  .themes {
    grid-template-columns: 1fr;
  }

  .note {
    padding: 22px 16px 16px;
  }

  .note-small {
    font-size: 12px;
  }
}

/* A page of reading (privacy.html): one column that scrolls, the bar on top */
.doc-bar {
  display: flex;
  height: var(--bar);
}

.doc-bar .brand {
  border-right: 0;
}

.doc-body {
  max-width: 72ch;
  margin: 0 auto;
  padding: 40px 16px 72px;
}

.doc-body h1 {
  margin: 0;
  color: var(--head-color);
  font: 600 clamp(34px, 7vw, 52px) / 1.1 var(--font-head);
}

.doc-body h2 {
  margin: 36px 0 8px;
  color: var(--head-color);
  font: 600 12.5px var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc-body p,
.doc-body li {
  font: 16px/1.6 var(--font-label);
}

.doc-body .lede {
  max-width: none;
  font-size: 18px;
}

.doc-date {
  color: var(--ink-3);
}

.doc-body a {
  color: var(--accent);
}

.doc-table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14.5px;
}

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

.doc-table th {
  color: var(--ink-2);
  font-weight: 600;
}
