/* Stringlet site — matches the Flutter app theme */

:root {
  --bg-start: #EFF6FF;
  --bg-end: #DBEAFE;
  --surface: #EFF6FF;
  --card: #DDEBFF;
  --primary: #1E3A8A;
  --accent: #1E3A8A;
  --secondary: #3B82F6;
  --on-surface: #1E293B;
  --on-surface-muted: rgba(30, 41, 59, 0.5);
  --on-primary: #fff;
  --card-border: rgba(30, 58, 138, 0.15);
  --input-bg: #BFDBFE;
  --tile-bg: #E8E8E8;
  --tile-border: #D0D0D0;
  --tile-hl-bg: var(--primary);
  --tile-hl-text: #fff;
  --wildcard: #2196F3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-start: #1A1F2E;
    --bg-end: #1B284E;
    --surface: #1A1F2E;
    --card: #1F2D54;
    --primary: #1E3A8A;
    --accent: #AEC4FF;
    --secondary: #4A5269;
    --on-surface: #E0E0E0;
    --on-surface-muted: rgba(224, 224, 224, 0.5);
    --on-primary: #fff;
    --card-border: rgba(174, 196, 255, 0.2);
    --input-bg: #22315C;
    --tile-bg: #4A4A4A;
    --tile-border: #5A5A5A;
    --tile-hl-bg: var(--primary);
    --tile-hl-text: #fff;
    --wildcard: #64B5F6;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background-color: var(--bg-end);
}

body {
  font-family: 'Source Code Pro', monospace;
  background: linear-gradient(180deg, var(--bg-start), var(--bg-end));
  color: var(--on-surface);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.6;
}

.container {
  padding: 20px;
}

h1, h2, h3 {
  font-family: 'Bree Serif', serif;
  font-weight: 400;
}

h1 {
  font-size: 2rem;
  color: var(--accent);
  text-align: center;
}

h2 {
  font-size: 1.25rem;
  color: var(--accent);
  margin: 1.5em 0 0.5em;
}

h3 {
  font-size: 1.05rem;
  color: var(--on-surface);
  margin: 1.25em 0 0.25em;
}

p { margin: 0.5em 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

ul { padding-left: 1.4em; margin: 0.5em 0; }
li { margin: 0.25em 0; }

/* iPhone frame — 19.6:9 aspect ratio */
.phone-frame {
  --phone-width: 280px;
  --screen-width: calc(var(--phone-width) - 24px);
  --screen-height: calc(var(--screen-width) * 19.6 / 9);
  width: var(--phone-width);
  margin: 0 auto;
  background: #111;
  border-radius: 40px;
  padding: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
  position: relative;
}

.phone-notch {
  width: 90px;
  height: 24px;
  background: #111;
  border-radius: 0 0 16px 16px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  top: -1px;
}

.phone-screen {
  background: linear-gradient(180deg, var(--bg-start), var(--bg-end));
  border-radius: 28px;
  padding: 10px 16px 20px;
  margin-top: -14px;
  height: var(--screen-height);
  display: flex;
  flex-direction: column;
}

.phone-header {
  font-family: 'Bree Serif', serif;
  color: var(--accent);
  font-size: 1.1rem;
  text-align: center;
  padding: 16px 0 10px;
}

.phone-card {
  background: var(--card);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
}

.phone-input {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.9rem;
  color: var(--on-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-icon {
  width: 14px;
  height: 14px;
  color: var(--on-surface-muted);
  flex-shrink: 0;
}

.phone-tiles {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-bottom: 12px;
}

.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--card);
  border: 1.5px solid var(--card-border);
  color: var(--on-surface);
}

.tile.highlighted {
  background: var(--tile-hl-bg);
  border-color: var(--tile-hl-bg);
  color: var(--tile-hl-text);
}

.tile.wildcard {
  color: var(--wildcard);
}

.phone-results {
  flex: 1;
  margin-top: 6px;
}

.phone-result-header {
  font-family: 'Bree Serif', serif;
  font-size: 0.7rem;
  color: var(--accent);
  padding: 6px 0 3px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 6px;
}

.phone-result-words {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

a.word {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.65rem;
  color: var(--on-surface);
  background: var(--card);
  padding: 3px 8px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s;
}

a.word:hover {
  background: var(--primary);
  color: var(--on-primary);
  text-decoration: none;
}

.phone-bar {
  width: 100px;
  height: 4px;
  background: #555;
  border-radius: 2px;
  margin: 10px auto 2px;
}

/* Subpage layout */
.subpage {
  display: block;
}

.subpage .container {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 20px;
}

.content-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 28px 24px;
  margin-top: 1.5em;
}

.back-link {
  display: inline-block;
  margin-top: 1.5em;
  font-size: 0.85rem;
  color: var(--accent);
}

.updated {
  font-size: 0.8rem;
  color: var(--on-surface-muted);
  margin-bottom: 1em;
}
