/* OmniDex — naturalist field guide / specimen drawer */

:root {
  --accent-color: #4fe3cc;
  --accent-soft: rgba(79, 227, 204, 0.12);
  --accent-bright: #4fe3cc;
  --accent-warm: #ffb854;
  --warm-soft: rgba(255, 184, 84, 0.14);
  --panel-bg: rgba(20, 29, 28, 0.9);
  --card-bg: #172120;
  --card-edge: rgba(238, 232, 214, 0.08);
  --panel-border: rgba(79, 227, 204, 0.18);
  --rule-color: rgba(79, 227, 204, 0.22);
  --tile-bg: rgba(7, 11, 11, 0.45);
  --icon-ring: rgba(79, 227, 204, 0.28);
  --link-glow: rgba(79, 227, 204, 0.45);
  --grid-minor: rgba(79, 227, 204, 0.045);
  --grid-major: rgba(79, 227, 204, 0.085);
  --tint-color: #0d1413;
  --bg-gradient:
    radial-gradient(ellipse 80% 50% at 85% 0%, rgba(79, 227, 204, 0.09), transparent 70%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(255, 184, 84, 0.05), transparent 70%),
    linear-gradient(var(--grid-major) 1px, transparent 1px) 0 0 / 110px 110px,
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px) 0 0 / 110px 110px,
    linear-gradient(var(--grid-minor) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px) 0 0 / 22px 22px,
    #0d1413;
  --text-color: #eef1ea;
  --muted-text: #a3b2ad;
  --selection-bg: rgba(79, 227, 204, 0.3);
  --selection-text: #eef1ea;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 24px rgba(0, 0, 0, 0.32);
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
                 "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
                Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --accent-color: #0b7a6c;
    --accent-soft: rgba(11, 122, 108, 0.1);
    --accent-bright: #0b7a6c;
    --accent-warm: #9a5600;
    --warm-soft: rgba(184, 110, 0, 0.12);
    --tint-color: #f2ecdf;
    --grid-minor: rgba(11, 122, 108, 0.07);
    --grid-major: rgba(11, 122, 108, 0.13);
    --bg-gradient:
      radial-gradient(ellipse 80% 50% at 85% 0%, rgba(11, 122, 108, 0.07), transparent 70%),
      radial-gradient(ellipse 60% 40% at 0% 100%, rgba(184, 110, 0, 0.06), transparent 70%),
      linear-gradient(var(--grid-major) 1px, transparent 1px) 0 0 / 110px 110px,
      linear-gradient(90deg, var(--grid-major) 1px, transparent 1px) 0 0 / 110px 110px,
      linear-gradient(var(--grid-minor) 1px, transparent 1px) 0 0 / 22px 22px,
      linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px) 0 0 / 22px 22px,
      #f2ecdf;
    --text-color: #1a2421;
    --muted-text: #4a5551;
    --selection-bg: rgba(11, 122, 108, 0.22);
    --selection-text: #1a2421;
    --panel-bg: rgba(250, 246, 237, 0.92);
    --card-bg: #fbf8f0;
    --card-edge: rgba(26, 36, 33, 0.06);
    --panel-border: rgba(26, 36, 33, 0.16);
    --rule-color: rgba(11, 122, 108, 0.3);
    --tile-bg: rgba(242, 236, 223, 0.9);
    --icon-ring: rgba(26, 36, 33, 0.14);
    --link-glow: rgba(11, 122, 108, 0.25);
    --shadow: 0 18px 44px rgba(60, 45, 20, 0.16);
    --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 6px 16px rgba(60, 45, 20, 0.1);
  }
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-gradient);
  background-color: var(--tint-color);
  color: var(--text-color);
}

body {
  padding: 0;
  overflow-x: hidden;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

.container {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
  box-sizing: border-box;
  animation: fadeInUp 0.55s ease-out;
}

@media (max-width: 600px) {
  .container {
    padding: 1rem 1rem 1.6rem;
  }
}

/* ---------- Header ---------- */

.header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.9rem;
  min-height: 64px;
  padding: 0.75rem 0;
}

.header > div {
  display: flex;
  flex-direction: column;
}

.header-label {
  margin-left: auto;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1.35;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: right;
  color: var(--muted-text);
}

.header-label b {
  color: var(--accent-warm);
  font-weight: 600;
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px var(--icon-ring),
    0 10px 24px rgba(0, 0, 0, 0.4);
  -webkit-user-drag: none;
}

h1 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: var(--text-color);
  letter-spacing: 0.01em;
}

.tagline {
  margin: 0.1rem 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--muted-text);
}

.underline-accent {
  display: none;
}

/* Ruler: measurement ticks under the header */
.ruler {
  height: 14px;
  border-top: 1px solid var(--rule-color);
  background:
    repeating-linear-gradient(90deg, var(--accent-bright) 0 1px, transparent 1px 110px) 0 0 / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, var(--rule-color) 0 1px, transparent 1px 22px) 0 0 / 100% 7px no-repeat;
  opacity: 0.85;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  align-items: center;
  gap: 3rem;
  padding: 3.6rem 0 3rem;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero-kicker::before {
  content: "";
  width: 44px;
  height: 9px;
  border-bottom: 1px solid currentColor;
  background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 11px) 0 100% / 100% 5px no-repeat;
}

.hero-title {
  margin: 0 0 1.1rem;
  font-family: var(--font-serif);
  font-size: clamp(3.4rem, 9vw, 6.6rem);
  font-weight: 700;
  line-height: 0.92;
  color: var(--text-color);
  letter-spacing: -0.015em;
}

.hero-lede {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--text-color);
}

/* Specimen drawer */
.drawer {
  position: relative;
  padding: 0.9rem;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background:
    linear-gradient(180deg, var(--accent-soft), transparent 40%),
    var(--panel-bg);
  box-shadow: var(--shadow);
}

.drawer-plate {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 0.85rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--accent-warm);
  border-radius: 2px;
  color: var(--accent-warm);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--warm-soft);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.panel-row {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  min-height: 150px;
  padding: 0.85rem 0.9rem 0.9rem;
  border: 1px solid var(--card-edge);
  border-radius: 3px;
  background:
    linear-gradient(var(--grid-minor) 1px, transparent 1px) 0 0 / 100% 18px,
    var(--card-bg);
  box-shadow: var(--card-shadow);
  box-sizing: border-box;
}

/* Specimen pin */
.panel-row::before {
  content: "";
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-warm);
  box-shadow: 0 0 0 3px var(--warm-soft);
}

.cat-no {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--accent-bright);
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--rule-color);
  width: 100%;
}

.panel-name {
  display: block;
  color: var(--text-color);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
}

.panel-meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted-text);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.86rem;
  line-height: 1.35;
}

.panel-tag {
  margin-top: auto;
  flex-shrink: 0;
  padding: 0.18rem 0.5rem;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  color: var(--muted-text);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-3deg);
}

.panel-tag.accent {
  color: var(--accent-bright);
  background: var(--accent-soft);
}

.panel-tag.warm {
  color: var(--accent-warm);
  background: var(--warm-soft);
}

.panel-code {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: var(--tile-bg);
  color: var(--text-color);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre;
  overflow: hidden;
}

.panel-code .code-key {
  color: var(--accent-bright);
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.2rem;
    padding-top: 2.4rem;
  }
}

@media (max-width: 420px) {
  .panel-row {
    min-height: 140px;
    padding: 0.75rem;
  }

  .panel-name {
    font-size: 1.08rem;
  }
}

/* ---------- Typography ---------- */

h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: 0;
}

h3 {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  margin: 1rem 0 0.35rem;
  color: var(--text-color);
  letter-spacing: 0;
}

p {
  line-height: 1.65;
  margin: 0.45rem 0;
  font-size: 1rem;
  color: var(--muted-text);
}

ul,
ol {
  padding-left: 1.3rem;
  margin: 0.45rem 0 0.3rem;
}

li {
  line-height: 1.6;
  margin-bottom: 0.3rem;
  color: var(--muted-text);
}

li::marker {
  color: var(--accent-warm);
}

li strong,
p strong {
  color: var(--text-color);
}

a {
  color: var(--accent-bright);
  text-decoration: underline;
  text-decoration-color: var(--rule-color);
  text-underline-offset: 0.18em;
  word-break: break-word;
  transition: color 0.2s ease, text-decoration-color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
  text-decoration-color: currentColor;
  text-shadow: 0 0 6px var(--link-glow);
}

/* ---------- Home: notebook entries ---------- */

.home .entry {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 2.5rem;
  align-items: start;
  padding: 2.4rem 0;
  border-top: 1px solid var(--rule-color);
  position: relative;
}

.home .entry::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 7px;
  background: repeating-linear-gradient(90deg, var(--rule-color) 0 1px, transparent 1px 22px);
  pointer-events: none;
}

.home .entry > .plate,
.home .entry > h2 {
  grid-column: 1;
}

.home .entry > :not(.plate):not(h2) {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.plate {
  margin: 0 0 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-warm);
}

.home .entry > h2 {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.15;
}

.home .requirements > p:not(.plate) {
  margin-top: 0 !important;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--accent-warm);
  background: var(--warm-soft);
  border-radius: 0 3px 3px 0;
  color: var(--text-color);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
}

.home .requirements > .plate {
  padding-top: 0.95rem;
}

/* Lists styled as notebook lines */
.index-list,
.notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: note;
}

.index-list li,
.notes-list li {
  position: relative;
  margin: 0;
  padding: 0.8rem 0 0.8rem 3rem;
  border-bottom: 1px dashed var(--panel-border);
  counter-increment: note;
}

.index-list li:first-child,
.notes-list li:first-child {
  padding-top: 0.2rem;
}

.index-list li:first-child::before,
.notes-list li:first-child::before {
  top: 0.32rem;
}

.index-list li:last-child,
.notes-list li:last-child {
  border-bottom: 0;
}

.notes-list li::before,
.index-list li::before {
  content: counter(note, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.92rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--accent-bright);
}

.index-list li::before {
  content: "\00a7\00a0" counter(note);
  color: var(--accent-warm);
}

/* Field-card features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 0;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.feature-card {
  position: relative;
  min-height: 128px;
  padding: 1.1rem 1.2rem 1.2rem;
  background:
    linear-gradient(var(--grid-minor) 1px, transparent 1px) 0 0 / 100% 22px;
  border-right: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
}

.feature-card:nth-child(2n) {
  border-right: 0;
}

.feature-card:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.fig {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

.feature-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--muted-text);
}

@media (max-width: 560px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card,
  .feature-card:nth-child(2n) {
    border-right: 0;
    border-bottom: 1px solid var(--panel-border);
    min-height: 0;
  }

  .feature-card:last-child {
    border-bottom: 0;
  }
}

/* iPhone Duo spread */
.duo-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 2rem;
  align-items: center;
}

.duo-body > p {
  margin: 0;
}

.spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--tile-bg);
  box-shadow: var(--shadow);
  position: relative;
}

.spread::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 1px;
  background: var(--rule-color);
}

.leaf {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 170px;
  padding: 0.75rem 0.7rem;
  border-radius: 9px;
  background:
    linear-gradient(var(--grid-minor) 1px, transparent 1px) 0 0 / 100% 14px,
    var(--card-bg);
}

.leaf-label {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: 3px;
}

.leaf-figure {
  height: 64px;
  border-radius: 5px;
  border: 1px dashed var(--rule-color);
  background:
    radial-gradient(circle at 50% 55%, var(--accent-soft) 0 22px, transparent 23px),
    var(--accent-soft);
}

.leaf-line {
  height: 5px;
  width: 100%;
  border-radius: 3px;
  background: var(--panel-border);
}

.leaf-line.w80 { width: 80%; }
.leaf-line.w60 { width: 60%; }
.leaf-line.w50 { width: 50%; }

@media (max-width: 760px) {
  .home .entry {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    padding: 2rem 0;
  }

  .home .entry > :not(.plate):not(h2) {
    grid-column: 1;
    grid-row: auto;
    margin-top: 1.1rem;
  }

  .duo-body {
    grid-template-columns: 1fr;
  }

  .spread {
    max-width: 300px;
  }

  .home .requirements > p:not(.plate) {
    margin-top: 0.6rem !important;
  }

  .home .requirements > .plate {
    padding-top: 0;
  }
}

/* ---------- Footer ---------- */

footer {
  margin-top: 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule-color);
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted-text);
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 7px;
  background: repeating-linear-gradient(90deg, var(--rule-color) 0 1px, transparent 1px 22px);
}

footer a {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}

.no-select {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.6rem 0 0.5rem;
}

.app-store-link {
  text-decoration: none;
}

.app-store-link img {
  width: 190px;
  height: auto;
  display: block;
  -webkit-user-drag: none;
}

/* ---------- Subpages (privacy, support, terms) ---------- */

.subpage .container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.subpage section,
.subpage .header,
.subpage .ruler,
.subpage .container > p,
.subpage .container > ul,
.subpage .container > ol,
.subpage .container > h2,
.subpage footer {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.subpage .header {
  border-bottom: 1px solid var(--rule-color);
  box-shadow: 0 6px 0 -5px var(--rule-color);
}

.subpage .header h1 {
  font-size: 1.3rem;
}

.subpage .container > p:first-of-type {
  margin-top: 2rem;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-color);
}

.subpage section {
  padding: 1.2rem 0;
  border-top: 1px solid var(--panel-border);
}

.subpage section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.subpage .container > h2 {
  padding-top: 1.35rem;
  border-top: 1px dashed var(--panel-border);
  font-size: 1.3rem;
}

.subpage h2 {
  font-size: 1.3rem;
}

.subpage h3 {
  font-size: 1.05rem;
}

@media (max-width: 600px) {
  .subpage .container {
    padding: 1rem 1rem 1.6rem;
  }
}

/* ---------- Motion ---------- */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .container {
    animation: none;
  }

  a {
    transition: none;
  }
}
