/* ---------------------------------------------------------
   Brandon Clapp — personal site
   Simple single-column layout. Slate palette + indigo
   accent. Light theme by default, dark theme follows
   system preference.
--------------------------------------------------------- */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-tint: #eef2ff;
  --accent-contrast: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --radius-sm: 8px;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --surface: #131826;
    --text: #e7ebf3;
    --text-muted: #8994a8;
    --border: #232a3a;
    --accent: #818cf8;
    --accent-strong: #a5b0fb;
    --accent-tint: #1a2036;
    --accent-contrast: #0b0f19;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

a {
  color: inherit;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 3rem;
}

/* ---------- MySpace mode toggle ---------- */

.myspace-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #818cf8, #4f46e5 55%, #3730a3);
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  z-index: 10;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  animation: myspace-toggle-pulse 2.4s ease-in-out infinite;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.myspace-toggle:hover,
.myspace-toggle:focus-visible {
  transform: scale(1.12) rotate(-3deg);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6), 0 0 0 6px rgba(129, 140, 248, 0.25);
  animation-play-state: paused;
}

.myspace-toggle:active {
  transform: scale(0.94) rotate(0deg);
  box-shadow: 0 2px 8px rgba(67, 56, 202, 0.5);
}

.myspace-toggle:focus-visible {
  outline: 2px solid #a5b0fb;
  outline-offset: 3px;
}

@keyframes myspace-toggle-pulse {
  0%,
  100% {
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45), 0 0 0 0 rgba(129, 140, 248, 0.35);
  }
  50% {
    box-shadow: 0 4px 18px rgba(79, 70, 229, 0.55), 0 0 0 8px rgba(129, 140, 248, 0);
  }
}

@media (prefers-color-scheme: dark) {
  .myspace-toggle {
    box-shadow: 0 4px 16px rgba(129, 140, 248, 0.5);
  }
}

/* ---------- Hero ---------- */

.hero {
  margin-bottom: 2.5rem;
}

.hero__avatar {
  width: 56px;
  height: 56px;
  margin: 0 0 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  object-fit: cover;
  display: block;
}

.hero__eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__name {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  margin: 0 0 0.5rem;
}

.hero__tagline {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0 0 1.5rem;
}

.hero__links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero__links a {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.hero__links a:hover,
.hero__links a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Content ---------- */

.content {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.intro p {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0;
}

.intro p + p {
  margin-top: 1rem;
}

.intro a,
.text-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.intro a:hover,
.intro a:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  text-decoration: underline;
}

.section__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.section__text {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 1rem;
}

.section__text:last-child {
  margin-bottom: 0;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
}

.link-btn:hover,
.link-btn:focus-visible {
  text-decoration: underline;
}

.link-btn:disabled {
  opacity: 0.5;
  cursor: default;
  text-decoration: none;
}

/* ---------- Photography ---------- */

.photo-masonry {
  column-count: 3;
  column-gap: 1rem;
  margin: 1.25rem 0 0.75rem;
}

.photo-tile {
  break-inside: avoid;
  display: block;
  width: 100%;
  margin-bottom: 1rem;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.photo-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.photo-tile a {
  display: block;
  width: 100%;
  height: 100%;
}

.photo-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-tile--tall {
  aspect-ratio: 3 / 4;
}

.photo-tile--wide {
  aspect-ratio: 4 / 3;
}

.photo-tile--square {
  aspect-ratio: 1 / 1;
}

.photo-tile.is-hidden {
  display: none;
}

/* ---------- Projects ---------- */

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.project {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.project:first-child {
  padding-top: 0;
}

.project:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.project__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.project__name {
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}

.project__name:hover,
.project__name:focus-visible {
  color: var(--accent);
}

.project__desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.project__tags {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------- Contact form ---------- */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-form__label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.contact-form__input {
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  transition: border-color 0.15s ease;
}

.contact-form__input:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form__textarea {
  resize: vertical;
  min-height: 6rem;
}

.contact-form__submit {
  align-self: flex-start;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-contrast);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.contact-form__submit:hover,
.contact-form__submit:focus-visible {
  background: var(--accent-strong);
}

.contact-form__submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.contact-form__status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.contact-form__status.is-success {
  color: var(--accent);
}

.contact-form__status.is-error {
  color: #dc2626;
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 2.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
  .photo-masonry {
    column-count: 2;
    column-gap: 0.75rem;
  }

  .photo-tile {
    margin-bottom: 0.75rem;
  }
}

@media (max-width: 420px) {
  .project__row {
    flex-direction: column;
    gap: 0.15rem;
  }
}
