/* davedangle.com's own pages (home, projects): a personal look, separate
   from Wattage's app theme in style.css. Same type, a calmer accent.
   Light mode follows the visitor's system setting. */

:root {
  --bg: #0b0c0f;
  --surface: #14161b;
  --border: #262a33;
  --text: #f4f5f7;
  --text-2: #a7abb5;
  --text-3: #767b86;
  --accent: #8fb4ff;
  --from: #24262c;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbfbfc;
    --surface: #ffffff;
    --border: #e1e3e8;
    --text: #101216;
    --text-2: #555a64;
    --text-3: #868b95;
    --accent: #2f5bd3;
    --from: #ececef;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html { background: linear-gradient(135deg, var(--from) 0%, var(--bg) 45%, color-mix(in srgb, var(--accent) 10%, var(--bg)) 100%) fixed var(--bg); }
/* The glows, on their own layer so they can float slowly around the page.
   Their colors follow the time of day in Denver (--glow-a, --glow-b, set
   by the home page's script). */
body::before {
  content: ""; position: fixed; inset: -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 75% 70%, color-mix(in srgb, var(--glow-a, var(--accent)) 26%, transparent), transparent 70%),
    radial-gradient(35% 35% at 30% 40%, color-mix(in srgb, var(--glow-b, #8b5cf6) 16%, transparent), transparent 70%);
  animation: float 24s ease-in-out infinite alternate;
}
@keyframes float {
  from { transform: translate(-8%, -6%) rotate(0deg); }
  to   { transform: translate(8%, 6%) rotate(25deg); }
}
body {
  margin: 0; min-height: 100vh;
  /* Grey in the top left, easing into the accent toward the bottom right. */
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 3px; }

/* As wide as the project pages, so a card opens into a page of the same
   width. Paragraphs keep their own reading width (p max-width). */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

header.site {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 24px;
}
.brand {
  font: 700 20px "Space Grotesk", system-ui, sans-serif;
  color: var(--text); text-decoration: none; letter-spacing: -0.3px;
}
nav { display: flex; gap: 20px; flex-wrap: wrap; }
nav a { color: var(--text-2); text-decoration: none; font-size: 15px; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); }

h1, h2, h3 { font-family: "Space Grotesk", system-ui, sans-serif; text-wrap: balance; }
h1 { font-size: clamp(40px, 7vw, 76px); line-height: 1.04; letter-spacing: -2px; margin: 0 0 16px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-3); margin: 64px 0 16px; }
h3 { font-size: 20px; letter-spacing: -0.3px; margin: 0 0 4px; }
p { color: var(--text-2); max-width: 62ch; margin: 0 0 12px; }

/* Hero: intro beside the portrait, the portrait on top on a phone. */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 32vw, 360px); gap: clamp(40px, 6vw, 72px); align-items: center;
  margin-top: 48px;
}
.eyebrow {
  font: 600 13px "Space Grotesk", system-ui, sans-serif; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent); margin: 0 0 12px;
}
.portrait {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 24px; border: 1px solid var(--border);
  box-shadow: 0 24px 60px -24px rgb(0 0 0 / 0.5);
}
.lede { font-size: 20px; color: var(--text-2); }
@media (max-width: 680px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .portrait { order: -1; max-height: 420px; }
}

/* Code, Drums, Outdoors. */
.sides {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 64px;
}
.side {
  padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
}
.side h3 { font-size: 17px; margin: 10px 0 4px; }
.side p { font-size: 15px; margin: 0; }
.side .icon {
  width: 30px; height: 30px; fill: none; stroke: var(--accent);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
@media (max-width: 680px) { .sides { grid-template-columns: 1fr; } }
/* Small icon links at the end of a tile's line. */
.side .links { display: inline-flex; gap: 2px; vertical-align: middle; margin-left: 2px; }
.side .links a {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  color: var(--text-2);
}
.side .links a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.side .links svg { width: 16px; height: 16px; fill: currentColor; }

/* What I'm listening to: Spotify's compact player under the tiles. It
   loads lazily; the box holds its place until it does. */
.playlist { margin-top: 12px; height: 152px; border-radius: 12px; overflow: hidden; background: var(--surface); }
.playlist iframe { display: block; width: 100%; height: 152px; border: 0; }

/* A tiny equalizer for the music tile. Still for anyone who asked for less motion. */
.eq { display: inline-flex; align-items: flex-end; gap: 4px; height: 30px; }
.eq i {
  width: 4px; height: 100%; border-radius: 2px; background: var(--accent);
  transform-origin: bottom; animation: eq 1.1s ease-in-out infinite;
}
.eq i:nth-child(2) { animation-delay: -0.35s; }
.eq i:nth-child(3) { animation-delay: -0.7s; }
.eq i:nth-child(4) { animation-delay: -0.15s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  .eq i { animation: none; }
  .eq i:nth-child(odd) { transform: scaleY(0.55); }
}

.socials { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.socials a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); text-decoration: none; font-size: 15px;
}
.socials a:hover { border-color: var(--text-3); }
.socials svg { width: 16px; height: 16px; fill: currentColor; }

/* Project cards. */
/* Side by side once there's room for both. */
.projects { display: grid; gap: 16px; }
@media (min-width: 900px) { .projects { grid-template-columns: 1fr 1fr; } }
.project {
  display: block; padding: 22px; border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); color: inherit; text-decoration: none;
}
a.project { transition: transform 0.2s ease, border-color 0.2s ease; }
a.project:hover { border-color: var(--text-3); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { a.project:hover { transform: none; } }
.project .meta { font-size: 13px; color: var(--text-3); margin: 0 0 10px; }
.project p { margin: 0; font-size: 16px; }
.project .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.project .tags span {
  font-size: 12px; color: var(--text-2); padding: 3px 10px;
  border: 1px solid var(--border); border-radius: 999px;
}
.project.wattage { border-color: color-mix(in srgb, #c8ff3c 35%, var(--border)); background: url(/img/topo-indy-dark.svg) center / cover, var(--surface); }
@media (prefers-color-scheme: light) { .project.wattage { background: url(/img/topo-indy-light.svg) center / cover, var(--surface); } }
.project.wattage { view-transition-name: wattage; }
.project.in { view-transition-name: in-app; border-color: color-mix(in srgb, #c210eb 40%, var(--border)); background: url(/projects/in/img/in-shapes-card-dark.svg) right center / cover, var(--surface); }
@media (prefers-color-scheme: light) { .project.in { background: url(/projects/in/img/in-shapes-card-light.svg) right center / cover, var(--surface); } }
.project .go { color: var(--accent); font-size: 15px; margin-top: 14px; display: inline-block; }

/* Experience timeline. */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: grid; grid-template-columns: 120px 1fr; gap: 16px;
  padding: 14px 0; border-top: 1px solid var(--border);
}
.timeline li:last-child { border-bottom: 1px solid var(--border); }
.timeline .when { color: var(--text-3); font-size: 14px; padding-top: 2px; }
.timeline .what { color: var(--text); font-weight: 600; }
.timeline .where { color: var(--text-2); font-size: 15px; }
@media (max-width: 600px) {
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
}

/* Contact form. */
.contact form { display: grid; gap: 16px; max-width: 560px; margin-top: 28px; }
.contact label { display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.contact input, .contact textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
}
.contact input:focus, .contact textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.contact textarea { resize: vertical; min-height: 140px; }
.contact .hp { position: absolute; left: -9999px; }
.contact button {
  justify-self: start; font: 600 16px "Space Grotesk", system-ui, sans-serif;
  color: var(--bg); background: var(--text); border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer;
}
.contact button:disabled { opacity: 0.6; cursor: default; }
.contact .status { margin: 0; font-size: 15px; min-height: 1.5em; }
.contact .sent { text-align: center; padding: 96px 0 40px; }
.contact .sent .check { width: 64px; height: 64px; margin-bottom: 20px; }
.contact .sent .check circle { fill: color-mix(in srgb, var(--accent) 16%, transparent); stroke: var(--accent); stroke-width: 2; }
.contact .sent .check path { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.contact .sent .lede { margin-inline: auto; }
.contact .actions { display: flex; gap: 20px; justify-content: center; align-items: center; margin-top: 28px; }
.contact .button {
  font: 600 16px "Space Grotesk", system-ui, sans-serif; color: var(--bg); background: var(--text);
  border-radius: 999px; padding: 12px 22px; text-decoration: none;
}
.contact .actions a:not(.button) { color: var(--text-2); text-decoration: none; }
/* The hidden attribute must win over display rules like the form's grid. */
[hidden] { display: none !important; }

footer.site {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 72px; padding-block: 28px; border-top: 1px solid var(--border);
  color: var(--text-3); font-size: 14px;
}
footer.site a { color: var(--text-2); text-decoration: none; }

/* Motion. All of it stops for anyone who asked for less. */

.side, .project { position: relative; overflow: hidden; }
.side::before, .project::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
}
.side:hover::before, .project:hover::before { opacity: 1; }

.icon.code .slash { stroke-dasharray: 1; animation: type 3s ease-in-out infinite; }
@keyframes type { 0%, 15% { stroke-dashoffset: 1; } 45%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }
.icon.outdoors .sun { fill: var(--accent); stroke: none; transform-box: fill-box; filter: drop-shadow(0 0 3px var(--accent)); animation: rise 5s ease-in-out infinite alternate; }
.icon.outdoors .mountain { fill: var(--surface); }
.icon.outdoors .trail { stroke-width: 1.8; stroke-dasharray: 1; animation: hike 5s ease-in-out infinite; }
@keyframes hike { 0%, 10% { stroke-dashoffset: 1; } 60%, 90% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }
@keyframes rise { from { transform: translateY(7px); } to { transform: translateY(-2px); } }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in-view { opacity: 1; transform: none; }
.reveal.instant { transition: none; }
#projects { scroll-margin-top: 24px; }

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .icon.code .slash, .icon.outdoors .sun, .icon.outdoors .trail { animation: none; }
}

/* Project cards carry their app's icon. */
.project .logo { float: right; width: 52px; height: 52px; border-radius: 12px; margin: 0 0 8px 16px; }

/* Page changes: the old page fades out fast and the new one fades in with
   a small rise. A project card and its page's background share a name, so
   the card opens into the page and closes back into itself. Browsers
   without cross-document view transitions just change pages. Still for
   anyone who asked for less motion. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 140ms ease-in both page-out; }
::view-transition-new(root) { animation: 260ms cubic-bezier(.2, .8, .2, 1) 60ms both page-in; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
::view-transition-group(wattage), ::view-transition-group(in-app) { animation-duration: .45s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(wattage), ::view-transition-new(wattage),
::view-transition-old(in-app), ::view-transition-new(in-app) { height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
