/* ==========================================================================
   jsingh.dev — site styles
   Author: Jagz Singh
   A single stylesheet for the whole site. Dark by default, light on request.
   ========================================================================== */

/* --- 1. Design tokens ---------------------------------------------------- */

/* Light is the default. The site opens light for everyone, regardless of what
   their device prefers; dark applies only when the header toggle is pressed. */

:root {
  --bg:            #faf9f5;
  --bg-elevated:   #ffffff;
  --bg-sunken:     #f1efe8;
  --text:          #26251f;
  --text-muted:    #5f5d54;
  --text-faint:    #86847a;
  --border:        #e2ded1;
  --border-strong: #cdc8b8;
  --accent:        #8a6519;
  --accent-hover:  #6f5013;
  --accent-soft:   rgba(138, 101, 25, 0.10);
  --shadow:        0 1px 2px rgba(38, 37, 31, 0.06), 0 8px 24px rgba(38, 37, 31, 0.06);
  --selection:     rgba(138, 101, 25, 0.18);

  /* type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter",
               "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", Consolas,
               "Liberation Mono", Menlo, monospace;

  /* rhythm */
  --measure: 44rem;   /* reading column */
  --wide:    56rem;   /* wide column for grids */
  --gutter:  1.5rem;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg:            #1c1c1a;
  --bg-elevated:   #232320;
  --bg-sunken:     #181817;
  --text:          #ecebe6;
  --text-muted:    #a3a198;
  --text-faint:    #7a7871;
  --border:        #33322d;
  --border-strong: #45443d;
  --accent:        #d3ac68;
  --accent-hover:  #e6c187;
  --accent-soft:   rgba(211, 172, 104, 0.12);
  --shadow:        0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
  --selection:     rgba(211, 172, 104, 0.28);
  color-scheme: dark;
}

/* --- 2. Reset and base --------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  letter-spacing: 0.001em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

::selection { background: var(--selection); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: -0.018em;
  font-weight: 600;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 2.85rem); }
h2 { font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.75rem); margin-top: 0; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p, ul, ol { margin: 0 0 1.15rem; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--text-faint); }

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* --- 3. Layout ----------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--wide { max-width: var(--wide); }

main { flex: 1 0 auto; padding-block: 3.5rem 5rem; }

.section { margin-top: 4rem; }
.section:first-child { margin-top: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}
.section-head h2 { margin: 0; }
.section-head .more { font-size: 0.9rem; white-space: nowrap; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 0.85rem;
}

.lede {
  font-size: 1.1875rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 0 0 6px 0;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { left: 0; text-decoration: none; }

/* --- 4. Header and navigation -------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(160%) blur(8px);
}

.site-header .wrap {
  max-width: var(--wide);
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 1.02rem;
  margin-right: auto;
}
.brand:hover { color: var(--text); text-decoration: none; }
.brand img {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
}
.brand .dot { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.nav a {
  color: var(--text-muted);
  font-size: 0.9375rem;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav a:hover { color: var(--text); background: var(--bg-elevated); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.nav a[aria-current="page"]::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.theme-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  width: 34px; height: 34px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  margin-left: 0.35rem;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun  { display: block; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Narrow screens: brand and toggle on one row, nav beneath. */
@media (max-width: 40rem) {
  .site-header .wrap {
    min-height: 0;
    padding-block: 0.55rem 0;
    row-gap: 0;
  }
  .brand { order: 1; }
  .theme-toggle { order: 2; margin-left: auto; }
  .nav {
    order: 3;
    width: 100%;
    margin: 0.2rem 0 0.15rem -0.45rem;
    gap: 0.1rem;
  }
  .nav a { padding: 0.35rem 0.45rem; font-size: 0.8125rem; }
  .nav a[aria-current="page"]::after { margin-top: 1px; }
}

/* --- 5. Hero ------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 1rem;
}

.hero-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}

.hero h1 { margin-bottom: 0.35rem; }

.hero-role {
  color: var(--text-muted);
  font-size: 1.0625rem;
  margin: 0 0 1.1rem;
}
.hero-role .sep { color: var(--text-faint); margin-inline: 0.45rem; }

@media (max-width: 44rem) {
  .hero { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-photo { width: 116px; height: 116px; }
}

/* --- 6. Buttons and pills ------------------------------------------------ */

.social.hero-social { margin-top: 1.75rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.55rem 1.05rem;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--bg-elevated);
  transition: border-color 0.15s ease, background-color 0.15s ease,
              color 0.15s ease, transform 0.15s ease;
}
.btn:hover {
  text-decoration: none;
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1c1c1a;
  font-weight: 600;
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #1c1c1a; }
.btn svg { width: 16px; height: 16px; flex: none; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}
.badge .pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 1rem 0 0; list-style: none; }
.tags li { margin: 0; }
.tag {
  display: inline-block;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

/* --- 7. Cards and lists -------------------------------------------------- */

.grid { display: grid; gap: 1.1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.grid--consult { grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.card h3 { margin-bottom: 0.5rem; }
.card p:last-child { margin-bottom: 0; }
.card--link:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card .card-title a { color: var(--text); }
.card .card-title a:hover { color: var(--accent); text-decoration: none; }

.card-meta {
  font-size: 0.8125rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin: 0 0 0.55rem;
}

/* linked list of entries (projects, writing) */
.entry-list { list-style: none; margin: 0; padding: 0; }
.entry {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.entry:first-child { padding-top: 0; }
.entry:last-child { border-bottom: 0; }
.entry h3 { margin-bottom: 0.3rem; }
.entry p { margin-bottom: 0; color: var(--text-muted); }

/* --- 8. Résumé ----------------------------------------------------------- */

.role {
  position: relative;
  padding: 0 0 1.9rem 1.6rem;
  border-left: 1px solid var(--border);
}
.role:last-child { padding-bottom: 0; border-left-color: transparent; }
.role::before {
  content: "";
  position: absolute;
  left: -5px; top: 0.5rem;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.role h3 { margin-bottom: 0.15rem; }
.role-org {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 0.15rem;
}
.role-dates {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-faint);
  margin: 0 0 0.75rem;
}
.role ul { margin-bottom: 0; }
.role ul li { color: var(--text-muted); }

.skill-group { margin-bottom: 1.4rem; }
.skill-group h4 {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.55rem;
}

.facts { list-style: none; margin: 0; padding: 0; }
.facts li {
  display: flex;
  gap: 0.9rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  margin: 0;
  font-size: 0.9375rem;
}
.facts li:last-child { border-bottom: 0; }
.facts .k { color: var(--text-faint); min-width: 7.5rem; flex: none; }
.facts .v { color: var(--text); }

/* --- 9. Services --------------------------------------------------------- */

.tier { display: flex; flex-direction: column; height: 100%; }
.tier .price {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  color: var(--text);
  margin: 0.15rem 0 0.9rem;
}
.tier .price small { font-size: 0.75rem; color: var(--text-faint); font-family: var(--font-sans); }
.tier ul { list-style: none; padding: 0; margin: 0 0 1.3rem; font-size: 0.9375rem; }
.tier ul li {
  padding-left: 1.4rem;
  position: relative;
  color: var(--text-muted);
}
.tier ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.62em;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
}
.tier .btn { margin-top: auto; align-self: flex-start; }
.tier--featured { border-color: var(--accent); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 1.1rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0.1rem;
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  display: grid;
  place-items: center;
}
.steps li strong { display: block; color: var(--text); }

/* --- 10. About page ------------------------------------------------------ */

.about-top {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.25rem;
  align-items: start;
}
.about-top img {
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
@media (max-width: 46rem) {
  .about-top { grid-template-columns: 1fr; gap: 1.5rem; }
  .about-top img { max-width: 220px; }
}

.quote {
  border-left: 2px solid var(--accent);
  padding: 0.15rem 0 0.15rem 1.2rem;
  margin: 2rem 0;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

/* --- 11. Callout / placeholder ------------------------------------------- */

.callout {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 1.15rem 1.35rem;
  margin: 2rem 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.callout p:last-child { margin-bottom: 0; }

/* Anything still to be filled in before publishing. Search for "todo". */
.todo {
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  border-radius: 4px;
  padding: 0.05em 0.4em;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* --- 12. Footer ---------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2.25rem 2.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: none;
}
.site-footer .wrap { max-width: var(--wide); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  align-items: center;
  justify-content: space-between;
}

.social {
  display: flex;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.social li { margin: 0; }
.social a {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 7px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.social a:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  text-decoration: none;
}
.social svg { width: 17px; height: 17px; }

.colophon { color: var(--text-faint); font-size: 0.85rem; margin: 0; }

/* --- 13. Print (résumé) -------------------------------------------------- */

@media print {
  :root {
    --bg: #fff; --bg-elevated: #fff; --bg-sunken: #fff;
    --text: #000; --text-muted: #333; --text-faint: #555;
    --border: #ccc; --border-strong: #999; --accent: #000;
  }
  .site-header, .site-footer, .actions, .theme-toggle, .skip-link, .callout { display: none !important; }
  body { font-size: 11pt; line-height: 1.45; }
  main { padding-block: 0; }
  .wrap { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
  .role { break-inside: avoid; }
  .section { margin-top: 1.4rem; }
  h1, h2, h3, h4, .section-head { break-after: avoid; page-break-after: avoid; }
  .facts li, .skill-group { break-inside: avoid; }
}
