/* Styles for RyanRanksStuff.org
   Phase 3, step 2: bold hero, themed project panels, and a layout that
   changes with the screen size. */

/* 1. COLORS, SHADOWS, SIZES
   Custom properties (the --names) are saved values. Change one here and
   it changes everywhere it is used. */
:root {
  --page-bg: #f8f5fe;
  --card-bg: #ffffff;
  --lavender: #d8c8f7;
  --lavender-line: #b9a2ec;
  --text: #2b2540;
  --text-soft: #5a5373;
  --link: #4a2ba6;
  --accent: #7c55d9;

  --night: #1d1238;          /* deep purple for the hero and footer */
  --night-2: #2c1b57;        /* a lighter deep purple for the skills band */
  --on-night: #f1eaff;       /* text on deep purple */
  --on-night-soft: #cbbbf2;  /* quieter text on deep purple */

  --radius: 16px;
  --shadow-1: 0 1px 2px rgba(60, 35, 120, 0.12), 0 2px 6px rgba(60, 35, 120, 0.08);
  --shadow-2: 0 2px 4px rgba(60, 35, 120, 0.10), 0 8px 20px rgba(60, 35, 120, 0.12);
  --shadow-3: 0 4px 8px rgba(60, 35, 120, 0.10), 0 18px 40px rgba(60, 35, 120, 0.20);
}

/* 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;
}

/* clamp(smallest, ideal, biggest): text grows with the screen, within limits */
h2 { font-size: clamp(2rem, 4vw + 1rem, 3rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1rem; }

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 72rem. */
.wrap {
  width: min(100% - 2.5rem, 72rem);
  margin-inline: auto;
}

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

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

/* 3. HEADER (stays at the top while you scroll) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--lavender);
  border-bottom: 2px solid var(--lavender-line);
  box-shadow: var(--shadow-2);
}

.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.2rem;
}

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-weight: 700;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
}

/* 4. HERO: deep purple band with glowing color blobs */
.hero {
  background:
    radial-gradient(circle at 15% 20%, rgba(124, 85, 217, 0.55), transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(179, 140, 255, 0.35), transparent 45%),
    var(--night);
  color: var(--on-night);
  position: relative;
  overflow: hidden;
}

/* A faint grid of lines on top of the glow */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.hero-grid {
  position: relative;        /* sits above the grid lines */
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.tagline {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

h1 {
  font-size: clamp(3.25rem, 10vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: #ffffff;
}

.lead {
  font-size: clamp(1.25rem, 2vw + 0.75rem, 1.75rem);
  line-height: 1.4;
  font-weight: 600;
  color: #ffffff;
}

.hero p {
  max-width: 38rem;
}

/* The motto: big, glowing, hard to miss */
.motto-block {
  margin: 2rem 0 1.25rem !important;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.motto-label {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--on-night-soft);
}

.motto {
  font-size: clamp(2.25rem, 7vw, 4.25rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #e4d6ff;            /* used if the gradient below is not supported */
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .motto {
    background: linear-gradient(90deg, #ffffff, #d8c8f7 45%, #a98bff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.outside-work {
  color: var(--on-night-soft);
}

/* The portrait: a photo in a rounded, outlined frame (used in About) */
.portrait {
  margin: 0;
  border: 3px solid var(--lavender-line);
  border-radius: calc(var(--radius) + 8px);
  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 */
}

/* Stat cards: frosted-glass boxes with big numbers */
.stats {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat {
  display: flex;
  flex-direction: column-reverse;   /* number on top, label below */
  justify-content: flex-end;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(10, 4, 30, 0.35);
}

.stat dd {
  margin: 0;
  font-size: clamp(2.75rem, 7vw, 4.25rem);
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
}

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

/* 5. PROJECTS: each project is a panel with its own color */
.projects {
  background: #efe8fc;
}

.project-grid {
  display: grid;
  gap: 1.75rem;
  margin-top: 2.25rem;
  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 big 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: 2px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  overflow: hidden;          /* keeps the colored top inside the rounded corners */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

@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.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--label);
}

.project-top h3 {
  font-size: 1.5rem;
  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: 800;
  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: 5px 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: 800;
  color: var(--ink);
  border: 2px 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: 4px solid var(--brand);
  padding-left: 1rem;
  color: var(--text-soft);
}

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

/* 5b. SIDE PROJECTS: lighter cards with a status tag */
.side-projects {
  background: var(--page-bg);
}

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

.lab-card {
  background: var(--card-bg);
  border: 2px solid var(--lavender-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;
  background: transparent;
  box-shadow: none;
}

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

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

.status {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  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: a "bento box" of cards on a deep purple band */
.skills {
  background: linear-gradient(160deg, var(--night-2), var(--night));
  color: var(--on-night);
}

.skills .section-intro {
  color: var(--on-night-soft);
}

.bento {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.25rem;
}

.bento-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.bento-card h3 {
  color: #ffffff;
}

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

.bento-card li {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  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(--page-bg);
}

.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;
}

/* 7. CONTACT: a bright lavender band with big buttons */
.contact {
  background: linear-gradient(135deg, #e4d6ff, #cdb7fa);
  text-align: center;
}

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

.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: var(--link);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  border: 2px solid var(--link);
  border-radius: 999px;
  box-shadow: var(--shadow-2);
  overflow-wrap: anywhere;
}

.button:hover {
  background: #36207f;
  border-color: #36207f;
}

.button-ghost {
  background: transparent;
  color: var(--link);
  box-shadow: none;
}

.button-ghost:hover {
  background: #ffffff;
  color: #36207f;
}

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

/* 8. FOOTER */
footer {
  background: var(--night);
  color: var(--on-night-soft);
  text-align: center;
  padding: 1.5rem;
}

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) {
  .bento {
    grid-template-columns: 1.4fr 1fr;
  }
}

/* Laptops and desktops: 64rem is about 1024px */
@media (min-width: 64rem) {
  .hero-grid {
    grid-template-columns: 1.2fr 0.8fr;   /* words on the left, stats on the right */
    gap: 4rem;
  }

  .stat {
    padding: 1.75rem 1.5rem;
  }

  .project-grid {
    grid-template-columns: repeat(3, 1fr);  /* three panels side by side */
  }

  .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, 80rem);
  }
}

/* Side projects: three cards in a row on laptops and up */
@media (min-width: 64rem) {
  .lab-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* About: photo left, words right on tablets and up */
@media (min-width: 48rem) {
  .about-grid {
    grid-template-columns: 15rem 1fr;
    gap: 3rem;
  }
}
