/* sajadxdp.github.io - edition 9, "about-first", dark minimal.
   Bear-structured (pattern only): one centered document column,
   flat title rows, dashed rules. The landing IS the About page;
   Projects and Contact are the options. Dark only: no toggle, no
   light room, no theme storage. Tokens only, system fonts only,
   no frameworks, no build step, zero animations. */

:root {
  --bg: #141516;
  --text: #c9cdd2;
  --bright: #e9ecef;
  --muted: #8e9399;
  --accent: #e0855a;
  --border: #232629;
  --border-strong: #34383c;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --read: 40rem;
  --gutter: clamp(1rem, 4vw, 1.4rem);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--sans);
  -webkit-text-size-adjust: 100%;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

::selection { background: var(--accent); color: var(--bg); }

a {
  color: var(--bright);
  text-decoration: none;
  overflow-wrap: anywhere;
}

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

/* inline links grow to a 24px+ touch target with no visual change
   (vertical padding does not expand the line box) */
main a { padding: .25em 0; }

/* body-text links are underlined: color alone is not a link cue
   (WCAG 1.4.1). Row titles keep their bold weight as the cue. */
main p a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link { position: absolute; left: -9999px; }

.skip-link:focus {
  position: fixed;
  top: .8rem;
  left: .8rem;
  z-index: 10;
  background: var(--bright);
  color: var(--bg);
  padding: .5em .9em;
  text-decoration: none;
}

/* ---- header ---- */

header {
  max-width: 50rem;
  margin: 0 auto;
  padding-top: max(1.4rem, env(safe-area-inset-top));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem 1.2rem;
}

.mark {
  display: inline-flex;
  color: var(--bright);
  flex: none;
}

.mark svg { display: block; }

a.mark:hover { color: var(--accent); }

header nav[aria-label="Primary"] {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem 1.05rem;
  margin-left: auto;
  font: 400 .78rem/1.7 var(--mono);
}

nav[aria-label="Primary"] a { color: var(--muted); padding: .3em 0; }

nav[aria-label="Primary"] a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 2px;
}

nav[aria-label="Primary"] a:hover,
nav[aria-label="Primary"] a[aria-current="page"] { color: var(--bright); }

/* ---- page chassis ---- */

main {
  max-width: 50rem;
  margin: 0 auto;
  padding: 3.2rem 0 max(4rem, env(safe-area-inset-bottom));
}

h1 {
  color: var(--bright);
  font-weight: 600;
  font-size: clamp(1.5rem, 1.25rem + 1.2vw, 1.7rem);
  line-height: 1.25;
  margin: 0 0 1rem;
}

h2 {
  color: var(--bright);
  font-weight: 600;
  font-size: 1rem;
  margin: 2.2rem 0 .6rem;
}

p, ul, ol { margin: 0 0 1rem; }

li { margin-bottom: .3rem; }

strong { color: var(--bright); font-weight: 600; }

/* ---- flat title rows (the one list component, every page) ---- */

ul.rows {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  border-bottom: 1px dashed var(--border-strong);
}

.row {
  border-top: 1px dashed var(--border-strong);
  padding: .95rem 0 1rem;
}

.row-title {
  color: var(--bright);
  font-weight: 600;
}

.row-title:hover { color: var(--accent); }

.row p {
  margin: .25rem 0 0;
  font-size: .93rem;
  max-width: var(--read);
}

/* ---- project meta line ---- */

.links-line {
  font: 400 .78rem/1.7 var(--mono);
  color: var(--muted);
  margin: .35rem 0 0;
}

/* ---- copy email ---- */

.copy-btn {
  font: 400 .7rem/1 var(--mono);
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border-strong);
  padding: .5em .65em;
  margin-left: .4rem;
  cursor: pointer;
  vertical-align: middle;
}

.copy-btn:hover,
.copy-btn.is-done {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---- footer ---- */

footer {
  max-width: 50rem;
  margin: 0 auto;
  padding: 1rem 0 2.2rem;
  border-top: 1px dashed var(--border-strong);
  font: 400 .72rem/1.7 var(--mono);
  color: var(--muted);
  text-align: center;
}

footer p { margin: 0; }

/* ---- motion, small screens ---- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (max-width: 539px) {
  main { padding-top: 2.2rem; }
  header { padding-top: max(1.1rem, env(safe-area-inset-top)); }
  nav[aria-label="Primary"] {
    font-size: .72rem;
    gap: .15rem .8rem;
  }
}

/* ---- print: paper and save-as-pdf get ink, not the dark room ---- */

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #111; }
  a, h1, h2, strong, .row-title, .mark,
  nav[aria-label="Primary"] a, .links-line, footer { color: inherit; }
  a { text-decoration: underline; text-underline-offset: 2px; }
  .skip-link, .copy-btn { display: none; }
}
