/* Linksy — public shortener theme
   Palette + type inspired by nudgetaskai.com (light Apple/iOS aesthetic). */

:root {
  --bg:        #F7F7F5;
  --bg-2:      #F0F0EE;
  --card:      #FFFFFF;
  --ink:       #0A0A0A;
  --ink-soft:  #555555;
  --ink-dim:   #888888;
  --line:      #E6E6E2;
  --primary:   #007AFF;
  --primary-d: #0060cc;
  --green:     #34C759;
  --purple:    #AF52DE;
  --orange:    #FF9500;
  --indigo:    #5856D6;
  --tint-blue:   #E8F2FF;
  --tint-purple: #F3EDFD;
  --tint-green:  #E5F8EC;
  --tint-amber:  #FFF7E0;
  --radius:    16px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow:    0 1px 2px rgba(10,10,10,.04), 0 8px 30px rgba(10,10,10,.06);
  --shadow-lg: 0 10px 40px rgba(0,122,255,.15);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0A; --bg-2:#141414; --card:#1A1A1A; --ink:#F5F5F5;
    --ink-soft:#B0B0B0; --ink-dim:#888; --line:#2A2A2A;
    --tint-blue:#12283f; --tint-purple:#251a38; --tint-green:#12301f; --tint-amber:#332a10;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 30px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg:#0A0A0A; --bg-2:#141414; --card:#1A1A1A; --ink:#F5F5F5;
  --ink-soft:#B0B0B0; --ink-dim:#888; --line:#2A2A2A;
  --tint-blue:#12283f; --tint-purple:#251a38; --tint-green:#12301f; --tint-amber:#332a10;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 30px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
  line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

/* custom scrollbar (no native chrome) */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-dim); }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* top bar */
.nav { display: flex; align-items: center; gap: 12px; padding: 20px 0; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -.02em; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand .logo { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg,var(--primary),var(--indigo)); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.brand .ver { font-size: 11px; font-weight: 600; color: var(--primary); background: var(--tint-blue); padding: 2px 8px; border-radius: var(--radius-pill); flex-shrink: 0; }
.nav .spacer { flex: 1 1 auto; min-width: 0; }
.nav a.btn-ghost, .nav button.theme { flex-shrink: 0; }

.btn { font-family: inherit; font-size: 15px; font-weight: 600; border: none; cursor: pointer; border-radius: var(--radius-pill); padding: 11px 22px; transition: transform .12s ease, box-shadow .2s ease, background .2s ease; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); box-shadow: var(--shadow-lg); }
.btn-ghost { background: transparent; color: var(--ink); text-decoration: none; padding: 9px 16px; border-radius: var(--radius-pill); }
.btn-ghost:hover { background: var(--bg-2); }
.theme { background: var(--card); border: 1px solid var(--line); color: var(--ink); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.theme:hover { background: var(--bg-2); }

/* hero */
.hero { text-align: center; padding: 48px 0 12px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--indigo); background: var(--tint-purple); padding: 6px 14px; border-radius: var(--radius-pill); margin-bottom: 22px; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 16px; font-weight: 800; }
.hero h1 .grad { background: linear-gradient(120deg,var(--primary),var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.sub { font-size: clamp(16px,2.4vw,20px); color: var(--ink-soft); max-width: 560px; margin: 0 auto; }

/* shorten card */
.shortener { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin: 32px auto 0; max-width: 720px; }
.field-row { display: flex; gap: 10px; align-items: stretch; }
.input-ico { position: relative; flex: 1 1 auto; min-width: 0; }
.input-ico svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-dim); pointer-events: none; }
.shortener input[type=url], .shortener input[type=text] {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 15px 16px 15px 46px; outline: none; transition: border .15s ease, box-shadow .15s ease;
}
.shortener input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--tint-blue); }
.shortener .btn-primary { flex-shrink: 0; padding-left: 28px; padding-right: 28px; }
.opts { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.opts .slash { color: var(--ink-dim); font-family: var(--mono); font-size: 14px; flex-shrink: 0; }
.opts input { flex: 0 1 240px; padding: 10px 14px !important; padding-left: 14px !important; font-size: 14px !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* result */
.result { margin-top: 16px; border-radius: var(--radius-sm); padding: 16px; display: none; animation: pop .25s ease; }
.result.show { display: block; }
.result.ok { background: var(--tint-green); border: 1px solid rgba(52,199,89,.3); }
.result.err { background: var(--tint-amber); border: 1px solid rgba(255,149,0,.35); color: #8A5200; }
@keyframes pop { from { opacity: 0; transform: translateY(6px);} to {opacity:1; transform:none;} }
.result .row { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.result a.short { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 16px; font-weight: 600; color: var(--primary); text-decoration: none; }
.result .copy { flex-shrink: 0; background: var(--card); border: 1px solid var(--line); color: var(--ink); border-radius: var(--radius-pill); padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.result .copy:hover { background: var(--bg); }
.result .meta { font-size: 12px; color: var(--ink-soft); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 56px 0 24px; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.feat .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; }
.feat:nth-child(1) .ico { background: var(--tint-blue); color: var(--primary); }
.feat:nth-child(2) .ico { background: var(--tint-purple); color: var(--purple); }
.feat:nth-child(3) .ico { background: var(--tint-green); color: var(--green); }
.feat:nth-child(4) .ico { background: var(--tint-amber); color: var(--orange); }
.feat h3 { margin: 0 0 6px; font-size: 16px; letter-spacing: -.01em; }
.feat p { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* footer */
.foot { text-align: center; color: var(--ink-dim); font-size: 13px; padding: 40px 0; border-top: 1px solid var(--line); margin-top: 40px; }
.foot a { color: var(--ink-soft); text-decoration: none; }
.foot a:hover { color: var(--primary); }

/* toast */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); transition: transform .3s cubic-bezier(.2,1,.3,1); z-index: 100; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
#toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .field-row { flex-direction: column; }
  .shortener .btn-primary { width: 100%; }
}
@media (max-width: 400px) { .features { grid-template-columns: 1fr; } }
