/* ryantemple.com — home screen. Single dark look by design. */
:root {
  --wall-top: #1d2a24;
  --wall-bottom: #111714;
  --fg: #f4f6f4;
  --glass: rgba(255, 255, 255, 0.1);
  --glass-line: rgba(255, 255, 255, 0.14);
  --sheet: #f6f7f6;
  --sheet-fg: #151716;
  --sheet-muted: #555c59;
  --sheet-line: #dfe3e0;
  --blue: #0a84ff;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --ease-open: cubic-bezier(.2, .85, .25, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--wall-bottom); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--fg);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid #8fd3ff; outline-offset: 3px; }

.wall { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; }

.home {
  max-width: 680px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 22px calc(130px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
}
.home > *, .widgets > * { min-width: 0; }

.status { display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; opacity: .9; }

/* Widgets */
.widgets { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 620px) { .widgets { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.widget {
  border-radius: 24px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  padding: 16px;
}
.widget-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .6; margin: 0 0 8px; }

.me { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.me img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.me h1 { font-size: 20px; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.me p { margin: 2px 0 0; font-size: 13px; opacity: .75; }
.nums { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--glass-line); padding-top: 12px; margin: 0; }
.nums div { margin: 0; }
.nums dd { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.nums dt { font-size: 11px; opacity: .65; }
.nums div { display: flex; flex-direction: column-reverse; }

.reading { display: flex; flex-direction: column; text-decoration: none; transition: transform .25s cubic-bezier(.3, 1.5, .6, 1); }
.reading:hover { transform: translateY(-2px); }
.reading-book { display: flex; gap: 12px; align-items: center; flex: 1; }
.reading-book img { width: 44px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); background: rgba(255, 255, 255, .1); }
.reading-book b { display: block; font-size: 14px; line-height: 1.2; }
.reading-book span { display: block; font-size: 12px; opacity: .65; margin-top: 2px; }
.reading-book .stars { color: #ffd60a; font-size: 11px; letter-spacing: 1px; margin-top: 4px; opacity: 1; }
.reading-more { font-size: 12px; opacity: .65; margin-top: 10px; }

/* App grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px 10px; list-style: none; margin: 0; padding: 0; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(5, 1fr); } }
.app {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  display: grid; justify-items: center; gap: 7px; position: relative; width: 100%;
}
.app-icon {
  width: min(68px, 100%); aspect-ratio: 1; border-radius: 23%; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
  transition: transform .25s cubic-bezier(.3, 1.5, .6, 1);
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app:hover .app-icon { transform: translateY(-3px); }
.app:active .app-icon { transform: scale(.92); }
.app-name { font-size: 12px; line-height: 1.1; text-align: center; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { position: absolute; top: -6px; right: calc(50% - 42px); background: #ff3b30; color: #fff; font-size: 10px; font-weight: 700; line-height: 1; padding: 4px 6px; border-radius: 9px; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.hint { text-align: center; font-size: 12px; opacity: .5; margin: 0; }

/* Dock */
.dock {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; gap: 16px; padding: 12px 16px; border-radius: 30px;
  background: rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  z-index: 2;
}
.dock a { width: 54px; height: 54px; border-radius: 23%; background: #fff; display: grid; place-items: center; transition: transform .2s; }
.dock a:hover { transform: translateY(-3px); }
.dock img, .dock svg { width: 28px; height: 28px; }
.dock svg { color: #1d1f1e; }

/* App sheet */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 5; transition: opacity .3s; }
.sheet {
  position: fixed; inset: 0; z-index: 6;
  background: var(--sheet); color: var(--sheet-fg);
  display: flex; flex-direction: column; overflow: hidden;
  transform-origin: 0 0;
}
@media (min-width: 720px) {
  .sheet { inset: auto; left: 50%; top: 50%; width: 600px; height: min(720px, 88vh); margin: calc(min(720px, 88vh) / -2) 0 0 -300px; border-radius: 28px; box-shadow: 0 40px 100px rgba(0, 0, 0, .5); }
}
.sheet-hero { position: relative; padding: calc(14px + env(safe-area-inset-top, 0px)) 22px 26px; color: #fff; touch-action: none; cursor: grab; transition: background-color .3s; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .55); margin: 0 auto 16px; }
.sheet-close { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 16px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .25); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.sheet-head { display: flex; gap: 16px; align-items: center; max-width: 560px; margin: 0 auto; }
.sheet-head img { width: 84px; height: 84px; border-radius: 23%; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); flex: none; }
.sheet-head h2 { font-size: 28px; line-height: 1.1; margin: 0; letter-spacing: -.02em; }
.sheet-head p { margin: 4px 0 0; opacity: .92; font-size: 14px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 22px 22px calc(22px + env(safe-area-inset-bottom, 0px)); }
.sheet-body-in { max-width: 560px; margin: 0 auto; display: grid; gap: 18px; }
.pill { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 20px; background: #e8ebe9; }
.pill i { width: 7px; height: 7px; border-radius: 50%; }
.story { font-size: 17px; line-height: 1.55; margin: 0; color: #2a2e2c; max-width: 60ch; }
.open { justify-self: start; background: var(--blue); color: #fff; text-decoration: none; font-weight: 600; padding: 12px 20px; border-radius: 14px; }
.open:hover { background: #0071e3; }
.pager { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--sheet-line); padding-top: 14px; }
.pager button { appearance: none; border: 0; background: none; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--sheet-muted); cursor: pointer; padding: 6px 0; min-width: 0; }
.pager button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager img { width: 28px; height: 28px; border-radius: 23%; flex: none; }

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