/* Dark UI loosely inspired by iPhone OS 1: black chrome, blue gel, Helvetica. */

:root {
  --black: #050505;
  --chrome-top: #3a3a3a;
  --chrome: #1c1c1c;
  --chrome-bottom: #0b0b0b;
  --row: #161616;
  --row-alt: #111111;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --blue: #0b5fff;
  --blue-hi: #5aa0ff;
  --blue-lo: #0039c7;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--black);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, #1a1a1a 0%, transparent 55%),
    var(--black);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

a:visited {
  color: #8eb6ff;
}

.phone {
  width: min(100% - 1.5rem, 28rem);
  margin: 1.25rem auto 2.5rem;
}

/* Top bar like iPhone status + nav */
.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.75rem 0.2rem;
  font-size: 0.72rem;
  font-weight: bold;
  letter-spacing: 0.02em;
  color: #ddd;
}

.statusbar__signal {
  display: inline-flex;
  gap: 2px;
  align-items: flex-end;
  height: 10px;
}

.statusbar__signal i {
  display: block;
  width: 3px;
  background: #ddd;
  border-radius: 1px;
}

.statusbar__signal i:nth-child(1) { height: 3px; }
.statusbar__signal i:nth-child(2) { height: 5px; }
.statusbar__signal i:nth-child(3) { height: 7px; }
.statusbar__signal i:nth-child(4) { height: 10px; opacity: 0.35; }
.statusbar__signal i:nth-child(5) { height: 10px; opacity: 0.35; }

.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid #000;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--chrome-top) 0%, var(--chrome) 48%, var(--chrome-bottom) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55);
}

.nav__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 -1px 0 #000;
}

.nav__back,
.nav__link {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.7rem;
  padding: 0 0.7rem;
  border: 1px solid #002a8f;
  border-radius: 999px;
  color: #fff !important;
  font-size: 0.78rem;
  font-weight: bold;
  text-decoration: none !important;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.45);
  background: linear-gradient(180deg, var(--blue-hi) 0%, var(--blue) 45%, var(--blue-lo) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 1px 1px rgba(0, 0, 0, 0.45);
}

.nav__back:hover,
.nav__link:hover {
  filter: brightness(1.08);
  text-decoration: none !important;
}

.nav__back:active,
.nav__link:active {
  filter: brightness(0.92);
}

.nav__back {
  left: 0.55rem;
  padding-left: 0.55rem;
}

.nav__back::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.28rem;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

.nav__link {
  right: 0.55rem;
}

/* Main panel */
.panel {
  border: 1px solid #000;
  border-top: none;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, #141414 0%, #0c0c0c 100%);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.panel__body {
  padding: 1.1rem 1rem 1.35rem;
}

.lead {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.lead a {
  color: var(--blue-hi);
}

/* Grouped list like Settings */
.group-label {
  margin: 0 0 0.45rem 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  border: 1px solid #000;
  border-radius: 10px;
  overflow: hidden;
  background: var(--row);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.03);
}

.list li {
  margin: 0;
  border-top: 1px solid var(--line);
}

.list li:first-child {
  border-top: none;
}

.list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%);
}

.list a:hover {
  background: linear-gradient(180deg, rgba(90, 160, 255, 0.12), rgba(11, 95, 255, 0.05));
  text-decoration: none;
}

.list a:active {
  background: rgba(11, 95, 255, 0.18);
}

.list__title {
  font-size: 0.98rem;
  font-weight: bold;
}

.list__meta {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.list__chevron {
  color: #5a5a5a;
  font-size: 1.1rem;
  font-weight: bold;
  line-height: 1;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  margin-top: 0.25rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--blue-hi);
}

/* Essay page */
.essay h1 {
  margin: 0 0 0.25rem;
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.essay .date {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.essay h2 {
  margin: 1.45rem 0 0.5rem;
  font-size: 1.05rem;
}

.essay p {
  margin: 0 0 0.95rem;
  color: #d6d6d6;
}

.essay ul {
  margin: 0 0 0.95rem;
  padding-left: 1.2rem;
  color: #d6d6d6;
}

.essay li {
  margin-bottom: 0.35rem;
}

.home-btn {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 1rem;
  border: 1px solid #002a8f;
  border-radius: 10px;
  color: #fff !important;
  font-size: 0.95rem;
  font-weight: bold;
  text-align: center;
  text-decoration: none !important;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
  background: linear-gradient(180deg, var(--blue-hi) 0%, var(--blue) 48%, var(--blue-lo) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.45);
}

.home-btn:hover {
  filter: brightness(1.06);
  text-decoration: none !important;
}

.home-btn:active {
  filter: brightness(0.9);
  transform: translateY(1px);
}

@media (min-width: 720px) {
  .phone {
    width: min(100% - 2rem, 32rem);
    margin-top: 2rem;
  }

  body {
    font-size: 17px;
  }
}
