/* Styles for every page on ryan.fahlsing.com.
   Colors come from the rf logo: navy #0c223f and gray #a9a8a9. */
:root {
  --navy: #0c223f;
  --gray: #a9a8a9;
  --bg: #f6f6f5;
  --card: #ffffff;
  --border: #e2e2e0;
  --text: var(--navy);
  --muted: #5d5c5d;   /* the logo gray, darkened enough to read on white */
  --rule: var(--gray);
  --link: #1d4f91;
  --tag-bg: #ececea;
  --accent: var(--navy);   /* buttons, the featured card, the current menu item */
  --on-accent: #ffffff;
  --shadow: 0 10px 30px rgba(12, 34, 63, 0.14);
  --shot-shadow: 0 12px 24px rgba(12, 34, 63, 0.25);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--navy);
    --card: #12294a;
    --border: #24406a;
    --text: #ffffff;
    --muted: var(--gray);
    --rule: #3a4a60;
    --link: #9cc3f5;
    --tag-bg: #1b3559;
    --accent: #ffffff;
    --on-accent: var(--navy);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shot-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", Avenir, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* ---------- Top bar: name on the left (not on the home page), Apps menu on the right */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 16px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
}
.brand img { display: block; width: 32px; height: 32px; }

.menu { position: relative; margin-left: auto; }
.menu summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { border-color: var(--gray); }
.menu summary::after {   /* the arrow */
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.menu details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.menu ul {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: 290px;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--gray);
  box-shadow: var(--shadow);
}
.menu a {
  display: block;
  padding: 9px 12px;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.menu a:hover { background: var(--tag-bg); }
.menu a[aria-current="page"] { background: var(--tag-bg); border-left-color: var(--accent); }
.menu .name { display: block; font-weight: 600; line-height: 1.3; }
.menu .what { display: block; color: var(--muted); font-size: 0.85rem; line-height: 1.35; }

/* ---------- Home page: logo, name, gray bar */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 16px 0 56px;
}
.hero .logo {
  display: block;
  width: clamp(88px, 18vw, 120px);
  height: auto;
  margin-bottom: 24px;
}
h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.rule {
  width: 48px;
  height: 4px;
  margin: 20px 0 16px;
  background: var(--rule);
}
.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

h2 {
  margin: 0 0 20px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- App cards. One column on phones; on wider screens the featured
   app spans the full width and the other four sit in a 2 x 2 grid. */
.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) {
  .projects { grid-template-columns: 1fr 1fr; }
  .card.featured { grid-column: 1 / -1; }
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px 22px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--gray);   /* the logo's gray tile */
  transition: box-shadow 0.15s;
}
.card.featured { border-top-color: var(--accent); }
.card:hover { box-shadow: var(--shadow); }
.card h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.25;
}
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a::after {   /* makes the whole card open the app's page */
  content: "";
  position: absolute;
  inset: 0;
}
.card p {
  margin: 0 0 18px;
  color: var(--muted);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}
.tag {
  padding: 1px 8px;
  background: var(--tag-bg);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.action {
  margin-top: auto;
  font-weight: 600;
  font-size: 0.95rem;
}
.action a {
  position: relative;   /* keeps the GitHub link clickable above the card link */
  z-index: 1;
  text-decoration: none;
}
.action a:hover { text-decoration: underline; }
.action.soon { color: var(--muted); font-weight: 500; }

/* ---------- App pages */
.app-head { margin: 24px 0 40px; }
.app-head h1 { font-size: clamp(2rem, 6vw, 2.75rem); }
.app-head .tags { margin: 12px 0 16px; }
.lead {
  margin: 0;
  max-width: 38em;
  color: var(--muted);
  font-size: 1.15rem;
}
.buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.button {
  display: inline-block;
  padding: 9px 18px;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}
.button.primary { background: var(--accent); color: var(--on-accent); }
.button:hover { box-shadow: var(--shadow); }
.soon { color: var(--muted); font-weight: 500; }

/* Screenshots. A small window keeps its own size instead of being stretched,
   and the shadow follows the window's rounded corners. */
.shot { margin: 0 0 48px; }
.shot img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(var(--shot-shadow));
}
.shot figcaption { margin-top: 8px; color: var(--muted); font-size: 0.9rem; text-align: center; }

/* Features on the left, details box on the right; stacked on phones. */
.app-body { display: grid; gap: 32px; }
@media (min-width: 760px) {
  .app-body { grid-template-columns: minmax(0, 1fr) 250px; gap: 48px; }
}
.app-body section + section { margin-top: 36px; }
.features, .steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.features li {
  position: relative;
  padding-left: 22px;
}
.features li::before {   /* square dots, like the logo's */
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--gray);
}
.steps { counter-reset: step; }
.steps li {
  position: relative;
  min-height: 28px;
  padding: 1px 0 0 42px;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 0.9rem;
}
.facts {
  align-self: start;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--gray);
}
.facts dl { margin: 0; }
.facts dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.facts dd { margin: 2px 0 14px; }
.facts dd:last-child { margin-bottom: 0; }
.back { margin: 48px 0 0; font-size: 0.95rem; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--text); }

footer {
  margin-top: 56px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
