/* ============================================================
   tomlynch.me — minimal personal site
   White background, quiet serif typography, left sidebar.
   Light/dark themes via [data-theme] on <html>.
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #333333;
  --muted: #6d6d66;
  --faint: #9c9c93;
  --link: #0864c7;
  --rule: #e6e6e0;
  --chip-bg: #fafaf7;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101013;
  --text: #d9d9d2;
  --muted: #94948c;
  --faint: #6e6e67;
  --link: #8aabf5;
  --rule: #26262b;
  --chip-bg: #17171b;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* patrickcollison.com type & rhythm (his 13px/18px ratio), kept at 16px */
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  transition: background-color .2s ease, color .2s ease;
}

/* ---- layout ---- */

.layout {
  display: flex;
  gap: 4.5rem;
  max-width: 61rem;
  /* left-anchored like paulgraham.com / blog.samaltman.com */
  margin: 0;
  padding: 3.5rem 1.5rem 5rem 2.75rem;
}

.sidebar {
  order: -1; /* main comes first in the DOM; sidebar sits left on desktop */
  width: 10.25rem;
  flex: none;
  position: sticky;
  top: 3.5rem;
  align-self: flex-start;
  padding-top: .55rem; /* optically align nav with the page title */
}

main {
  flex: 1;
  min-width: 0;
  max-width: 40rem;
}

/* ---- sidebar ---- */

.site-nav {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin: 0 0 1.75rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  width: fit-content;
}

.site-nav a:hover { color: var(--link); }

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

.sidebar-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.05rem;
}

.follow-x {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .32em .8em;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: .8rem;
  color: var(--text);
  text-decoration: none;
  background: var(--chip-bg);
  white-space: nowrap;
}

.follow-x:hover { border-color: var(--faint); }

.follow-x svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}

.icon-row {
  display: flex;
  align-items: center;
  gap: .85rem;
}

.icon-row a {
  display: inline-flex;
  align-items: center;
  height: 20px;
  color: var(--faint);
}

.icon-row a:hover { color: var(--text); }

.icon-row svg { fill: currentColor; }

/* optically matched sizes: each logo fills a different share of its viewBox */
.icon-row svg.gh { width: 18px; height: 18px; }
.icon-row svg.yt { width: 22px; height: 22px; }
.icon-row svg.li { width: 18px; height: 18px; }

/* ---- theme toggle ---- */

.theme-toggle {
  width: 100%;
  margin-top: .4rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule);
}

#theme-btn {
  display: inline-flex;
  padding: .15rem;
  margin: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--faint);
}

#theme-btn:hover { color: var(--text); }

#theme-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#theme-btn .sun { display: none; }
:root[data-theme="dark"] #theme-btn .moon { display: none; }
:root[data-theme="dark"] #theme-btn .sun { display: inline; }

/* ---- content ---- */

/* the name at the top of the page, blog.samaltman.com-style; stays serif */
.page-title {
  font-family: Charter, Georgia, 'Times New Roman', serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1.5rem;
}

main h1 {
  font-size: 1.45rem;
  line-height: 1.3;
  margin: 0 0 1.25rem;
}

main h2 {
  font-size: 1.05rem;
  margin: 2em 0 .8em;
}

.page-title + h2 { margin-top: 0; }

main p { margin: 0 0 1em; }

main ul, main ol {
  margin: 0 0 1em;
  padding-left: 1.5rem;
}

main li { margin: 0 0 .7em; }

main li > ul {
  margin: .7em 0 0;
  list-style: circle;
}

main a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
  text-underline-offset: 2.5px;
}

main a:hover { text-decoration-color: currentColor; }

/* invisible link (the full stop that goes to /coaching) */
a.stealth, a.stealth:hover {
  color: inherit;
  text-decoration: none;
  cursor: default;
}

.soon { color: var(--muted); }

main img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.caption {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .35em;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.4rem 0;
}

/* ---- coaching page ---- */

.eyebrow {
  font-size: .78rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--muted);
  margin: 0 0 .65rem;
}

.page-head { margin-bottom: 2rem; }
.page-head h1 { margin-bottom: 1.4rem; }

.btn-email {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  padding: .5em 1.05em;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--chip-bg);
  color: var(--text) !important;
  text-decoration: none !important;
  font-size: .95rem;
}

.btn-email:hover { border-color: var(--faint); }

.btn-email svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.coaches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-top: 1.5rem;
}

.coach img {
  display: block;
  width: 100%;
  max-width: 12.5rem;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.coach h3 {
  font-size: 1.02rem;
  margin: 0 0 .55rem;
}

.coach ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: .92rem;
}

.coach li {
  margin-bottom: .45rem;
  padding-left: 1.05rem;
  text-indent: -1.05rem;
}

.coach li::before {
  content: "\2013\00a0\00a0";
  color: var(--faint);
}

.page-foot {
  margin-top: 2.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: .9rem;
  color: var(--muted);
}

.page-foot p { margin: 0; }

/* ---- 404 ---- */

.lost {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ---- small screens ---- */

@media (max-width: 700px) {
  .layout {
    flex-direction: column;
    gap: 2.25rem;
    padding: 2.25rem 1.25rem 3rem;
  }

  .sidebar {
    order: 0; /* below the content on small screens */
    position: static;
    width: 100%;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
  }

  .site-nav {
    flex-direction: row;
    gap: 1.15rem;
    margin-bottom: 1.15rem;
  }

  .sidebar-meta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.1rem;
  }

  .theme-toggle {
    width: auto;
    margin: 0;
    padding: 0;
    border: none;
  }

  .coaches { grid-template-columns: 1fr; }
}
