/* amirw.ir — homepage + about
   Shared design system.
   Works standalone with zero external requests. */

:root {
  --bg: #15181a;
  --fg: #e7e7e3;
  --muted: #9ba1a0;
  --faint: #6b7170;
  --accent: #6fa79b;
  --accent-strong: #8bc0b5;
  --accent-soft: rgba(111, 167, 155, 0.12);
  --border: #2a2e30;
  --border-strong: #3a3f42;
  --surface: #1b1f22;
  --surface-hover: #202529;
  --danger: #c96a6a;
  --font-sans: ui-sans-serif, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --max: 860px;
}

:root[data-theme="light"] {
  --bg: #f6f6f4;
  --fg: #1b1d1e;
  --muted: #5b6062;
  --faint: #8b8f8d;
  --accent: #3e6b63;
  --accent-strong: #2e5750;
  --accent-soft: rgba(62, 107, 99, 0.1);
  --border: #dededa;
  --border-strong: #c6c6c0;
  --surface: #efefeb;
  --surface-hover: #e8e8e3;
  --danger: #a43d3d;
}

* { box-sizing: border-box; }
*::selection { background: var(--accent); color: var(--bg); }

html { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.15s ease, color 0.15s ease;
}

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

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 4rem;
}

@media (max-width: 600px) {
  .wrap { padding: 1rem 1.25rem 3rem; }
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
}

@media (max-width: 600px) {
  .topbar { padding: 0.9rem 1.25rem; flex-wrap: wrap; }
}

.brand {
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--fg);
  font-size: 1.05rem;
}
.brand:hover { color: var(--accent); }
.brand .dot { color: var(--accent); }

.topbar-links {
  display: flex;
  gap: 1.4rem;
  align-items: center;
  font-size: 0.95rem;
}

.topbar-links a {
  color: var(--muted);
  font-weight: 500;
}
.topbar-links a:hover { color: var(--fg); }
.topbar-links a.active { color: var(--fg); border-bottom: 1px solid var(--accent); padding-bottom: 1px; }

@media (max-width: 600px) {
  .topbar-links { gap: 1rem; order: 3; width: 100%; justify-content: space-between; }
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.theme-toggle:hover { color: var(--fg); border-color: var(--muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .moon { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .moon { display: block; }

/* ---------- Hero ---------- */
.hero {
  padding: 4.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 600px) {
  .hero { padding: 2.8rem 0 2rem; }
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 0.5rem;
}

.hero-role {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 1rem;
}

.hero-text {
  max-width: 50ch;
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 1.6rem;
}

.hero-text strong { color: var(--fg); font-weight: 600; }

/* Social icon row in hero */
.hero-social {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
}

.hero-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  transition: all 0.15s;
}

.hero-social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.hero-social a.email {
  margin-left: 0.25rem;
}

.hero-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.hero-social a.email svg {
  fill: none;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.98rem;
  font-weight: 550;
  padding: 0.7rem 1.25rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  color: var(--fg);
  transition: all 0.15s;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--bg); }

.btn-ghost { background: transparent; }

/* ---------- Availability ---------- */
.availability {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.availability .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(111, 167, 155, 0.5);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(111, 167, 155, 0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(111, 167, 155, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 167, 155, 0); }
}

/* ---------- Section base ---------- */
section {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

h2 {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0;
}

h2 .hash { color: var(--accent); font-family: var(--font-mono); font-weight: 500; margin-right: 0.35rem; font-size: 1.1rem; }

.sec-note {
  color: var(--faint);
  font-size: 0.9rem;
  margin: 0;
}

/* ---------- Services grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem 1.4rem 1.5rem;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.card-icon svg { width: 20px; height: 20px; }

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
}

.card p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 1rem;
  line-height: 1.55;
}

.card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
}

/* ---------- Platforms (work) ---------- */
.platform-list {
  display: grid;
  gap: 0.85rem;
}

.platform {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  transition: border-color 0.15s, background 0.15s;
}

.platform:hover { border-color: var(--accent); background: var(--surface); }

.platform-left { min-width: 0; }

.platform h3 {
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.platform h3 a { color: var(--fg); }
.platform:hover h3 a { color: var(--accent); }

.platform p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.platform .arrow {
  color: var(--faint);
  font-family: var(--font-mono);
  flex-shrink: 0;
  font-size: 1rem;
  transition: transform 0.15s, color 0.15s;
}

.platform:hover .arrow { color: var(--accent); transform: translateX(3px); }

/* ---------- Elsewhere ---------- */
.elsewhere {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.8rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.elsewhere a {
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  font-weight: 500;
}
.elsewhere a:hover { color: var(--accent); border-color: var(--accent); }

/* contact row */
.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.5rem;
  margin-top: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--muted);
}
.contact a { color: var(--accent); }

/* ---------- Footer ---------- */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

footer a { color: var(--faint); }
footer a:hover { color: var(--accent); }

/* ---------- About page ---------- */
.about-head { padding: 4rem 0 2rem; }

.about-head h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 0.8rem;
}

.about-head p {
  color: var(--muted);
  max-width: 62ch;
  margin: 0;
  font-size: 1.05rem;
}

.about-block { margin-top: 2rem; }
.about-block > h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  margin: 0 0 1.1rem;
}

.about-block p {
  max-width: 66ch;
  color: var(--fg);
  margin: 0 0 1rem;
}

.about-block .muted { color: var(--muted); }
.about-block ul { margin: 0; padding-left: 1.2rem; }
.about-block li { margin-bottom: 0.55rem; }
.about-block li::marker { color: var(--accent); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0.5rem;
}

.stat {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.3rem;
  background: var(--surface);
}

.stat .num {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat .lbl {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* ---------- Placeholder page ---------- */
.ph {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
}

.ph-inner h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

.ph-inner p { color: var(--muted); max-width: 46ch; margin: 0 auto 1.6rem; }

.code-note {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--faint);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  display: inline-block;
  margin-bottom: 1.6rem;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  body, .card, .platform, .arrow, .availability .pulse {
    transition: none;
    animation: none;
  }
}