/* ============================================================
   Rahul Ohariya — Portfolio
   Hand-drawn / notebook aesthetic. No frameworks.
   ============================================================ */

:root {
  --bg: #fbfbf8;
  --ink: #111;
  --ink-2: #1c1c1c;
  --ink-3: #2c2c2c;
  --font-head: 'Solway', serif;
  --font-body: 'Poppins', sans-serif;
  --font-hand: 'Gaegu', cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  background-image: radial-gradient(rgba(17, 17, 17, 0.11) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #ddff33; color: #111; }

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

a { color: inherit; text-decoration: none; }
a:hover { color: var(--ink); }

input, textarea { font-family: var(--font-body); }
input::placeholder, textarea::placeholder { color: rgba(17, 17, 17, 0.4); }
input:focus, textarea:focus { outline: none; border-color: var(--ink); }

/* Accessibility */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg);
  padding: 10px 18px; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

@keyframes floatN {
  0%, 100% { transform: translateY(0) rotate(var(--r)); }
  50% { transform: translateY(-7px) rotate(calc(var(--r) + 1deg)); }
}
@keyframes menuRowIn {
  from { opacity: 0; transform: translateX(26px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes menuBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes cardStackIn {
  from { opacity: 0; transform: translateY(60px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hd-border { border: 2px solid var(--ink); border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; }

.pad-x { padding-left: 40px; padding-right: 40px; }
.container-sm { max-width: 900px; margin: 0 auto; }

/* ============ Section heading ============ */
.section-heading {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; margin-bottom: 48px;
}
.section-heading .line { width: 48px; height: 2px; background: var(--ink-3); }
.section-heading h1, .section-heading h2 {
  font-family: var(--font-head); font-weight: 700;
  color: var(--ink-3); margin: 0;
}
.section-heading h1 { font-size: clamp(28px, 4vw, 40px); }
.section-heading h2 { font-size: clamp(24px, 3vw, 30px); }

/* ============ Header / page hero ============ */
.page-header {
  max-width: 900px; margin: 0 auto;
  padding: 120px 40px 20px; text-align: center;
}
.page-header .lede {
  font-size: 14px; line-height: 1.8; color: rgba(17, 17, 17, 0.6);
  max-width: 600px; margin: 0 auto;
}

/* ============ Hero (home) ============ */
.hero {
  position: relative;
  max-width: 900px; margin: 0 auto;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 80px 40px 40px;
  overflow: hidden;
}
.hero h1 {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(30px, 5vw, 46px); letter-spacing: -0.02em;
  color: var(--ink-3); margin: 0 0 12px;
}
.hero .hero-sub {
  font-family: var(--font-hand); font-weight: 700;
  font-size: clamp(17px, 2vw, 20px); color: rgba(17, 17, 17, 0.55); margin: 0;
}

.hero-notes {
  position: absolute; top: 50%; right: 2%; transform: translateY(-30%);
  display: flex; align-items: flex-start;
}
.hero-note {
  width: 120px; height: 120px;
  box-shadow: 3px 6px 14px rgba(17, 17, 17, 0.18);
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 12px 16px; box-sizing: border-box;
  animation: floatN 4.2s ease-in-out 0.3s infinite;
  margin-top: 48px; margin-right: -14px;
  position: relative; z-index: 2;
  transition: transform 0.2s ease;
  cursor: default;
  transform: rotate(var(--r));
}
.hero-note:hover { transform: scale(1.08) rotate(-3deg); }
.hero-note span {
  font-family: var(--font-hand); font-weight: 700; font-size: 17px; line-height: 1.2; color: var(--ink-2);
}
.hero-note-wave {
  --r: 8deg; background: #fbe6a2; width: 126px; height: 126px;
  box-shadow: 3px 6px 14px rgba(17, 17, 17, 0.2);
  animation: floatN 3.8s ease-in-out infinite;
  position: relative; z-index: 2;
  transition: transform 0.2s ease; cursor: default;
}
.hero-note-wave:hover { transform: scale(1.1) rotate(8deg); }
.hero-note-wave span { font-size: 44px; transform: rotate(-8deg); }

/* ============ Services ============ */
.services-section { max-width: 900px; margin: 0 auto; padding: 20px 40px 80px; overflow: hidden; }
.services-lede {
  font-family: var(--font-hand); font-weight: 700; font-size: 18px;
  color: rgba(17, 17, 17, 0.5); text-align: center; margin: 0 0 40px;
}
.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 170px;
  gap: 16px; width: 100%; box-sizing: border-box;
}
.service-card { min-width: 0; min-height: 0; perspective: 1200px; cursor: pointer; }
.service-card-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}
.service-card.flipped .service-card-inner,
.service-slide.flipped .service-card-inner { transform: rotateY(180deg); }
.service-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  padding: 20px; box-sizing: border-box;
}
.service-face--front { background: var(--bg); display: flex; flex-direction: column; justify-content: space-between; }
.service-face--back { transform: rotateY(180deg); display: flex; flex-direction: column; justify-content: center; gap: 8px; overflow: hidden; }
.service-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--bg); border: 1.5px solid rgba(17, 17, 17, 0.15); flex-shrink: 0;
}
.service-icon svg { width: 100%; height: 100%; }
.service-tag {
  font-family: var(--font-body); font-weight: 700; font-size: 10px;
  letter-spacing: 0.08em; color: rgba(17, 17, 17, 0.5); white-space: nowrap;
}
.service-title { font-family: var(--font-head); font-weight: 700; font-size: 16px; color: var(--ink-3); margin: 0; line-height: 1.25; }
.service-desc { font-size: 12.5px; line-height: 1.55; color: rgba(17, 17, 17, 0.75); margin: 0; font-weight: 600; }

/* mobile: cards slide in from alternating sides as you scroll */
.services-scroller { display: none; flex-direction: column; gap: 18px; }
.service-slide {
  opacity: 0; perspective: 1200px; cursor: pointer; height: 200px;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.7s ease;
}
.service-slide[data-side="left"] { transform: translateX(-60px); }
.service-slide[data-side="right"] { transform: translateX(60px); }
.service-slide.in-view { opacity: 1; transform: translateX(0); }
.service-slide .service-face { padding: 22px; }
.service-slide .service-icon { width: 44px; height: 44px; border-radius: 13px; }
.service-slide .service-tag { font-size: 10.5px; }
.service-slide .service-title { font-size: 19px; margin: 0 0 6px; }
.service-slide .tap-hint { font-family: var(--font-hand); font-weight: 700; font-size: 14px; color: rgba(17, 17, 17, 0.4); }
.service-slide .service-desc { font-size: 14px; line-height: 1.6; }

/* ============ About / profile section ============ */
.about-block { max-width: 900px; margin: 0 auto; padding: 60px 40px; }
.about-columns {
  display: grid; grid-template-columns: 360px 1fr; gap: 56px; align-items: start;
}
.portrait-wrap { position: relative; width: 150px; margin: 0 0 8px 40px; }
.portrait-arrow { position: absolute; left: -46px; top: -6px; width: 56px; height: 70px; pointer-events: none; }
.portrait-circle {
  width: 118px; height: 118px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--ink); transition: transform 0.2s ease;
}
.portrait-circle:hover { transform: scale(1.06) rotate(-1deg); }
.portrait-circle img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: 47% 32%; transform: scale(1.35); transform-origin: 46% 30%;
}
.portrait-caption {
  position: absolute; left: 128px; bottom: 6px;
  font-family: var(--font-hand); font-weight: 700; font-size: 22px; color: var(--ink-2); white-space: nowrap;
}

.notes-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 10px; max-width: 320px; margin: 36px auto 0; }
.note-stack { display: flex; flex-direction: column; align-items: flex-start; width: 260px; margin: 36px auto 0; }
.note {
  width: 104px; height: 104px;
  box-shadow: 2px 4px 10px rgba(17, 17, 17, 0.16);
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 12px; box-sizing: border-box;
  transform: rotate(var(--r));
  animation: floatN var(--dur, 4s) ease-in-out var(--delay, 0s) infinite;
  transition: box-shadow 0.2s ease;
  cursor: default;
  position: relative;
  z-index: var(--z, 1);
}
.note:hover { animation-play-state: paused; transform: rotate(0deg) scale(1.08); box-shadow: 4px 8px 16px rgba(17, 17, 17, 0.28); z-index: 9; }
.note span { font-family: var(--font-hand); font-weight: 700; font-size: 16px; line-height: 1.15; color: var(--ink-2); }

.about-right h3 {
  font-family: var(--font-head); font-weight: 700; font-size: 19px; margin: 0 0 16px;
}

.links-row { display: flex; gap: 10px; margin-bottom: 40px; }
.link-circle {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 1.5px solid rgba(17, 17, 17, 0.25); border-radius: 50%;
  transition: transform 0.15s ease-out, border-color 0.2s ease;
}
.link-circle:hover { border-color: var(--ink); }
.link-circle svg { width: 16px; height: 16px; color: var(--ink); }

.skills-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 44px; }
.skill-chip {
  border: 2px solid rgba(17, 17, 17, 0.7); border-radius: 22px 26px 20px 24px;
  padding: 7px 18px 5px; font-family: var(--font-hand); font-weight: 700; font-size: 18px; line-height: 1;
  display: inline-block;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  cursor: default;
}
.skill-chip:hover { background: var(--ink); color: var(--bg); transform: translateY(-3px); }

.edu-list, .exp-list { display: flex; flex-direction: column; gap: 24px; }
.exp-list { gap: 26px; }
.edu-item, .exp-item { transition: transform 0.2s ease; cursor: default; }
.edu-item:hover, .exp-item:hover { transform: translateX(6px); }
.edu-item .org, .exp-item .org { font-family: var(--font-body); font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.edu-item .degree { font-size: 13px; color: rgba(17, 17, 17, 0.65); margin-bottom: 4px; }
.edu-item .date { font-size: 12.5px; color: rgba(17, 17, 17, 0.5); }
.exp-item .meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: rgba(17, 17, 17, 0.55); margin-bottom: 8px; }
.exp-item p { font-size: 13px; line-height: 1.6; color: rgba(17, 17, 17, 0.65); margin: 0; }

.resume-link, .more-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 28px;
  font-family: var(--font-body); font-size: 14px; font-weight: 700;
  border-bottom: 2px solid var(--ink); padding-bottom: 3px;
}

/* ============ Tools ============ */
.tools-section { max-width: 900px; margin: 0 auto; padding: 20px 40px 70px; }
.tools-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.tool-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 8px; width: 110px;
  transition: transform 0.2s ease; cursor: default;
}
.tool-card:hover { transform: translateY(-5px); }
.tool-icon-circle {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(17, 17, 17, 0.05); transition: background 0.2s ease;
}
.tool-card:hover .tool-icon-circle { background: rgba(17, 17, 17, 0.09); }
.tool-icon-circle svg, .tool-icon-circle img { width: 26px; height: 26px; object-fit: contain; color: var(--ink); }
.tool-card span.tool-name { font-family: var(--font-body); font-weight: 700; font-size: 12.5px; }

/* ============ Projects ============ */
.projects-section { max-width: 900px; margin: 0 auto; padding: 20px 40px 80px; position: relative; }
.project-list { display: flex; flex-direction: column; gap: 28px; position: relative; }
.project-card {
  display: flex; gap: 0; background: var(--bg); overflow: hidden;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  position: sticky;
  top: var(--sticky-top, 110px);
  z-index: var(--z, 1);
  opacity: 0;
  box-shadow: 0 18px 34px rgba(17, 17, 17, 0.16);
  transform: rotate(var(--tilt, 0deg)) translateY(60px) scale(0.94);
}
.project-img {
  position: relative; flex: 0 0 44%; height: 250px; overflow: hidden;
  margin: 12px 0 12px 12px;
  border-radius: 200px 12px 180px 12px / 12px 180px 12px 200px;
}
.project-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.project-badge {
  position: absolute; left: 14px; bottom: 14px;
  background: rgba(17, 17, 17, 0.9); color: var(--bg);
  font-family: var(--font-body); font-weight: 700; font-size: 11px;
  letter-spacing: 0.08em; padding: 6px 12px; border-radius: 4px;
}
.project-text { flex: 1; padding: 34px 34px 34px 30px; display: flex; flex-direction: column; justify-content: center; }
.project-title { font-family: var(--font-head); font-weight: 700; font-size: 22px; color: var(--ink-3); margin: 0 0 14px; }
.project-desc { font-size: 13.5px; line-height: 1.7; color: rgba(17, 17, 17, 0.6); margin: 0; }
.view-all { text-align: center; margin-top: 48px; }
.view-all a {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-size: 14px; font-weight: 700;
  border-bottom: 2px solid var(--ink); padding-bottom: 3px;
}

/* Full projects-page card variant */
.project-card--full { scroll-margin-top: 140px; }
.project-card--full .project-img { flex: 0 0 44%; height: 260px; }
.project-card--full .project-text { padding: 32px 34px; }
.project-index { font-family: var(--font-hand); font-size: 20px; color: rgba(17, 17, 17, 0.4); margin-bottom: 2px; font-weight: 700; }
.project-card--full .project-title { font-size: clamp(20px, 2.4vw, 26px); margin: 0 0 12px; }
.project-card--full .project-desc { margin: 0 0 18px; }
.project-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.project-tools span {
  font-family: var(--font-body); font-size: 11.5px; font-weight: 700;
  padding: 5px 12px; border-radius: 100px; border: 1.5px solid rgba(17, 17, 17, 0.28);
  display: inline-block;
  transition: background 0.2s ease, color 0.2s ease; cursor: default;
}
.project-tools span:hover { background: var(--ink); color: var(--bg); }
.visit-live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: 13px; font-weight: 700; color: var(--ink); }

/* ============ Let's talk ============ */
.talk-section { max-width: 640px; margin: 0 auto; padding: 80px 40px 40px; }
.talk-section.talk-section--tight { padding: 20px 40px 40px; }
.talk-contact { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-bottom: 40px; }
.talk-email { font-family: var(--font-hand); font-weight: 700; font-size: 28px; color: var(--ink-2); transition: transform 0.15s ease-out; }
.talk-links { display: flex; gap: 10px; }
.talk-links .link-circle { width: 36px; height: 36px; }
.talk-links .link-circle svg { width: 15px; height: 15px; }
.talk-cta-wrap { display: flex; flex-direction: column; gap: 14px; }
.talk-cta {
  text-align: center; background: var(--ink-3); color: var(--bg);
  padding: 16px; border-radius: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 13px;
  transition: transform 0.15s ease-out;
}
.talk-note { text-align: center; font-size: 12px; color: rgba(17, 17, 17, 0.45); margin: 0; }

/* ============ Footer ============ */
.site-footer { max-width: 900px; margin: 0 auto; padding: 60px 40px 130px; }
.footer-row {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 16px; font-size: 12.5px; color: rgba(17, 17, 17, 0.5);
}

/* ============ Dock nav (desktop) ============ */
.dock-nav { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; }
.dock-inner {
  display: flex; align-items: center; gap: 8px;
  background: rgba(251, 251, 248, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(17, 17, 17, 0.1); border-radius: 100px; padding: 8px;
  box-shadow: 0 14px 34px rgba(17, 17, 17, 0.14);
}
.dock-item {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  transition: background 0.2s ease;
}
.dock-item:hover { background: rgba(17, 17, 17, 0.06); }
.dock-item.active { background: var(--ink); }
.dock-item.active svg path, .dock-item.active svg rect, .dock-item.active svg circle { stroke: var(--bg); }
.dock-divider { width: 1.5px; height: 26px; background: rgba(17, 17, 17, 0.15); margin: 0 2px; }
.dock-contact {
  border: 1.5px solid rgba(17, 17, 17, 0.15);
  transition: transform 0.15s ease-out;
}

/* ============ Hamburger nav (mobile) ============ */
.hamburger-nav { position: fixed; top: calc(20px + env(safe-area-inset-top)); right: 20px; z-index: 60; display: none; }
.hamburger-btn {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(251, 251, 248, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(17, 17, 17, 0.12); box-shadow: 0 10px 24px rgba(17, 17, 17, 0.14);
  cursor: pointer; position: relative; z-index: 60;
}
.hamburger-btn .icon-close { display: none; }
.hamburger-nav.open .hamburger-btn .icon-menu { display: none; }
.hamburger-nav.open .hamburger-btn .icon-close { display: block; }
.menu-backdrop {
  position: fixed; inset: 0; background: rgba(251, 251, 248, 0.98);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 55; display: none;
}
.hamburger-nav.open .menu-backdrop { display: block; animation: menuBackdropIn 0.3s ease both; }
.menu-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 57;
  display: none; flex-direction: column; justify-content: center; align-items: flex-end;
  gap: 24px; padding: 24px 28px; box-sizing: border-box;
}
.hamburger-nav.open .menu-panel { display: flex; }
.menu-row {
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  text-decoration: none; opacity: 0;
  animation: menuRowIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.menu-row:nth-child(1) { animation-delay: 0ms; }
.menu-row:nth-child(2) { animation-delay: 70ms; }
.menu-row:nth-child(3) { animation-delay: 140ms; }
.menu-row:nth-child(4) { animation-delay: 210ms; }
.menu-label { font-family: var(--font-head); font-weight: 600; font-size: 22px; color: rgba(17, 17, 17, 0.55); white-space: nowrap; }
.menu-row.active .menu-label { font-weight: 700; color: var(--ink); }
.menu-icon {
  display: flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 20px;
  background: var(--bg); border: 1.5px solid rgba(17, 17, 17, 0.12);
  box-shadow: 0 10px 22px rgba(17, 17, 17, 0.12); flex-shrink: 0;
}
.menu-row.active .menu-icon { background: var(--ink); }
.menu-row.active .menu-icon svg path, .menu-row.active .menu-icon svg circle { stroke: var(--bg); }

/* ============ Responsive ============ */
@media (max-width: 820px) {
  .pad-x { padding-left: 26px; padding-right: 26px; }
  .about-columns { grid-template-columns: 1fr; gap: 56px; }
  .hero-notes { position: static; transform: none; margin: 44px auto 0; justify-content: center; }
  .hero { padding-top: 100px; padding-bottom: 60px; }
  .project-card { flex-direction: column; }
  .services-grid { display: none; }
  .services-scroller { display: flex; }
  .project-img, .project-card--full .project-img { flex-basis: auto; width: 100%; height: 200px; }
  .about-left { display: flex; flex-direction: column; align-items: center; }
  .hero-note { margin-top: 0; margin-right: -10px; }
  .project-text { padding: 24px 24px 28px; }
  .dock-nav { display: none; }
  .hamburger-nav { display: block; }
  .project-title, .project-card--full .project-title { font-size: 19px; }
}
@media (max-width: 480px) {
  .pad-x { padding-left: 18px; padding-right: 18px; }
  .note, .hero-note, .hero-note-wave { width: 88px !important; height: 88px !important; }
  .note span, .hero-note span { font-size: 13px !important; }
  .note-stack { width: 220px; }
  .tool-card { width: 98px; padding: 16px 8px; }
  .tool-card span.tool-name { font-size: 11px; }
  .skill-chip { font-size: 15px; padding: 6px 14px 4px; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .project-card, .service-slide { opacity: 1 !important; transform: rotate(var(--tilt, 0deg)) !important; }
}
