/* ============================================================
   Stuart Dalrymple — studalrymple.com
   Design: Editorial dark · Playfair Display + DM Sans
   ============================================================ */

/* --- Reset & base ------------------------------------------ */

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

html {
  scroll-behavior: smooth;
}

body {
  background: #0B1120;
  color: #E8E4DC;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- Navigation -------------------------------------------- */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2.5rem;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0B1120;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #E8E4DC;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  font-size: 13px;
  color: rgba(232, 228, 220, 0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links a {
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #5EC4A3;
}

/* Mobile hamburger (hidden on desktop) */
.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: rgba(232, 228, 220, 0.6);
  transition: background 0.2s;
}

.nav-mobile-drawer {
  display: none;
  flex-direction: column;
  background: #0d1628;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 2.5rem;
}

.nav-mobile-drawer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nav-mobile-drawer a {
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(232, 228, 220, 0.6);
  transition: color 0.2s;
}

.nav-mobile-drawer a:hover {
  color: #5EC4A3;
}

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

.hero {
  padding: 5.5rem 2.5rem 4.5rem;
  max-width: 860px;
}

.fade-in {
  animation: fadeUp 0.75s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-tag {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5EC4A3;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-tag::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: #5EC4A3;
  flex-shrink: 0;
}

.hero-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(44px, 7vw, 72px);
  font-weight: 400;
  line-height: 1.05;
  color: #F2EEE5;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.hero-line {
  font-size: 18px;
  color: rgba(232, 228, 220, 0.55);
  font-weight: 300;
  max-width: 520px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero-line em {
  color: #E8E4DC;
  font-style: normal;
  font-weight: 400;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  background: #5EC4A3;
  color: #0B1120;
  border: none;
  padding: 0.65rem 1.5rem;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover {
  background: #4fb393;
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-block;
  background: transparent;
  color: rgba(232, 228, 220, 0.6);
  border: 0.5px solid rgba(232, 228, 220, 0.2);
  padding: 0.65rem 1.5rem;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  border-radius: 3px;
  letter-spacing: 0.04em;
  transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover {
  color: #E8E4DC;
  border-color: rgba(232, 228, 220, 0.4);
}

/* --- Brand pillars ----------------------------------------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 0.5px solid rgba(255, 255, 255, 0.07);
}

.pillar {
  padding: 2.25rem 2.5rem;
  border-right: 0.5px solid rgba(255, 255, 255, 0.07);
}

.pillar:last-child {
  border-right: none;
}

.pillar-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5EC4A3;
  margin-bottom: 0.5rem;
}

.pillar-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 500;
  color: #F2EEE5;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.pillar-desc {
  font-size: 13px;
  color: rgba(232, 228, 220, 0.45);
  line-height: 1.65;
}

/* --- Sections (shared) ------------------------------------- */

.section {
  padding: 3.5rem 2.5rem;
  border-top: 0.5px solid rgba(255, 255, 255, 0.07);
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232, 228, 220, 0.35);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background: rgba(255, 255, 255, 0.08);
}

/* --- Selected Work grid ------------------------------------ */

.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.07);
  border: 0.5px solid rgba(255, 255, 255, 0.07);
}

.app-card {
  display: block;
  background: #0B1120;
  padding: 2rem;
  position: relative;
  transition: background 0.2s;
}

.app-card:hover {
  background: #0f1929;
}

.app-card.featured {
  background: #111A2E;
  grid-column: span 2;
}

.app-card.featured:hover {
  background: #131f36;
}

.app-arrow {
  position: absolute;
  top: 1.75rem;
  right: 1.75rem;
  color: rgba(232, 228, 220, 0.2);
  font-size: 18px;
  transition: color 0.2s;
}

.app-card:hover .app-arrow {
  color: #5EC4A3;
}

.app-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5EC4A3;
  border: 0.5px solid rgba(94, 196, 163, 0.3);
  padding: 2px 8px;
  border-radius: 2px;
  margin-bottom: 1rem;
}

.app-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: #F2EEE5;
  margin-bottom: 0.5rem;
}

.app-desc {
  font-size: 13px;
  color: rgba(232, 228, 220, 0.45);
  line-height: 1.65;
  max-width: 400px;
}

.app-link-note {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 228, 220, 0.2);
  margin-top: 1rem;
}

/* --- Writing ----------------------------------------------- */

.writing-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-btn {
  background: transparent;
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  color: rgba(232, 228, 220, 0.4);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  color: #5EC4A3;
  border-color: rgba(94, 196, 163, 0.4);
}

.writing-list {
  display: flex;
  flex-direction: column;
}

.article-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.1rem 0;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.07);
  gap: 1.5rem;
  transition: opacity 0.2s;
}

.article-row:first-of-type {
  border-top: 0.5px solid rgba(255, 255, 255, 0.07);
}

.article-row:hover .article-title {
  color: #5EC4A3;
}

.article-title {
  font-size: 15px;
  color: #E8E4DC;
  flex: 1;
  transition: color 0.2s;
}

.article-tags {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.tag {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 228, 220, 0.4);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 2px;
}

.article-date {
  font-size: 12px;
  color: rgba(232, 228, 220, 0.25);
  flex-shrink: 0;
  min-width: 72px;
  text-align: right;
}

/* --- Longer form ------------------------------------------- */

.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.07);
  border: 0.5px solid rgba(255, 255, 255, 0.07);
}

.work-card {
  background: #0B1120;
  padding: 2.25rem 2rem;
  transition: background 0.2s;
}

.work-card:hover {
  background: #0f1929;
}

.work-type {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232, 228, 220, 0.3);
  margin-bottom: 0.75rem;
}

.work-title {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  color: #F2EEE5;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.work-desc {
  font-size: 13px;
  color: rgba(232, 228, 220, 0.4);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.work-link {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5EC4A3;
  transition: opacity 0.2s;
}

.work-link:hover {
  opacity: 0.75;
}

/* --- Press & features -------------------------------------- */

.press-grid {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.press-tile {
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  padding: 0.8rem 1.4rem;
  border-radius: 3px;
  font-size: 13px;
  color: rgba(232, 228, 220, 0.5);
  letter-spacing: 0.02em;
  transition: border-color 0.2s, color 0.2s;
}

.press-tile:hover {
  border-color: rgba(94, 196, 163, 0.3);
  color: rgba(232, 228, 220, 0.75);
}

/* --- About + Contact --------------------------------------- */

.about-section {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 5rem;
  align-items: start;
}

.about-bio {
  font-size: 15px;
  color: rgba(232, 228, 220, 0.65);
  line-height: 1.85;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.about-bio strong {
  color: #E8E4DC;
  font-weight: 500;
}

.contact-block {
  border-top: 0.5px solid rgba(255, 255, 255, 0.07);
  padding-top: 2rem;
  margin-top: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232, 228, 220, 0.3);
  margin-bottom: 0.4rem;
}

.contact-link {
  font-size: 15px;
  color: #5EC4A3;
  transition: opacity 0.2s;
}

.contact-link:hover {
  opacity: 0.75;
}

.contact-link--secondary {
  font-size: 13px;
  color: rgba(94, 196, 163, 0.6);
}

/* --- Stats ------------------------------------------------- */

.stats-row {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 38px;
  color: #F2EEE5;
  font-weight: 400;
  min-width: 76px;
  flex-shrink: 0;
}

.stat-desc {
  font-size: 13px;
  color: rgba(232, 228, 220, 0.4);
  line-height: 1.55;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: 1.1rem;
}

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

.footer {
  padding: 1.5rem 2.5rem;
  border-top: 0.5px solid rgba(255, 255, 255, 0.07);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(232, 228, 220, 0.2);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet: ≤ 900px */
@media (max-width: 900px) {
  .pillars {
    grid-template-columns: repeat(2, 1fr);
  }

  .pillar:nth-child(2) {
    border-right: none;
  }

  .pillar:nth-child(1),
  .pillar:nth-child(2) {
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.07);
  }

  .apps-grid {
    grid-template-columns: 1fr 1fr;
  }

  .app-card.featured {
    grid-column: span 2;
  }

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

/* Mobile: ≤ 600px */
@media (max-width: 600px) {
  .nav {
    padding: 1rem 1.25rem;
  }

  .nav-links {
    display: none;
  }

  .nav-mobile-toggle {
    display: flex;
  }

  .nav-mobile-drawer.open {
    display: flex;
  }

  .hero {
    padding: 3.5rem 1.25rem 3rem;
  }

  .hero-line {
    font-size: 16px;
  }

  .pillars {
    grid-template-columns: 1fr;
  }

  .pillar {
    border-right: none;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.07);
  }

  .pillar:last-child {
    border-bottom: none;
  }

  .section {
    padding: 2.5rem 1.25rem;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }

  .app-card.featured {
    grid-column: span 1;
  }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .article-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .article-date {
    min-width: auto;
  }

  .about-section {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .stat-num {
    font-size: 30px;
    min-width: 60px;
  }

  .footer {
    padding: 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}
