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

/* ===== Variables — Light (default) ===== */
:root {
  --bg:          #ffffff;
  --bg-alt:      #f7f7f7;
  --bg-hover:    #f2f2f2;
  --border:      #e4e4e7;
  --text:        #111111;
  --text-muted:  #6b7280;
  --text-dim:    #9ca3af;
  --accent:      #2563eb;
  --accent-dark: #1d4ed8;
  --tag-bg:      #f4f4f5;
  --tag-text:    #52525b;
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Helvetica, Arial, sans-serif;
  --mono:        'SF Mono', 'Cascadia Code', 'Fira Code', ui-monospace, monospace;
  --max-w:       720px;
  --radius:      6px;
  --nav-bg:      rgba(255, 255, 255, 0.9);
}

/* ===== Dark mode — system preference + manual toggle ===== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0f0f10;
    --bg-alt:      #18181b;
    --bg-hover:    #222226;
    --border:      #2e2e33;
    --text:        #f0f0f0;
    --text-muted:  #9ca3af;
    --text-dim:    #6b7280;
    --accent:      #60a5fa;
    --accent-dark: #93c5fd;
    --tag-bg:      #1e1e22;
    --tag-text:    #a1a1aa;
    --nav-bg:      rgba(15, 15, 16, 0.9);
  }
}

[data-theme="dark"] {
  --bg:          #0f0f10;
  --bg-alt:      #18181b;
  --bg-hover:    #222226;
  --border:      #2e2e33;
  --text:        #f0f0f0;
  --text-muted:  #9ca3af;
  --text-dim:    #6b7280;
  --accent:      #60a5fa;
  --accent-dark: #93c5fd;
  --tag-bg:      #1e1e22;
  --tag-text:    #a1a1aa;
  --nav-bg:      rgba(15, 15, 16, 0.9);
}

/* ===== Base ===== */
html { scroll-behavior: smooth; }

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

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; color: var(--accent-dark); }

strong { font-weight: 600; }

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

section { padding: 48px 0; }
section + section { border-top: 1px solid var(--border); }

/* ===== Typography ===== */
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
h2 { font-size: 1.1rem;  font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
h3 { font-size: 0.975rem; font-weight: 600; line-height: 1.4; }

.section-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* ===== Nav ===== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

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

.nav-logo {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.nav-logo:hover { text-decoration: none; color: var(--text); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-hire {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent) !important;
}
.nav-hire:hover { color: var(--accent-dark) !important; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  width: 20px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  display: block;
}

/* ===== Theme toggle (half-circle icon) ===== */
.theme-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.15s;
  flex-shrink: 0;
}
.theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
/* Show moon in light mode, sun in dark mode */
.icon-sun  { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun  { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}


/* ===== Hero ===== */
.hero {
  padding: 56px 0 48px;
  border-top: none !important;
}

.hero-intro {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.hero h1 { margin-bottom: 14px; }

.hero-tagline {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 24px;
  line-height: 1.65;
}

.hero-hook {
  border-left: 2px solid var(--border);
  padding: 4px 0 4px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: 32px;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none !important;
  border: none;
  font-family: var(--font);
  white-space: nowrap;
}

.btn-primary {
  background: var(--text);
  color: #fff;
}
.btn-primary:hover {
  background: #333;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: #ccc;
  color: var(--text);
}

/* ===== Trust bar ===== */
.trust-bar {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.trust-item { display: flex; flex-direction: column; gap: 2px; }

.trust-number {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.trust-label {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.trust-upwork {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
}
.trust-upwork:hover .trust-number { color: var(--accent); }
.trust-upwork:hover { text-decoration: none; }

/* ===== Tag chips ===== */
.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--mono);
  font-weight: 500;
  white-space: nowrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* ===== Services ===== */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.service-item {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.service-item:first-child { border-top: 1px solid var(--border); }

.service-meta {
  text-align: right;
  padding-top: 2px;
}

.service-item h3 { margin-bottom: 6px; }

.service-item p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.service-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* ===== Featured Work ===== */
.work-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.work-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  transition: background 0.15s;
}
.work-item:first-child { border-top: 1px solid var(--border); }

.work-item-body { flex: 1; }

.work-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
  display: block;
}

.work-item h3 { margin-bottom: 6px; line-height: 1.4; }

.work-item p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 520px;
}

.work-item-link {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
  padding-top: 4px;
}
.work-item-link:hover { color: var(--accent-dark); }

/* ===== Why Me ===== */
.why-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.why-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.why-item:first-child { border-top: 1px solid var(--border); }

.why-key {
  font-weight: 600;
  color: var(--text);
  padding-top: 1px;
}

.why-val { color: var(--text-muted); line-height: 1.65; }

/* ===== Writing ===== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.post-item:first-child { border-top: 1px solid var(--border); }
.post-item:hover { background: none; }
.post-item:hover h3 { color: var(--accent); }

.post-item h3 {
  font-size: 0.9rem;
  margin-bottom: 4px;
  transition: color 0.15s;
}

.post-excerpt {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.post-meta {
  text-align: right;
  white-space: nowrap;
}

.post-tag {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--mono);
  display: block;
  margin-bottom: 4px;
}
.post-tag::before { content: '#'; }

.post-date {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.writing-footer {
  margin-top: 24px;
  font-size: 0.85rem;
}

/* ===== Writing source headers ===== */
.writing-source-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.writing-source-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.writing-source-link {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.writing-source-link:hover { color: var(--accent); text-decoration: none; }

/* ===== Contact links (no form) ===== */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
}
.contact-link:hover { color: var(--accent); text-decoration: none; }

.contact-link-icon {
  width: 28px;
  height: 28px;
  background: var(--tag-bg);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ===== Contact ===== */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-info p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
}
.contact-link:hover { color: var(--accent); text-decoration: none; }

.contact-link-icon {
  width: 28px;
  height: 28px;
  background: var(--tag-bg);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ===== Contact Form ===== */
.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%239ca3af' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-group textarea { resize: vertical; min-height: 110px; }

.form-submit {
  width: 100%;
  justify-content: center;
}

#form-status {
  margin-top: 10px;
  font-size: 0.82rem;
  text-align: center;
  min-height: 18px;
}
#form-status.success { color: #16a34a; }
#form-status.error   { color: #dc2626; }

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-copy { font-size: 0.78rem; color: var(--text-dim); }

.footer-links { display: flex; gap: 18px; }
.footer-links a { font-size: 0.78rem; color: var(--text-dim); }
.footer-links a:hover { color: var(--text-muted); text-decoration: none; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  section { padding: 36px 0; }
  .hero   { padding: 40px 0 36px; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 52px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
  }
  .hamburger { display: flex; }

  .service-item,
  .why-item       { grid-template-columns: 1fr; }
  .service-meta   { text-align: left; }
  .why-key        { padding-bottom: 0; }

  .work-item      { grid-template-columns: 1fr; }
  .work-item-link { display: none; }

  .post-item      { grid-template-columns: 1fr; }
  .post-meta      { display: none; }

  .contact-layout { grid-template-columns: 1fr; gap: 32px; }

  .hero-ctas { flex-direction: column; align-items: flex-start; }
  .trust-bar { gap: 20px; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}
