/* ============================================================
   Samin Sawban Rayed — Portfolio
   Design system: editorial, light, restrained.
   Serif display (Fraunces) for identity, Plex Sans for reading.
   ============================================================ */

:root {
  --paper: #f7f5f0;
  --paper-raised: #ffffff;
  --ink: #1c1b19;
  --ink-soft: #5b5952;
  --ink-faint: #8a877d;
  --line: #ddd8cc;
  --accent: #1f5c52;
  --accent-soft: #e4ece9;

  --serif: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --max: 960px;
  --pad: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ---------------- Nav ---------------- */

.nav {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--line);
}

.nav .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.nav-mark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-links a:hover {
  color: var(--ink);
  border-color: var(--accent);
}

/* ---------------- Hero ---------------- */

.hero {
  padding: clamp(56px, 10vw, 108px) 0 clamp(48px, 8vw, 84px);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  align-items: end;
}

@media (max-width: 720px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero-eyebrow {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
}

.hero p.lede {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 3px;
  text-decoration: none;
  font-size: 15px;
  border: 1px solid var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

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

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

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

.hero-meta {
  font-size: 15px;
  color: var(--ink-soft);
}

.hero-photo {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 24px;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-meta dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
}

.hero-meta dt { color: var(--ink-faint); }
.hero-meta dd { margin: 0; }

/* ---------------- Sections ---------------- */

section { padding: clamp(56px, 9vw, 92px) 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 36px);
  margin: 0;
  letter-spacing: -0.01em;
}

.section-note {
  color: var(--ink-faint);
  font-size: 15px;
  max-width: 34ch;
  text-align: right;
}

@media (max-width: 600px) {
  .section-note { text-align: left; }
}

/* ---------------- About ---------------- */

.about p {
  max-width: 68ch;
  font-size: 18px;
  color: var(--ink-soft);
}

.about p + p { margin-top: 18px; }

/* ---------------- Projects ---------------- */

.project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 48px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}

.project:first-child { border-top: none; padding-top: 0; }

.project.reverse .project-media { order: 2; }
.project.reverse .project-body { order: 1; }

.project.text-only { grid-template-columns: 1fr; max-width: 62ch; }

@media (max-width: 760px) {
  .project, .project.reverse { grid-template-columns: 1fr; }
  .project.reverse .project-media,
  .project.reverse .project-body { order: initial; }
}

.project-media {
  border: 1px solid var(--line);
  background: var(--paper-raised);
  border-radius: 4px;
  overflow: hidden;
}

.project-media img { width: 100%; }

.project-media.two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.project-media.two-up img:first-child { border-right: 1px solid var(--line); }

.project-context {
  font-size: 14px;
  color: var(--ink-faint);
  margin: 0 0 10px;
}

.project-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.project-body p {
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.project-body .ai-note {
  font-size: 14.5px;
  color: var(--ink-faint);
  border-left: 2px solid var(--accent-soft);
  padding-left: 12px;
  margin: 16px 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 16px;
  padding: 0;
  list-style: none;
}

.tags li {
  font-size: 13px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 100px;
}

.project-links { display: flex; gap: 18px; font-size: 15px; }

.project-links a {
  text-decoration: none;
  color: var(--accent);
  border-bottom: 1px solid transparent;
}

.project-links a:hover { border-color: var(--accent); }

/* ---------------- Secondary work list ---------------- */

.other-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.other-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.other-item:first-child { border-top: none; }

.other-item h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  margin: 0 0 4px;
}

.other-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 58ch;
}

.other-item a {
  font-size: 14px;
  text-decoration: none;
  color: var(--accent);
  white-space: nowrap;
}

/* ---------------- Academic ---------------- */

.academic-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px;
  background: var(--paper-raised);
}

@media (max-width: 560px) {
  .academic-card { grid-template-columns: 1fr; }
}

.academic-card .mark {
  font-family: var(--serif);
  font-size: 40px;
  color: var(--accent);
}

.academic-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 6px;
}

.academic-card .sub {
  color: var(--ink-soft);
  margin: 0 0 4px;
}

.academic-card .status {
  color: var(--ink-faint);
  font-size: 14px;
}

/* ---------------- Skills ---------------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}

.skill-group h3 {
  font-size: 14px;
  text-transform: none;
  color: var(--ink-faint);
  margin: 0 0 12px;
  font-weight: 500;
}

.skill-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.skill-group li {
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 15.5px;
}

.skill-group li:first-child { border-top: none; }

/* ---------------- Contact / Footer ---------------- */

.contact h2 { max-width: 20ch; }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 32px;
}

.contact-links a {
  font-family: var(--serif);
  font-size: 22px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.contact-links a:hover { border-color: var(--accent); color: var(--accent); }

footer {
  padding: 32px var(--pad) 48px;
  max-width: var(--max);
  margin: 0 auto;
  color: var(--ink-faint);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------------- Focus states ---------------- */

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