/*
  Styles for lmendev.github.io
  1. Colors (GitHub's Primer palette, dark and light)
  2. Base
  3. Layout
  4. Profile
  5. Lists: projects and writing
  6. Contact
  7. Hover, pressed states and motion
*/

/* 1. Colors ------------------------------------------------------------- */

:root {
  --canvas: #0d1117;
  --card: #151b23;
  --control: #212830;
  --control-hover: #262c36;
  --border: #3d444d;
  --fg: #f0f6fc;
  --muted: #9198a1;
  --link: #4493f8;
  --primary: #238636;
  --primary-hover: #29903b;
  --primary-border: rgba(255, 255, 255, 0.15);
  --focus: #1f6feb;
  --glow: rgba(35, 134, 54, 0.14);
  --shadow: rgba(1, 4, 9, 0.5);
  --lift: none;
}

@media (prefers-color-scheme: light) {
  :root {
    --canvas: #f6f8fa;
    --card: #ffffff;
    --control: #f6f8fa;
    --control-hover: #eff2f5;
    --border: #d1d9e0;
    --fg: #1f2328;
    --muted: #59636e;
    --link: #0969da;
    --primary: #1f883d;
    --primary-hover: #1c8139;
    --primary-border: rgba(31, 35, 40, 0.15);
    --focus: #0969da;
    --glow: rgba(31, 136, 61, 0.08);
    --shadow: rgba(31, 35, 40, 0.12);
    --lift: 0 1px 0 rgba(31, 35, 40, 0.04);
  }
}

/* 2. Base --------------------------------------------------------------- */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(70% 420px at 50% 0, var(--glow), transparent) no-repeat var(--canvas);
  color: var(--fg);
  font: 16px/1.5 "Mona Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p {
  margin: 0;
}

h2, h3 {
  font-size: 17px;
  font-weight: 600;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Icons come from img/icons.svg and take the text color. */
.icon {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-filled {
  fill: currentColor;
  stroke-width: 2;
}

/* 3. Layout ------------------------------------------------------------- */

.page {
  max-width: 36rem;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 64px) 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

main {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* 4. Profile ------------------------------------------------------------ */

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 1px solid var(--border);
  box-shadow: 0 0 0 4px var(--canvas);
  background: var(--control);
  object-fit: cover;
  color: transparent;
  overflow: hidden;
}

h1 {
  margin-top: 14px;
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: clamp(28px, 7.5vw, 40px);
  font-weight: 800;
  font-stretch: 112.5%;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.tagline {
  margin-top: 8px;
  max-width: 32ch;
  font-size: 17px;
  color: var(--muted);
  text-wrap: balance;
}

.social {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--lift);
}

/* 5. Lists: projects and writing ---------------------------------------- */

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Featured project */
.featured {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--lift);
  overflow: hidden;
}

.preview {
  height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  border-bottom: 1px solid var(--border);
}

.window {
  width: 76%;
  max-width: 300px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 8px 24px var(--shadow);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

.window-bar span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.window-bar small {
  margin-left: 6px;
  font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
}

.window-body {
  height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 12px;
}

.ground {
  margin-top: 4px;
  width: 70%;
  height: 2px;
  background: var(--border);
}

.featured-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.description {
  font-size: 15px;
  color: var(--muted);
  text-wrap: pretty;
}

.actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--control);
  color: var(--fg);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.button-primary {
  padding: 0 18px;
  border-color: var(--primary-border);
  background: var(--primary);
  color: #ffffff;
}

/* List items */
.item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--fg);
  text-decoration: none;
  box-shadow: var(--lift);
}

.thumb {
  flex: none;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--canvas);
  color: var(--muted);
}

.item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.item-name {
  font-size: 16px;
  font-weight: 600;
}

.item-description {
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
}

/* Thumbnail drawings */
.json {
  display: flex;
  flex-direction: column;
  font: 9px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.json-key {
  padding-left: 6px;
  color: var(--fg);
}

.json-value {
  padding-left: 6px;
  color: var(--link);
}

.doc {
  width: 44px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.doc span {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}

.doc .doc-title {
  height: 6px;
  width: 72%;
  background: var(--fg);
}

.doc .doc-88 { width: 88%; }
.doc .doc-56 { width: 56%; }

.more {
  align-self: center;
  padding: 10px 8px;
  font-size: 15px;
  color: var(--link);
  text-underline-offset: 3px;
}

/* 6. Contact ------------------------------------------------------------ */

.contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contribute {
  font-size: 15px;
  color: var(--muted);
  text-align: center;
  text-wrap: balance;
}

.contribute a,
.email a {
  color: var(--link);
  text-underline-offset: 3px;
}

.email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--lift);
  font-size: 15px;
}

.email-label {
  margin-right: 4px;
  color: var(--muted);
}

.copy {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--control);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.copy[hidden] {
  display: none;
}

footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

footer a {
  display: inline-block;
  padding: 8px;
  color: inherit;
  text-underline-offset: 3px;
}

/* 7. Hover, pressed states and motion ---------------------------------- */

@media (hover: hover) {
  .pill:hover,
  .button:hover,
  .copy:hover {
    background: var(--control-hover);
  }

  .button-primary:hover {
    background: var(--primary-hover);
  }

  .item:hover {
    border-color: var(--muted);
  }
}

/* Phones have no hover, so these give feedback while a finger is down. */
.pill,
.button,
.copy,
.item {
  -webkit-tap-highlight-color: transparent;
}

.pill:active,
.button:active,
.copy:active {
  background: var(--control-hover);
}

.button-primary:active {
  background: var(--primary-hover);
}

.item:active {
  border-color: var(--muted);
  background: var(--control);
}

@media (prefers-reduced-motion: no-preference) {
  .pill,
  .button,
  .copy,
  .item {
    transition: background-color 0.15s ease, border-color 0.15s ease;
  }
}
