/* ============================================================
   Arthur S. — Personal Site
   Design: Premium literary magazine meets tech consultancy
   ============================================================ */

/* --- Variables --- */
:root {
  --cream: #F5F3EE;
  --cream-dark: #EDE9E1;
  --blue: #2B4C7E;
  --blue-light: #3D6499;
  --pink: #C4687A;
  --pink-light: #D4849A;
  --charcoal: #1A1A2E;
  --gray: #6B6B7B;
  --gray-light: #A8A8B5;
  --white: #FAFAF8;

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --max-w: 1120px;
  --nav-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 3px rgba(26,26,46,0.06), 0 1px 2px rgba(26,26,46,0.04);
  --shadow-md: 0 4px 16px rgba(26,26,46,0.08), 0 2px 6px rgba(26,26,46,0.04);
  --shadow-lg: 0 12px 40px rgba(26,26,46,0.12), 0 4px 16px rgba(26,26,46,0.06);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* --- Typography scale --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.2;
  font-weight: 500;
}

h1 { font-size: clamp(3.5rem, 8vw, 7rem); font-weight: 400; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 500; }

p { color: var(--gray); font-size: 1rem; line-height: 1.8; }

/* --- Layout --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 120px 0;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  transition: background var(--transition), box-shadow var(--transition);
}

.nav.scrolled {
  background: rgba(245, 243, 238, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(26,26,46,0.08);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--charcoal);
  letter-spacing: 0.05em;
  transition: color var(--transition);
}
.nav-logo:hover { color: var(--blue); }

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray);
  letter-spacing: 0.02em;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--blue);
  transition: width var(--transition);
}

.nav-links a:hover { color: var(--charcoal); }
.nav-links a:hover::after { width: 100%; }

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--cream);
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: orb-float 12s ease-in-out infinite alternate;
}

.hero-orb--blue {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--blue) 0%, transparent 70%);
  top: -100px; left: -150px;
  animation-delay: 0s;
}

.hero-orb--pink {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--pink) 0%, transparent 70%);
  bottom: -80px; right: -100px;
  animation-delay: -6s;
  animation-duration: 15s;
}

@keyframes orb-float {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(40px, -30px) scale(1.05); }
  66%  { transform: translate(-20px, 20px) scale(0.97); }
  100% { transform: translate(30px, -10px) scale(1.03); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 1.5rem;
  max-width: 900px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray-light);
  margin-bottom: 1.5rem;
}

.hero-name {
  color: var(--charcoal);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
  color: var(--gray);
  letter-spacing: 0.05em;
  margin-bottom: 2.5rem;
}

.hero-motto {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-style: italic;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--gray-light);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--gray-light), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.1); }
}

/* --- Fade-in animations --- */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fade-in-up 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }

@keyframes fade-in-up {
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }

/* --- Section labels --- */
.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.75rem;
}

.section-header {
  margin-bottom: 4rem;
}

.section-header h2 {
  color: var(--charcoal);
}

/* --- About --- */
.about {
  background: var(--white);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}

.about-text h2 {
  margin-bottom: 2rem;
  color: var(--charcoal);
}

.about-text p {
  margin-bottom: 1.25rem;
}

.about-text p:last-child { margin-bottom: 0; }

/* CSS Art */
.about-art {
  display: flex;
  align-items: center;
  justify-content: center;
}

.css-art {
  position: relative;
  width: 100%;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.art-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  animation: ring-rotate linear infinite;
}

.art-ring--outer {
  width: 260px; height: 260px;
  border-color: rgba(43, 76, 126, 0.12);
  animation-duration: 30s;
}

.art-ring--mid {
  width: 180px; height: 180px;
  border-color: rgba(196, 104, 122, 0.15);
  animation-duration: 20s;
  animation-direction: reverse;
  border-style: dashed;
}

.art-ring--inner {
  width: 100px; height: 100px;
  border-color: rgba(43, 76, 126, 0.2);
  animation-duration: 14s;
  background: radial-gradient(circle at 40% 40%,
    rgba(43,76,126,0.08), rgba(196,104,122,0.05) 60%, transparent);
}

.art-dot {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 0 20px rgba(43, 76, 126, 0.3);
}

@keyframes ring-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* --- Services --- */
.services {
  background: var(--cream);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.service-card {
  background: var(--white);
  border: 1px solid rgba(26,26,46,0.06);
  border-radius: var(--radius);
  padding: 2rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: default;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(43,76,126,0.12);
}

.service-icon {
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
  display: block;
  line-height: 1;
}

.service-card h3 {
  color: var(--charcoal);
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.service-card p {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- Thoughts --- */
.thoughts {
  background: var(--cream-dark);
}

.thoughts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  align-items: start;
}

.thought-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem;
  border: 1px solid rgba(26,26,46,0.06);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.thought-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--pink));
  opacity: 0;
  transition: opacity var(--transition);
}

.thought-card:hover::before { opacity: 1; }

.thought-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.thought-card--elevated {
  margin-top: 2.5rem;
}

.thought-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--gray-light);
  margin-bottom: 1.25rem;
}

.thought-card h3 {
  color: var(--charcoal);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.thought-card p {
  font-size: 0.95rem;
  line-height: 1.75;
}

/* --- Blog --- */
.blog {
  background: var(--white);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.blog-card {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 2.5rem;
  border: 1px solid rgba(26,26,46,0.06);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.blog-meta time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray-light);
  letter-spacing: 0.05em;
}

.blog-tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(43,76,126,0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.blog-card h3 {
  color: var(--charcoal);
  margin-bottom: 0.875rem;
  font-size: 1.2rem;
  line-height: 1.35;
}

.blog-card p {
  font-size: 0.93rem;
  margin-bottom: 1.5rem;
  line-height: 1.75;
}

.blog-read-more {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--blue);
  letter-spacing: 0.02em;
  transition: color var(--transition);
}

.blog-card:hover .blog-read-more {
  color: var(--pink);
}

.blog-more {
  text-align: center;
  font-style: italic;
  color: var(--gray-light);
  font-size: 0.9rem;
}

/* --- Tools --- */
.tools {
  background: var(--cream);
}

.tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tool-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray);
  background: var(--white);
  border: 1px solid rgba(26,26,46,0.08);
  border-radius: 100px;
  padding: 0.4rem 1rem;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  cursor: default;
}

.tool-badge:hover {
  color: var(--blue);
  border-color: rgba(43,76,126,0.25);
  background: rgba(43,76,126,0.04);
}

/* --- Footer --- */
.footer {
  background: var(--charcoal);
  padding: 5rem 0 3.5rem;
  text-align: center;
}

.footer-motto {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: rgba(245,243,238,0.5);
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.footer-copy {
  color: rgba(245,243,238,0.7);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.footer-note {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: rgba(245,243,238,0.25);
  text-transform: uppercase;
}

/* --- Mobile --- */
@media (max-width: 900px) {
  .section { padding: 80px 0; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .about-art { order: -1; }
  .css-art { width: 200px; height: 200px; }
  .art-ring--outer { width: 188px; height: 188px; }
  .art-ring--mid   { width: 130px; height: 130px; }
  .art-ring--inner { width: 72px;  height: 72px; }

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

  .thoughts-grid {
    grid-template-columns: 1fr;
  }
  .thought-card--elevated { margin-top: 0; }

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

@media (max-width: 600px) {
  :root { --nav-h: 56px; }

  .nav-links {
    gap: 1.25rem;
  }
  .nav-links a { font-size: 0.8rem; }

  .hero-content { padding: 0 1rem; }

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

  .container { padding: 0 1.25rem; }

  .section { padding: 64px 0; }
}


/* --- Hamburger toggle --- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 350;
  position: relative;
}

.nav-toggle__line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--charcoal);
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-radius: 2px;
}

.nav-toggle.active .nav-toggle__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active .nav-toggle__line:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active .nav-toggle__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- AI note in about --- */
.about-ai-note {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(43, 76, 126, 0.04);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--gray);
}

.about-ai-note em {
  color: var(--blue);
  font-weight: 500;
}

/* --- Mobile menu overlay --- */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 300;
    display: flex !important;
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    font-size: 1.5rem;
    display: block;
    padding: 1rem 0;
    color: var(--charcoal);
    width: 100%;
  }

  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 250;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 400px) {
  .nav-links { display: flex !important; }
}

/* ============================================================
   Activity Feed
   ============================================================ */
.activity { background: var(--bg-alt, #f8f7f4); }

.activity-status {
  display: inline-block;
  font-size: 0.45em;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 12px;
  letter-spacing: 0.03em;
  font-family: var(--ff-body, "Inter", sans-serif);
}
.activity-status--active {
  background: rgba(34,197,94,0.12);
  color: #16a34a;
}
.activity-status--offline {
  background: rgba(148,163,184,0.12);
  color: #94a3b8;
}

.activity-timestamp {
  font-size: 0.8rem;
  color: var(--muted, #64748b);
  margin-top: 4px;
}

.activity-feed {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: grid;
  grid-template-columns: 56px 32px 1fr;
  align-items: start;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.activity-item.visible {
  opacity: 1;
  transform: translateY(0);
}
.activity-item:last-child { border-bottom: none; }

.activity-time {
  font-family: var(--ff-mono, "JetBrains Mono", monospace);
  font-size: 0.8rem;
  color: var(--muted, #64748b);
  padding-top: 2px;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(99,102,241,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6366f1;
  flex-shrink: 0;
}

.activity-title {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text, #1e293b);
}

.activity-detail {
  font-size: 0.82rem;
  color: var(--muted, #64748b);
  margin-top: 2px;
  line-height: 1.5;
}

.activity-empty {
  text-align: center;
  color: var(--muted, #64748b);
  padding: 40px 0;
  font-style: italic;
}

@media (max-width: 600px) {
  .activity-item {
    grid-template-columns: 44px 28px 1fr;
    gap: 8px;
    padding: 12px 0;
  }
  .activity-time { font-size: 0.72rem; }
  .activity-title { font-size: 0.88rem; }
}
