/* Four solid tiles, rounded outer ends, thin white gutters: a timetable made of blocks. */
:root {
  --red: #ec3b3a;
  --amber: #ffab14;
  --green: #06b971;
  --blue: #1d7cff;
  --blue-deep: #0a5fd8;
  --green-deep: #04764a;
  --ink: #16181d;
  --soft: #585c66;
  --paper: #fbfbfc;
  --card: #fff;
  --line: #e4e6ec;
  --gutter: 6px;
  --spring: cubic-bezier(.2, .9, .25, 1.15);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font: 400 1rem/1.55 "Google Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

/* Ruled timetable paper, with a little colour bleeding in from the corners. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(38rem 28rem at -5% -5%, rgb(236 59 58 / .09), transparent 70%),
    radial-gradient(34rem 28rem at 105% 5%, rgb(255 171 20 / .13), transparent 70%),
    radial-gradient(36rem 30rem at -5% 105%, rgb(6 185 113 / .11), transparent 70%),
    radial-gradient(40rem 32rem at 105% 100%, rgb(29 124 255 / .11), transparent 70%),
    repeating-linear-gradient(to bottom, transparent 0 47px, rgb(22 24 29 / .045) 47px 48px),
    repeating-linear-gradient(to right, transparent 0 159px, rgb(22 24 29 / .035) 159px 160px);
}

.page {
  display: grid;
  grid-template-columns: minmax(0, 52rem);
  justify-content: center;
  align-content: center;
  gap: 1.5rem;
  min-height: 100vh;
  padding: 1.5rem 1rem 2.5rem;
}

/* ---------- Hero ---------- */
.hero { text-align: center; }

.logo { display: block; width: auto; height: 6rem; margin: 0 auto; }

h1 { margin: 0; }

/* ---------- Card and screens ---------- */
.card {
  align-self: start;
  padding: 1.5rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 1.75rem;
  background: var(--card);
  box-shadow: 0 2rem 4rem -2.5rem rgb(22 24 29 / .35);
}
.screen { animation: slide .45s var(--ease) both; }

h2 { margin: 0 0 .35rem; font-size: 1.75rem; letter-spacing: -.025em; }
h2:focus { outline: none; }
h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
p { margin: .5rem 0; }
.fine { font-size: .85rem; color: var(--soft); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.notice {
  margin: .9rem 0;
  padding: .75rem .9rem;
  border-radius: 4px 1rem 1rem 4px;
  border-left: .4rem solid var(--amber);
  background: #fff6e3;
  font-size: .85rem;
}

/* ---------- Buttons and fields ---------- */
button, .button {
  display: inline-block;
  margin-top: .5rem;
  padding: .8rem 1.5rem;
  border: 2px solid var(--blue-deep);
  border-radius: 999px;
  background: var(--blue-deep);
  color: #fff;
  font: 600 1rem/1.2 "Google Sans", sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: translate .2s var(--spring), box-shadow .2s, background-color .2s;
}
/* button:hover, .button:hover { translate: 0 -2px; box-shadow: 0 .6rem 1.2rem -.5rem rgb(10 95 216 / .6); } */
button:active, .button:active { translate: 0 1px; box-shadow: none; }
button:focus-visible, .button:focus-visible, input:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
button.quiet { background: transparent; color: var(--blue-deep); border: none; box-shadow: none; }
button.quiet:hover { text-decoration: underline; }
button.wide { width: 100%; margin-top: 0; }
button.back { margin: 0 0 .75rem; padding: .35rem .8rem; border-color: var(--line); background: transparent; color: var(--soft); font-size: .85rem; }
button.back:hover { color: var(--ink); box-shadow: none; }
button:disabled { border-color: #6b6f79; background: #6b6f79; box-shadow: none; translate: none; cursor: default; }

input {
  width: 100%;
  margin-top: .3rem;
  padding: .75rem .9rem;
  border: 1px solid #8a8e99;
  border-radius: .75rem;
  background: #fff;
  color: var(--ink);
  font: 500 1rem/1.4 "Google Sans", sans-serif;
}
input:focus-visible { border-color: var(--ink); }

#login label { display: block; margin-top: .85rem; font-weight: 600; font-size: .92rem; }
#login button { width: 100%; margin-top: 1.25rem; }
/* While Bromcom is being read, stripes travel along the button */
#login button:disabled {
  border-color: #3d4350;
  background: repeating-linear-gradient(115deg, #3d4350 0 14px, #545b6a 14px 28px) 0 0 / 200% 100%;
  cursor: progress;
  animation: travel 2.5s linear infinite;
}

.or { display: flex; align-items: center; gap: .75rem; margin: .9rem 0; color: var(--soft); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

[role=status] { font-weight: 600; animation: rise .4s var(--ease) both; }
[role=status]:empty { display: none; }
#login-status { text-align: center; }

/* ---------- Paste ---------- */
/* Keys that press themselves, in order */
.keys { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: .9rem 0; }
.combo { display: flex; gap: .35rem; }
.then { color: var(--soft); font-style: italic; }
kbd {
  min-width: 2.75rem;
  padding: .5rem .7rem;
  border: 1px solid #cdd0d9;
  border-radius: .6rem;
  background: linear-gradient(#fff, #f2f3f6);
  box-shadow: 0 4px 0 #cdd0d9;
  font: 600 .95rem/1.2 "Google Sans Code", monospace;
  text-align: center;
  animation: press 3.6s infinite;
}
.second kbd { animation-delay: .9s; }

textarea {
  display: block;
  width: 100%;
  min-height: 8rem;
  padding: 3rem 1rem 1rem;
  border: 2px dashed #9cc4ff;
  border-radius: 2.5rem 1rem 1rem 2.5rem;
  background: #f1f7ff;
  color: var(--ink);
  font: 500 1.05rem/1.4 "Google Sans", sans-serif;
  text-align: center;
  resize: none;
  cursor: text;
  transition: border-color .25s, background-color .25s, border-radius .4s var(--ease);
}
textarea::placeholder { color: var(--blue-deep); opacity: 1; }
textarea:hover { border-color: var(--blue); }
textarea:focus-visible { outline: 0; border: 2px solid var(--blue); border-radius: 1rem 2.5rem 2.5rem 1rem; background: #e8f2ff; }
.drop.bad textarea { border-color: var(--red); background: #fff1f1; animation: shake .4s; }
.drop.bad + [role=status] { color: #b81f1e; }

/* ---------- Add ---------- */
.found { color: var(--green-deep); font-weight: 600; }
.choices { display: grid; gap: var(--gutter); margin: .75rem 0; }
.choice { padding: 1rem 1.1rem 1.2rem; border-radius: 4px; background: #f4f5f8; animation: rise .55s var(--ease) both; }
.choice:first-child { border-radius: 1.25rem 1.25rem 4px 4px; }
.choice:last-child { border-radius: 4px 4px 1.25rem 1.25rem; animation-delay: .12s; }
.choice p { font-size: .92rem; }
#link-result label { display: block; margin-top: 1rem; font-size: .9rem; }
#link-url { font: .8rem/1.4 "Google Sans Code", monospace; }

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .75rem;
}

.nav-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: .85rem;
  color: var(--ink);
  text-decoration: none;
  background: #e7e7e7;
  padding: .75rem 1rem;
  border-radius: 3.25rem;
}

.quick-tools {
  position: relative;
}

.quick-tools summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.quick-tools summary::-webkit-details-marker {
  display: none;
}

.quick-tools summary::after {
  content: "";
  width: .45rem;
  height: .45rem;
  margin-left: .15rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s ease;
}

.quick-tools[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.quick-tools-menu {
  position: absolute;
  top: calc(100% + .4rem);
  left: 50%;
  z-index: 10;
  display: grid;
  min-width: 9rem;
  padding: .35rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  box-shadow: 0 .75rem 2rem -.75rem rgb(22 24 29 / .35);
  transform: translateX(-50%);
}

.quick-tools-menu a {
  padding: .65rem .8rem;
  border-radius: .65rem;
  color: var(--ink);
  font-size: .85rem;
  text-decoration: none;
}

.quick-tools-menu a:hover,
.quick-tools-menu a:focus-visible {
  background: #f1f7ff;
  color: var(--blue-deep);
  outline: none;
}

.link-1 { color: #006aff1f; }
.link-2 { color: #ff00001f; }
.link-3 { color: #00ff001f; }


/* ---------- Wider screens: the fields sit side by side ---------- */
@media (min-width: 40rem) {
  .page { padding-block: 2rem; }
  .logo { height: 9rem; }
  .card { padding: 2rem 2.5rem; }
  #login { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }
  #login button { grid-column: 1 / -1; }
  .choices { grid-template-columns: 1fr 1fr; }
  .choice:first-child { border-radius: 1.25rem 4px 4px 1.25rem; }
  .choice:last-child { border-radius: 4px 1.25rem 1.25rem 4px; }
}

@media (max-width: 26rem) {
  .card { padding-inline: 1rem; }
  .keys { gap: .4rem; }
  .combo { gap: .2rem; }
  kbd { min-width: 2rem; padding-inline: .4rem; }
}

/* ---------- Motion ---------- */
.rise { animation: rise .8s var(--ease) both; animation-delay: calc(var(--i) * 90ms); }
@keyframes rise { from { opacity: 0; transform: translateY(1.25rem); } }
@keyframes slide { from { opacity: 0; transform: translateX(.9rem); } }
@keyframes travel { to { background-position: 130px 0; } }
@keyframes shake { 25% { transform: translateX(-.5rem); } 75% { transform: translateX(.5rem); } }
@keyframes press {
  0%, 8%, 22%, 100% { transform: none; box-shadow: 0 4px 0 #cdd0d9; }
  13%, 17% { transform: translateY(4px); box-shadow: 0 0 0 #cdd0d9; background: #e6f0ff; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
