/* Styles for RyanRanksStuff.org
   Phase 5 design pass: cleaner and calmer. Mostly white, one lavender
   accent, flat cards with thin borders, and plenty of breathing room.
   The three client project cards keep their clients' colors. */

/* 1. COLORS, SHADOWS, SIZES
   Custom properties (the --names) are saved values. Change one here and
   it changes everywhere it is used. */
:root {
  --page-bg: #ffffff;
  --soft-bg: #f6f2fd;        /* very light lavender, for every other section */
  --hero-bg: #efe8fc;        /* the lavender behind the intro */
  --card-bg: #ffffff;
  --line: #e1d8f4;           /* thin borders */
  --lavender: #d8c8f7;
  --lavender-line: #b9a2ec;
  --text: #1f1a33;
  --text-soft: #5a5373;
  --link: #4a2ba6;
  --accent: #7c55d9;

  --night: #1d1238;          /* deep purple, used only for the contact band and footer */
  --on-night: #f1eaff;
  --on-night-soft: #cbbbf2;

  --radius: 12px;
  --shadow-1: 0 1px 2px rgba(40, 20, 90, 0.06);
  --shadow-2: 0 2px 4px rgba(40, 20, 90, 0.06), 0 8px 24px rgba(40, 20, 90, 0.08);
}

/* 2. BASE */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

h1, h2, h3, h4 {
  line-height: 1.15;
  margin: 0 0 0.75rem;
  letter-spacing: -0.015em;
}

/* clamp(smallest, ideal, biggest): text grows with the screen, within limits */
h2 { font-size: clamp(1.85rem, 3vw + 1rem, 2.75rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 750; }
h4 { font-size: 1rem; }

/* A short lavender bar under every section title. It is the one
   repeating detail that ties the sections together. */
h2::after {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  margin-top: 0.75rem;
  background: var(--accent);
  border-radius: 2px;
}

p { margin: 0 0 1rem; }

a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* .wrap is the centered content box used inside every section.
   It is as wide as the screen minus side gaps, up to 70rem. */
.wrap {
  width: min(100% - 2.5rem, 70rem);
  margin-inline: auto;
}

section {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
  scroll-margin-top: 4.5rem;
}

.section-intro {
  max-width: 40rem;
  margin-top: 1.25rem;
  color: var(--text-soft);
  font-size: 1.15rem;
}

/* 3. HEADER (stays at the top while you scroll): white with a thin line */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 0.75rem 0;
}

.site-name {
  margin: 0;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

nav a {
  display: inline-block;
  padding: 0.35rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

nav a:hover {
  color: var(--link);
  border-bottom-color: var(--accent);
}

/* 4. HERO: flat lavender, big name, and a row of proof numbers underneath */
.hero {
  background: var(--hero-bg);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  gap: 3rem;
}

/* The small label above the name */
.tagline {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--link);
}

h1 {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.lead {
  font-size: clamp(1.3rem, 2vw + 0.8rem, 1.85rem);
  line-height: 1.35;
  font-weight: 650;
  color: var(--text);
}

.hero-copy p {
  max-width: 40rem;
}

/* The motto: still easy to spot, just calmer */
.motto-block {
  margin: 2rem 0 0 !important;
  padding-left: 1.25rem;
  border-left: 4px solid var(--accent);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.motto-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-soft);
}

.motto {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--link);
}

/* The portrait: a photo in a thin rounded frame (used in About) */
.portrait {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;          /* rounds the photo's corners too */
  box-shadow: var(--shadow-2);
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 50% 15%;  /* keeps the face near the top of the crop */
}

/* The proof row: four big numbers with a line above. No boxes. */
.stats {
  margin: 0;
  padding-top: 2rem;
  border-top: 1px solid var(--lavender-line);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem 1.5rem;
}

.stat {
  display: flex;
  flex-direction: column-reverse;   /* number on top, label below */
  justify-content: flex-end;
  gap: 0.35rem;
}

.stat dd {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--link);
}

.stat dt {
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--text-soft);
}

/* 5. PROJECTS: each project card wears its client's colors */
.projects {
  background: var(--page-bg);
}

.project-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2.5rem;
  align-items: start;        /* an open card does not stretch its neighbors */
}

/* Each theme borrows one client's colors (matched by eye from their sites).
   --brand  : the colored band and outline
   --label  : the small label color on the band
   --accent : the stripe color
   --tint   : the light background behind the big numbers
   --ink    : the color of the big numbers and the button text */
.theme-procore { --brand: #a81b30; --label: #ffd5db; --accent: #c9ccd1; --tint: #fbeaed; --ink: #a81b30; }
.theme-dandi   { --brand: #2d3034; --label: #f9b60d; --accent: #f9b60d; --tint: #fff4d6; --ink: #2d3034; }
.theme-htp     { --brand: #165a2c; --label: #e8ce30; --accent: #e8ce30; --tint: #ecf6e6; --ink: #165a2c; }

.project {
  background: var(--card-bg);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;          /* keeps the colored top inside the rounded corners */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

@media (prefers-reduced-motion: reduce) {
  .project { transition: none; }
  .project:hover { transform: none; }
}

.project-top {
  background: var(--brand);
  color: #ffffff;
  padding: 1.5rem 1.5rem 1.25rem;
}

.project-type {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--label);
}

.project-top h3 {
  font-size: 1.4rem;
  color: #ffffff;
}

.teaser {
  margin: 0 0 0.75rem;
  color: #ffffff;
}

.project-meta {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--label);
  font-weight: 700;
}

/* The "Visit" link: a white outlined pill on the colored band */
.visit-link {
  display: inline-block;
  padding: 0.45rem 1rem;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid #ffffff;
  border-radius: 999px;
}

.visit-link:hover {
  background: #ffffff;
  color: var(--brand);
}

.visit-link:focus-visible {
  outline-color: #ffffff;
}

/* Text for screen readers only: visually hidden but still read aloud */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The big numbers you see before opening the card */
.factoids {
  list-style: none;
  margin: 0;
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  background: var(--tint);
  border-top: 4px solid var(--accent);
}

.factoids li {
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--text);
}

.factoids strong {
  display: block;
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  line-height: 1.1;
  color: var(--ink);
}

/* The "See the full story" button and the text it reveals */
details {
  padding: 0 1.5rem 1.5rem;
}

summary {
  cursor: pointer;
  list-style: none;          /* hide the default arrow */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 0.7rem 1rem;
  font-weight: 700;
  color: var(--ink);
  border: 1px solid var(--brand);
  border-radius: 999px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 1.4rem;
  line-height: 1;
}

details[open] summary::after {
  content: "\2212";          /* a minus sign */
}

summary:hover {
  background: var(--tint);
}

.details-body {
  padding-top: 1.25rem;
}

.lesson {
  border-left: 3px solid var(--brand);
  padding-left: 1rem;
  color: var(--text-soft);
}

.more-list {
  margin: 0;
  padding-left: 1.25rem;
}

/* 5b. SIDE PROJECTS: light cards with a status tag */
.side-projects {
  background: var(--soft-bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.lab-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2.5rem;
  align-items: start;
}

.lab-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 1.5rem;
}

/* The "TBD" card gets a dashed outline, like a spot waiting to be filled */
.lab-card-tbd {
  border-style: dashed;
  border-color: var(--lavender-line);
  background: transparent;
  box-shadow: none;
}

.lab-card p:last-child {
  margin-bottom: 0;
}

.lab-note {
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* The Job Search Depot card is wider: words on one side, a picture on the other */
.lab-card-feature {
  display: grid;
  gap: 1.5rem;
}

.lab-figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-2);
}

.lab-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.status {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-live     { background: #dff3e6; color: #1b5e38; }
.status-progress { background: #fdecc8; color: #7a4a00; }
.status-tbd      { background: #e9e4f5; color: #4a3d78; }

/* 6. SKILLS: white background, two plain cards, chips for each skill */
.skills {
  background: var(--page-bg);
}

.bento {
  display: grid;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.bento-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 1.5rem;
}

.bento-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bento-card li {
  background: var(--soft-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.95rem;
}

/* 6b. ABOUT: photo on one side, words on the other */
.about {
  background: var(--soft-bg);
  border-top: 1px solid var(--line);
}

.about-grid {
  display: grid;
  gap: 2rem;
  align-items: start;        /* photo lines up with the top of the words */
}

.about .portrait {
  max-width: 15rem;          /* about 240px: a small, friendly photo */
}

.about-copy p {
  max-width: 38rem;
}

.about-copy h2 + p {
  margin-top: 1.25rem;
}

/* 7. CONTACT: one deep purple band with big buttons, the closing call to action */
.contact {
  background: var(--night);
  color: var(--on-night);
  text-align: center;
}

.contact h2::after {
  margin-inline: auto;
  background: var(--lavender-line);
}

.contact .section-intro {
  margin-inline: auto;
  color: var(--on-night-soft);
}

.contact-links {
  list-style: none;
  margin: 1.75rem 0 1.25rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.button {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  background: #ffffff;
  color: var(--night);
  font-weight: 700;
  text-decoration: none;
  border: 2px solid #ffffff;
  border-radius: 999px;
  overflow-wrap: anywhere;
}

.button:hover {
  background: var(--lavender);
  border-color: var(--lavender);
}

.button-ghost {
  background: transparent;
  color: #ffffff;
  border-color: var(--lavender-line);
}

.button-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #ffffff;
}

.contact a:focus-visible {
  outline-color: #ffffff;
}

.location {
  margin: 0;
  color: var(--on-night-soft);
}

/* 8. FOOTER */
footer {
  background: var(--night);
  color: var(--on-night-soft);
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

footer p { margin: 0; }

/* 9. THE LAYOUT CHANGES WITH THE SCREEN SIZE
   Everything above is the phone layout. Each block below adds to it
   once the screen is at least that wide. */

/* Tablets: 40rem is about 640px */
@media (min-width: 40rem) {
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .bento {
    grid-template-columns: 1.4fr 1fr;
  }
}

/* Side projects: the wide Job Search Depot card on top, the other two below it */
@media (min-width: 48rem) {
  .lab-card-feature {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
    gap: 2rem;
  }

  .about-grid {
    grid-template-columns: 15rem 1fr;
    gap: 3rem;
  }
}

/* Laptops and desktops: 64rem is about 1024px */
@media (min-width: 64rem) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);  /* three panels side by side */
  }

  .lab-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lab-card-feature {
    grid-column: 1 / -1;     /* spans both columns */
  }

  .bento-card {
    padding: 2rem;
  }
}

/* Big monitors: 90rem is about 1440px. Everything sized in rem grows. */
@media (min-width: 90rem) {
  html {
    font-size: 112.5%;
  }

  .wrap {
    width: min(100% - 4rem, 76rem);
  }
}
