/* A little polish for the time capsule - added in 2026, six years into the
   journey. The 2020 HTML underneath is untouched. */

/* Dark by default, matching the rest of bimeshpoudel.com.np; the warm
   paper look survives for visitors who prefer light mode. */
:root {
  --ink: #e5e7eb;
  --soft: #9ca3af;
  --line: #2e303a;
  --paper: #16171d;
  --card: #1f2028;
  --accent: #f87171;
  --star: #facc15;
}

/* Light palette applies automatically when the OS prefers light and the
   visitor hasn't made an explicit choice (data-theme="dark" overrides it). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ink: #2b2620;
    --soft: #6f675c;
    --line: #e4ddd2;
    --paper: #faf7f1;
    --card: #ffffff;
    --accent: #b3372f;
    --star: #d9a406;
  }
}

/* 2026: theme toggle - explicit manual choice wins over the OS either way. */
:root[data-theme="light"] {
  --ink: #2b2620;
  --soft: #6f675c;
  --line: #e4ddd2;
  --paper: #faf7f1;
  --card: #ffffff;
  --accent: #b3372f;
  --star: #d9a406;
}

* {
  box-sizing: border-box;
}

html {
  /* Mobile browsers paint their own translucent gray/black overlay on tap
     unless told otherwise, which muddies every button's press state
     regardless of its actual accent color. */
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  max-width: 720px;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.65;
}

h1 {
  font-size: 2.2rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
}

h3,
h4 {
  font-family: "Courier New", ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  color: var(--accent);
  margin: 2.2rem 0 0.8rem;
}

p {
  margin: 0.4rem 0;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

/* Touch has no real hover: without this guard, tapping leaves the link
   stuck in its :hover state until something else is tapped, because touch
   browsers apply :hover on tap and never fire a mouseleave to clear it. */
@media (hover: hover) and (pointer: fine) {
  a:hover {
    text-decoration-thickness: 2px;
  }
}

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

img {
  max-width: 170px;
  height: auto;
  border-radius: 54% 46% 48% 52% / 50% 54% 46% 50%;
  border: 3px solid var(--line);
}

table {
  border-collapse: separate;
}

th {
  font-family: "Courier New", ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  color: var(--soft);
  text-align: left;
}

/* skills stars - only the nested skill tables, not the page-layout ones */
table table td:nth-child(2) {
  color: var(--star);
  letter-spacing: 2px;
}

table table td:first-child {
  color: var(--ink);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 0.95rem;
}

ul,
ol {
  padding-left: 1.4rem;
}

li {
  margin: 0.35rem 0;
}

/* contact form */
form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
  max-width: 480px;
}

label {
  display: block;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--soft);
  margin-bottom: 0.3rem;
}

input[type="text"],
input[type="email"],
input[type="date"],
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

input[type="submit"] {
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.6rem;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  input[type="submit"]:hover {
    filter: brightness(1.1);
  }
}

/* 2026: theme toggle */
#theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
}

@media (hover: hover) and (pointer: fine) {
  #theme-toggle:hover {
    filter: brightness(1.1);
  }
}
