:root {
  color-scheme: light;
  --bg: #fbfbfc;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #fff;
  --text: #102033;
  --muted: #687586;
  --line: #e3e6ea;
  --accent: #d94b18;
  --accent-soft: #fff0ea;
  --shadow: 0 18px 55px rgba(29, 36, 50, 0.08);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101114;
  --surface: rgba(29, 31, 36, 0.84);
  --surface-solid: #1d1f24;
  --text: #f4f7fa;
  --muted: #989da7;
  --line: #2d3037;
  --accent: #ff7442;
  --accent-soft: #43281f;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 12%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 64px;
}

.topbar { display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; }
.brand img { display: block; width: 38px; height: 38px; }
.brand span { display: flex; flex-direction: column; gap: 1px; }
.brand strong { font-size: 13px; font-weight: 820; letter-spacing: .035em; text-transform: uppercase; }
.brand small { color: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.clock { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.icon-button { display: grid; width: 40px; height: 40px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; }
.icon-button:hover { background: var(--surface-solid); border-color: color-mix(in srgb, var(--muted) 45%, transparent); }
.icon-button svg, .text-button svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }

.hero { width: min(760px, 100%); margin: clamp(72px, 11vh, 112px) auto 92px; text-align: center; }
.hero-mark { display: block; width: 82px; height: 82px; margin: 0 auto 22px; filter: drop-shadow(0 12px 22px rgba(16, 32, 51, .1)); }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 11px; font-weight: 760; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(30px, 4vw, 42px); font-weight: 680; letter-spacing: -.045em; line-height: 1.05; }
.intro { margin: 12px 0 30px; color: var(--muted); font-size: 15px; }

.search { display: flex; min-height: 66px; align-items: center; gap: 14px; padding: 8px 9px 8px 20px; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(18px); transition: border-color .2s, transform .2s, box-shadow .2s; }
.search:focus-within { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: 0 22px 70px color-mix(in srgb, var(--accent) 13%, transparent); }
.search > svg { width: 22px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-width: 1.8; }
.search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 17px; }
.search input::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.search kbd { padding: 3px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--bg); font-family: inherit; font-size: 12px; }
.search button { display: grid; width: 48px; height: 48px; flex: 0 0 auto; padding: 0; place-items: center; border: 0; border-radius: 15px; background: var(--text); color: var(--bg); cursor: pointer; }
.search button:hover { transform: scale(1.03); }
.search button svg { width: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.shortcuts { margin: 0 auto; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; }
.section-heading .eyebrow { margin-bottom: 7px; }
.section-heading h2, .dialog-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.text-button { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 650; }
.text-button:hover { background: var(--surface-solid); }
.shortcut-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.shortcut-card { position: relative; min-width: 0; }
.shortcut-link { display: flex; min-height: 96px; align-items: center; gap: 14px; overflow: hidden; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.shortcut-link:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: 0 15px 35px rgba(26, 31, 44, .07); }
.shortcut-icon { position: relative; display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-solid); color: var(--accent); font-size: 18px; font-weight: 780; text-transform: uppercase; }
.shortcut-icon img { position: relative; z-index: 1; width: 30px; height: 30px; object-fit: contain; opacity: 0; transition: opacity .15s; }
.shortcut-icon.has-image img { opacity: 1; }
.icon-fallback { position: absolute; inset: 0; display: grid; place-items: center; background: var(--accent-soft); }
.shortcut-icon.has-image .icon-fallback { display: none; }
.shortcut-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 5px; }
.shortcut-copy strong, .shortcut-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shortcut-copy strong { font-size: 15px; letter-spacing: -.015em; }
.shortcut-copy small { color: var(--muted); font-size: 12px; }
.arrow { width: 18px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; opacity: 0; transform: translate(-3px, 3px); transition: opacity .18s, transform .18s; }
.shortcut-link:hover .arrow { opacity: 1; transform: none; }
.card-actions { position: absolute; top: 7px; right: 7px; display: flex; gap: 3px; }
.pin-shortcut, .remove-shortcut { display: grid; width: 28px; height: 28px; padding: 0; place-items: center; border: 0; border-radius: 9px; background: var(--surface-solid); color: var(--muted); cursor: pointer; opacity: 0; box-shadow: 0 4px 16px rgba(0,0,0,.08); transition: opacity .15s, color .15s; }
.pin-shortcut.is-pinned { color: var(--accent); opacity: 1; }
.shortcut-card:hover .pin-shortcut, .shortcut-card:hover .remove-shortcut, .pin-shortcut:focus-visible, .remove-shortcut:focus-visible { opacity: 1; }
.pin-shortcut:hover { color: var(--accent); }
.remove-shortcut:hover { color: #e14b4b; }
.pin-shortcut svg, .remove-shortcut svg { width: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.pin-shortcut.is-pinned svg { fill: currentColor; }
.empty-state { padding: 32px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); text-align: center; }

dialog { width: min(440px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--surface-solid); color: var(--text); box-shadow: 0 24px 90px rgba(0,0,0,.22); }
dialog::backdrop { background: rgba(10, 12, 18, .46); backdrop-filter: blur(5px); }
dialog[open] { animation: dialog-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
#shortcut-form { display: flex; flex-direction: column; padding: 26px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 24px; }
.dialog-heading .eyebrow { margin-bottom: 5px; }
#shortcut-form label { margin: 14px 0 7px; font-size: 13px; font-weight: 650; }
#shortcut-form input { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: var(--bg); color: var(--text); }
#shortcut-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { min-height: 18px; margin: 10px 0 0; color: #d74646; font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.secondary-button, .primary-button { padding: 11px 16px; border-radius: 11px; cursor: pointer; font-size: 13px; font-weight: 680; }
.secondary-button { border: 1px solid var(--line); background: transparent; }
.primary-button { border: 1px solid var(--text); background: var(--text); color: var(--bg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 850px) { .shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) {
  .page-shell { width: min(100% - 24px, 1120px); padding-top: 18px; }
  .hero { margin: 80px auto 72px; }
  .hero h1 { font-size: 34px; }
  .search { min-height: 60px; padding-left: 16px; border-radius: 18px; }
  .search kbd { display: none; }
  .search button { width: 44px; height: 44px; }
  .shortcut-grid { grid-template-columns: 1fr; }
  .clock { display: none; }
  .text-button { padding: 9px 11px; }
  .shortcut-link { min-height: 88px; }
  .pin-shortcut, .remove-shortcut { opacity: 1; }
}

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