/* \tug site — Light Apple. No Bootstrap. */

:root {
  --navy: #0a0e17;
  --blue: #2f6bff;
  --blue-press: #1f58e8;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --fill: #f5f5f7;
  --card: rgba(255, 255, 255, 0.82);
  --line: rgba(0, 0, 0, 0.08);
  --track: rgba(118, 118, 128, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius: 18px;
  --nav-h: 52px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  color: var(--text);
  background: var(--fill);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 3px solid rgba(47, 107, 255, 0.45);
  outline-offset: 2px;
}

#page-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

#api-docs,
#lookup,
#generator {
  scroll-margin-top: var(--nav-h);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 4000;
  background: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--nav-h);
  padding: 0 1.25rem;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--navy);
  text-decoration: none;
}

.nav-brand:hover {
  text-decoration: none;
}

.wordmark {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.25;
  color: var(--navy);
}

.wm-slash {
  color: var(--blue);
  font-weight: 650;
}

.nav-product {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.15rem;
}

.nav-links a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-links a:hover {
  color: var(--blue);
  text-decoration: none;
}

.nav-sep {
  color: var(--muted);
  font-weight: 400;
  user-select: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.nav-sister {
  letter-spacing: -0.03em;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - var(--nav-h));
  padding: 3.25rem 1.25rem 4rem;
  background: #f5f5f7;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("../assets/img/bg-masthead.jpg") center 30% / cover no-repeat;
  filter: grayscale(0.35) saturate(0.7);
  opacity: 0.11;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  margin: 0 auto;
}

.kicker {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}

.hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.08;
  color: var(--navy);
}

.lede {
  margin: 0 0 1.75rem;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 28rem;
}

.seg {
  display: flex;
  width: 100%;
  padding: 3px;
  margin: 0 0 0.9rem;
  background: var(--track);
  border-radius: 10px;
}

.seg button,
.seg-item {
  flex: 1;
  margin: 0;
  border: 0;
  border-radius: 8px;
  min-height: 36px;
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.seg button.active,
.seg-item:has(input:checked) {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.seg-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.card {
  background: var(--card);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.3rem;
}

#resultBox {
  margin: 0 0 1rem;
  padding: 1rem 1.05rem;
  min-height: 5.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--navy);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.15rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1.25rem;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary,
.btn.btn-primary {
  background: var(--blue);
  color: #fff !important;
}

.btn-primary:hover {
  background: var(--blue-press);
  text-decoration: none;
}

.btn-quiet {
  background: transparent;
  color: var(--blue);
  border: 1px solid rgba(47, 107, 255, 0.35);
}

.btn-quiet:hover {
  background: rgba(47, 107, 255, 0.08);
  text-decoration: none;
}

.tab-options {
  min-height: 12.5rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.tab-intro {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  margin-bottom: 0.9rem;
  align-items: end;
}

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

input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

input[type="number"],
select {
  width: 100%;
  max-width: 12rem;
  min-height: 40px;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

#countInput,
#wordCountInput {
  width: 5rem;
  max-width: 5rem;
}

output {
  display: inline-block;
  min-width: 2rem;
  margin-left: 0.4rem;
  font-family: var(--mono);
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  font-size: 0.92rem;
}

.checks label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  min-height: 32px;
}

.hint {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.hero-cta {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

.docs {
  padding: 4.5rem 1.25rem 5rem;
  background: var(--fill);
}

.docs-inner {
  max-width: 38rem;
  margin: 0 auto;
}

.docs h2 {
  margin: 0 0 0.65rem;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--navy);
}

.docs p {
  color: var(--muted);
}

.docs pre {
  margin: 1rem 0 1.25rem;
  padding: 1.05rem 1.15rem;
  background: var(--navy);
  color: #f5f5f7;
  border-radius: 14px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.5;
}

.docs ul {
  margin: 0.4rem 0 1.1rem;
  padding-left: 1.15rem;
  color: var(--text);
}

.docs code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--blue);
}

.docs pre code {
  color: inherit;
}

.site-footer {
  padding: 2.5rem 1.25rem 3rem;
  background: var(--navy);
  color: #a1a1a6;
  font-size: 0.85rem;
  text-align: center;
}

.site-footer a {
  color: #d2d2d7;
}

.site-footer p {
  margin: 0.35rem 0 0;
}

.policy-hero {
  min-height: auto;
  padding: 3rem 1.25rem 2.5rem;
}

.policy {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  color: var(--text);
}

.policy h2 {
  margin-top: 2rem;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.policy h3 {
  margin-top: 1.2rem;
  font-size: 1.1rem;
}

.policy-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.25rem;
}

.policy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
}

.policy-table th,
.policy-table td {
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.policy-table th {
  background: var(--navy);
  color: #f5f5f7;
  font-weight: 600;
}

.text-muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

@media (max-width: 640px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.65rem 1rem;
  }
  .grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .tab-options {
    min-height: 15rem;
  }
}
