@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/bricolage-grotesque-latin-v9.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6faf4;
  --surface: #fff;
  --ink: #15352b;
  --secondary-ink: #415d51;
  --field: #fcfdfa;
  --line: #cbd9ce;
  --wash: #e9f1e8;
  --poster: #15382d;
  --poster-accent: #457a60;
  --citrus: #dcf77a;
  --danger: #a32936;
  --display: "Bricolage Grotesque", Inter, system-ui, sans-serif;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

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

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

:where(button, input, select, a):focus-visible {
  outline: 3px solid #23724f;
  outline-offset: 3px;
}

.shell {
  width: min(100% - 5rem, 72rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 3;
  top: .75rem;
  left: .75rem;
  transform: translateY(calc(-100% - 1rem));
  padding: .65rem;
  background: var(--surface);
}

.skip-link:focus { transform: none; }
.topbar { border-bottom: 1px solid var(--line); }

.topbar-inner {
  min-height: 4.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .63rem;
  font: 800 2rem/1 var(--display);
  letter-spacing: -.09em;
  text-decoration: none;
}

.brand img { display: block; }

.account-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .45rem;
}

.account-email {
  min-width: 0;
  margin-right: .4rem;
  overflow: hidden;
  color: var(--secondary-ink);
  font-size: .9rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2.6rem, 6.1vw, 6rem);
  padding-block: clamp(4.15rem, 8.4vw, 8rem);
}

h1, h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -.055em;
}

h1 {
  font-size: clamp(4.15rem, 7.6vw, 7.1rem);
  line-height: .89;
}

h2 {
  font-size: clamp(1.8rem, 3.8vw, 2.8rem);
  line-height: 1;
}

.intro {
  max-width: 24rem;
  margin: 1.45rem 0 2rem;
  color: var(--secondary-ink);
  font-size: clamp(1.07rem, 1.65vw, 1.22rem);
  line-height: 1.55;
}

.intro strong { color: var(--ink); font-weight: 700; }

.account-notice {
  margin: .85rem 0 0;
  color: var(--secondary-ink);
  font-size: .875rem;
  line-height: 1.5;
}

.tool {
  padding: 1.05rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--surface);
  box-shadow: 0 4px 0 #e1ebe0;
}

.sign-in-panel { padding: .3rem; }

.sign-in-panel h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  line-height: 1.08;
}

.sign-in-panel > p:not(.form-error) {
  margin: .55rem 0 .85rem;
  color: var(--secondary-ink);
  line-height: 1.5;
}

.sign-in-panel > .secondary { margin-top: .6rem; }

.google-button {
  display: flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: .3rem;
  background: transparent;
  cursor: pointer;
}

.google-button img { display: block; max-width: 100%; height: auto; }
.google-button:hover:not(:disabled) { filter: brightness(.96); }
.google-button:disabled { opacity: .62; cursor: not-allowed; }
.sign-in-panel[aria-busy="true"] .google-button { cursor: wait; }

#shorten-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .8rem;
}

#shorten-form > .primary { justify-self: start; }

label, .result-label {
  display: block;
  margin: 0 0 .46rem;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 650;
}

.optional {
  margin-left: .3rem;
  color: var(--secondary-ink);
  font-weight: 400;
}

input, select {
  width: 100%;
  min-width: 0;
  min-height: 3.16rem;
  padding: .72rem .85rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--field);
  color: var(--ink);
}

input::placeholder { color: #61766a; opacity: 1; }
input[aria-invalid="true"] { border-color: var(--danger); }

.alias-input { position: relative; }
.alias-input > span {
  position: absolute;
  top: 50%;
  left: .86rem;
  transform: translateY(-50%);
  color: var(--secondary-ink);
  pointer-events: none;
}
.alias-input input { padding-left: 6.35rem; }

.button, .library-actions .text-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .65rem .95rem;
  border: 1px solid transparent;
  border-radius: .64rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 670;
  line-height: 1.16;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

:is(.button, .library-actions .text-button):disabled { opacity: .57; cursor: wait; }
.primary { min-height: 3.16rem; background: var(--ink); color: var(--surface); }
.primary:hover:not(:disabled) { background: #235441; }
.secondary { border-color: var(--line); background: var(--surface); }
.secondary:hover:not(:disabled), .text-button:hover:not(:disabled) { background: var(--wash); }
.accent { background: var(--citrus); }
.accent:hover:not(:disabled) { background: #cce75d; }
.danger { background: var(--danger); color: white; }
.danger:hover:not(:disabled) { background: #8d2530; }

.form-error, .field-hint {
  margin: .45rem 0 0;
  font-size: .875rem;
  line-height: 1.45;
}

.form-error { color: var(--danger); }
.field-hint { color: var(--secondary-ink); }

.result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: .9rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--paper);
}

.result-link { min-width: 0; }
.result-label { margin-bottom: .25rem; color: var(--secondary-ink); }
.result a { font-weight: 700; overflow-wrap: anywhere; }

.result-actions {
  display: flex;
  gap: .4rem;
}
.result-actions .button { min-width: 4.5rem; }

.example {
  isolation: isolate;
  position: relative;
  container-type: inline-size;
  aspect-ratio: 1.13;
  margin: 0;
  overflow: hidden;
  border: 1px solid #123226;
  border-radius: 1.75rem;
  background: var(--poster);
  color: var(--paper);
}

.example-grid {
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image: radial-gradient(circle, #8fc399 1px, transparent 1.15px);
  background-size: 18px 18px;
  background-position: center;
  mask-image: radial-gradient(ellipse at 58% 48%, black 8%, transparent 78%);
  opacity: .45;
}

.brand-chain {
  position: absolute;
  z-index: -1;
  top: 27%;
  left: 7%;
  width: 82%;
  height: 43%;
  transform: rotate(-34deg);
}

.brand-chain::after {
  content: "";
  position: absolute;
  top: 44%;
  left: 39%;
  z-index: 1;
  width: 21%;
  height: 12%;
  border-radius: 1rem;
  background: #9ec583;
}

.brand-chain i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 59%;
  border: 3.4cqw solid var(--poster-accent);
  border-radius: 45% / 50%;
}

.brand-chain i + i {
  right: 0;
  left: auto;
  border-color: #9ec583;
}

.example-long, .example-short {
  position: absolute;
  display: flex;
  align-items: center;
  max-width: 88%;
  padding: 4.2cqw 5.5cqw;
  border: 1px solid;
  border-radius: 2.8cqw;
  line-height: 1;
  white-space: nowrap;
}

.example-long {
  top: 24%;
  left: 8%;
  transform: rotate(-7deg);
  border-color: #97b2a0;
  background: #f7faf1;
  box-shadow: 0 6px 0 #142d23;
  color: var(--ink);
  font-size: 3.25cqw;
  font-weight: 560;
}

.example-short {
  right: 9%;
  bottom: 22%;
  transform: rotate(7deg);
  border-color: #263a13;
  background: var(--citrus);
  box-shadow: 0 6px 0 #101e13;
  color: var(--ink);
  font: 760 7.9cqw/1 var(--display);
  letter-spacing: -.06em;
}

.example-short b { color: #3d6229; font-weight: inherit; }

.example figcaption {
  position: absolute;
  right: 1.15rem;
  bottom: 1rem;
  color: #d7e8d7;
  font-size: .85rem;
}

.library {
  margin-bottom: clamp(3rem, 6vw, 5rem);
  padding-top: clamp(1.65rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
}

.library-heading, .library-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-description {
  margin: .6rem 0 0;
  color: var(--secondary-ink);
  line-height: 1.5;
}

.library-message { margin: .9rem 0 0; color: var(--secondary-ink); }
.library-message:empty { display: none; }

.library-list {
  display: grid;
  gap: .65rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.library-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(.75rem, 3vw, 1.8rem);
  padding: 1.05rem;
  border: 1px solid var(--line);
  border-radius: .82rem;
  background: var(--surface);
}

.library-item-main { min-width: 0; }
.library-short { font-weight: 750; overflow-wrap: anywhere; }
.library-destination {
  margin-top: .22rem;
  color: var(--secondary-ink);
  font-size: .92rem;
  overflow-wrap: anywhere;
}

.library-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  margin-top: .45rem;
  color: var(--secondary-ink);
  font-size: .875rem;
  line-height: 1.4;
}

.library-actions { display: flex; flex-wrap: wrap; gap: .3rem; }
.library-actions :is(.button, .text-button) {
  padding-inline: .7rem;
  border-color: var(--line);
  background: var(--paper);
}

.library-actions :is(.button, .text-button):hover { background: var(--wash); }
.library-actions .delete-link-action { color: var(--danger); }
.library-footer .field-hint { margin: 0; }

.footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  color: var(--secondary-ink);
  font-size: .875rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .7rem 1rem;
  padding-block: 1.15rem;
}

.footer-credits { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.footer nav { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1.1rem; }
.footer a { padding-block: .2rem; text-underline-offset: .24em; }
.footer a:hover { color: var(--ink); }

dialog {
  width: min(100% - 2rem, 30rem);
  max-height: calc(100% - 2rem);
  overflow: auto;
  padding: clamp(1.18rem, 4vw, 1.7rem);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--surface);
  box-shadow: 0 1rem 3rem rgb(19 53 40 / .22);
  color: var(--ink);
}

dialog::backdrop { background: rgb(14 37 29 / .58); }

.dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: .6rem;
}
.dialog-heading h2 { font-size: clamp(1.75rem, 6vw, 2.25rem); }

.close-button {
  min-width: 2.75rem;
  padding: .3rem;
  margin-top: -.35rem;
  margin-right: -.35rem;
  font-size: 1.55rem;
  line-height: 1;
}

.dialog-description {
  margin: .8rem 0 1rem;
  color: var(--secondary-ink);
  line-height: 1.5;
}

#remove-link-address { overflow-wrap: anywhere; }

dialog form > .primary { width: 100%; margin-top: .9rem; }

.dialog-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .8rem;
}

.missing, .policy, .report { padding-block: clamp(3.25rem, 9vw, 7.2rem); }
.missing h1, .policy h1, .report h1 { font-size: clamp(3.15rem, 9vw, 6.4rem); }

.report-form {
  display: grid;
  gap: .9rem;
  width: min(100%, 30rem);
}

.report-form > .primary { justify-self: start; }
.report-status { margin: 0; color: var(--ink); font-weight: 650; }
.report-status:empty { position: absolute; }

.policy section {
  max-width: 43rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.policy h2 { font-size: clamp(1.65rem, 3vw, 2.25rem); }
.policy p { color: var(--secondary-ink); font-size: 1.04rem; line-height: 1.65; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 58rem) {
  .shell { width: calc(100% - 3rem); }
  .hero { gap: 2rem; }
}

@media (max-width: 48rem) {
  .shell { width: min(100% - 3rem, 42rem); }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 2.4rem; }
  h1 { font-size: clamp(4.3rem, 12vw, 6.7rem); }
  .example { max-width: 35rem; }
}

@media (max-width: 36rem) {
  .library-item { align-items: flex-start; flex-direction: column; }
  .library-heading { align-items: flex-start; }
  .library-footer { align-items: flex-start; }
}

@media (max-width: 31rem) {
  .shell { width: calc(100% - 2rem); }
  .topbar-inner { min-height: 4.3rem; gap: .55rem; }
  .brand { font-size: 1.8rem; gap: .45rem; }
  .brand img { width: 34px; height: 34px; }
  .account-nav .button { padding-inline: .62rem; }
  .topbar-inner:has(.account-nav:not([hidden])) { flex-wrap: wrap; padding-block: .65rem; }
  .account-nav { width: 100%; gap: .15rem; }
  .account-email { flex: 1; }
  .hero { padding-block: 3.25rem; }
  h1 { font-size: clamp(3rem, 13.2vw, 4.65rem); }
  .intro { margin-block: 1.15rem 1.35rem; }
  .tool { padding: .85rem; }
  #shorten-form > .primary { justify-self: stretch; }
  .report-form > .primary { justify-self: stretch; }
  .dialog-actions > .button { white-space: normal; }
  .example { border-radius: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
