/* ==========================================================================
   ratvuiduocgapban.uk — portfolio
   Giữ nguyên phong cách gốc: tấm giấy kem bo góc lớn nổi trên nền xám ấm,
   tiêu đề chữ serif Fraunces. Nội dung nhiều hơn trước rất nhiều nên bố cục
   được mở rộng, nhưng bảng màu và chất cảm thì không đổi.
   ========================================================================== */

:root {
  --canvas: #cfcfc8;
  --sheet: #f3f0ea;
  --sheet-soft: #ece8e0;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: rgba(26, 26, 26, 0.1);
  --line-strong: rgba(26, 26, 26, 0.18);
  --pill: #111111;

  --ok: #1f6f43;
  --ok-bg: rgba(31, 111, 67, 0.11);
  --warn: #8a5a12;
  --warn-bg: rgba(138, 90, 18, 0.11);
  --err: #a3372c;

  --radius: 2.75rem;
  --radius-sm: 1.1rem;

  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { 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(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

/* Tấm giấy — hình ảnh chủ đạo của phong cách gốc. */
.page { padding: 1.5rem 1.25rem 3rem; }

.sheet {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--sheet);
  border-radius: var(--radius);
  overflow: hidden;
}

.wrap { padding: 0 clamp(1.25rem, 4vw, 3.25rem); }

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

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(243, 240, 234, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  padding: 1rem clamp(1.25rem, 4vw, 3.25rem);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pill);
  color: var(--sheet);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 600;
  flex: none;
}

.head-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.head-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
}

.head-nav a:hover { color: var(--ink); }

.lang { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; }

.lang-btn {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 0.1rem 0.15rem;
  font: inherit;
}

.lang-btn.is-active { color: var(--ink); font-weight: 600; }
.lang-sep { color: var(--line-strong); }

/* ------------------------------------------------------------------ hero */

.hero { padding: 4.5rem 0 3.5rem; text-align: center; }

.badge-open {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}

.hero h1 {
  margin: 0 auto 1.5rem;
  max-width: 17ch;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5.6vw, 3.6rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* Ở bản tối đây là chữ gradient. Phong cách giấy kem không dùng gradient —
   nhấn bằng chữ nghiêng serif, hợp chất cảm ấn phẩm hơn. */
.hero h1 .grad {
  font-style: italic;
  color: var(--muted);
}

.hero .bio {
  margin: 0 auto 2.3rem;
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.8vw, 1.06rem);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; }

/* ------------------------------------------------------------------- nút */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.72rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary { background: var(--pill); color: var(--sheet); }
.btn-primary:hover { background: #000; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--sheet-soft); }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* --------------------------------------------------------------- section */

.section { padding: 3.8rem 0; border-top: 1px solid var(--line); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.section h2 {
  margin: 0 0 0.6rem;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.section .lead { margin: 0 0 2rem; color: var(--muted); max-width: 60ch; }

/* ---------------------------------------------------------------- thẻ số */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-top: 1.8rem;
}

.stat {
  background: var(--sheet-soft);
  border-radius: var(--radius-sm);
  padding: 1.3rem 1.35rem;
}

.stat .n {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

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

/* Ghi chú cá nhân — tách khỏi giọng CV để đọc như lời thật. */
.note {
  border-left: 2px solid var(--ink);
  padding: 0.9rem 1.2rem;
  margin-top: 2rem;
  color: var(--muted);
}

.note strong { color: var(--ink); font-weight: 600; }

/* -------------------------------------------------------------- timeline */

.timeline { display: flex; flex-direction: column; gap: 0.9rem; }

.job {
  background: var(--sheet-soft);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
}

.job-when { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); margin-bottom: 0.5rem; }

.job h3 { margin: 0 0 0.2rem; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }

.job-role { color: var(--muted); font-size: 0.86rem; margin-bottom: 0.9rem; }

.job p { margin: 0 0 1rem; color: var(--muted); font-size: 0.93rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  color: var(--muted);
}

/* ----------------------------------------------------------------- dự án */

.projects { display: grid; gap: 0.9rem; }

.project {
  background: var(--sheet-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 1.6rem;
  display: block;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.project:hover { border-color: var(--line-strong); background: #e6e1d8; }

.project-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ok);
  background: var(--ok-bg);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  margin-bottom: 0.8rem;
}

.project h3 { margin: 0 0 0.45rem; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.project p { margin: 0 0 1rem; color: var(--muted); font-size: 0.93rem; }
.project-go { margin-top: 1rem; font-size: 0.88rem; font-weight: 500; }

/* ------------------------------------------- hệ thống đang chạy (app.) */

.systems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 0.8rem;
}

.sys {
  background: var(--sheet-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.3rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.sys:hover { border-color: var(--line-strong); background: #e6e1d8; transform: translateY(-2px); }

.sys-top { display: flex; align-items: center; gap: 0.6rem; }

.sys-ico {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sheet);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex: none;
}

.sys-ico svg { width: 16px; height: 16px; }

.sys h3 { margin: 0; font-size: 0.97rem; font-weight: 600; }
.sys p { margin: 0; color: var(--muted); font-size: 0.85rem; }

/* Nhãn quyền truy cập: biết trước bấm vào có vào được không. */
.sys-access {
  font-family: var(--mono);
  font-size: 0.69rem;
  border-radius: 999px;
  padding: 0.16rem 0.55rem;
  margin-top: 0.4rem;
  align-self: flex-start;
}

.access-open { background: var(--ok-bg); color: var(--ok); }
.access-login { background: var(--warn-bg); color: var(--warn); }

/* --------------------------------------------------- học vấn / kỹ năng */

.edu { background: var(--sheet-soft); border-radius: var(--radius-sm); padding: 1.6rem; }
.edu .when { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); }
.edu h3 { margin: 0.3rem 0 0; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.edu .deg { margin: 0.8rem 0 0.6rem; font-family: var(--serif); font-size: 1.1rem; font-weight: 500; }
.edu p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1.4rem;
}

.skill-group {
  background: var(--sheet-soft);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.2rem;
  font-size: 0.91rem;
  font-weight: 500;
}

/* -------------------------------------------------------------- thành tích */

.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 0.8rem; }

.award { background: var(--sheet-soft); border-radius: var(--radius-sm); padding: 1.15rem 1.3rem; }
.award b { display: block; font-weight: 600; font-size: 0.95rem; }
.award span { color: var(--muted); font-size: 0.84rem; }

/* ------------------------------------------------------------------- CTA */

.cta {
  background: var(--sheet-soft);
  border-radius: calc(var(--radius) - 0.9rem);
  padding: 3rem 1.5rem;
  text-align: center;
}

.cta h2 {
  margin: 0 0 0.7rem;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.cta p { margin: 0 auto 1.8rem; color: var(--muted); max-width: 44ch; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; }

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

.site-foot {
  border-top: 1px solid var(--line);
  padding: 1.8rem clamp(1.25rem, 4vw, 3.25rem) 2.4rem;
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: space-between;
  align-items: center;
}

.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

/* ---------------------------------------------------- trang phụ (mini) */

.mini { min-height: 58vh; display: grid; place-items: center; text-align: center; padding: 4rem 0; }

.mini h1 {
  margin: 1rem 0 0.7rem;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.8vw, 2.9rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.mini .lead { color: var(--ink); font-size: 1.02rem; margin: 0 0 0.5rem; }
.mini p { color: var(--muted); margin: 0 auto 1.6rem; max-width: 38ch; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.74rem;
  background: var(--pill);
  color: var(--sheet);
}

.badge-live { background: var(--ok); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; }

/* ---------------------------------------------------------- form liên hệ */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin: 2rem auto 0;
  max-width: 34rem;
  text-align: left;
}

.fld { display: flex; flex-direction: column; gap: 0.4rem; }
.fld-label { font-size: 0.87rem; font-weight: 500; }

.fld textarea,
.fld input {
  font-family: var(--sans);
  font-size: 0.97rem;
  line-height: 1.55;
  color: var(--ink);
  background: #fbfaf7;
  border: 1px solid var(--line-strong);
  border-radius: 0.9rem;
  padding: 0.78rem 0.95rem;
  width: 100%;
  resize: vertical;
}

.fld textarea::placeholder,
.fld input::placeholder { color: #9a9a92; }

.fld textarea:focus,
.fld input:focus { outline: 2px solid var(--ink); outline-offset: 1px; background: #fff; }

.fld-hint { font-size: 0.75rem; color: var(--muted); align-self: flex-end; }

/* Honeypot: đẩy khỏi khung nhìn thay vì display:none — vài bot bỏ qua field
   bị ẩn hẳn nhưng vẫn điền field chỉ nằm ngoài màn hình. */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cf-status { margin: 0; min-height: 1.4rem; font-size: 0.9rem; text-align: center; }
.cf-status.is-ok { color: var(--ok); }
.cf-status.is-err { color: var(--err); }

.contact-alt { margin: 1.6rem 0 0; text-align: center; font-size: 0.9rem; color: var(--muted); }
.contact-alt a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- mobile */

@media (max-width: 760px) {
  .page { padding: 0.75rem 0.75rem 2rem; }
  .sheet { border-radius: 1.75rem; }
  .head-nav a { display: none; }
  .section { padding: 2.8rem 0; }
  .hero { padding: 3.2rem 0 2.6rem; }
  .cta { padding: 2.2rem 1.2rem; }
}
