/* ============================================================
   Design 17 — "NOTEBOOK"
   School exercise book / graph paper. Handwritten Caveat,
   blue grid lines, red margin, sticky note form.
   ============================================================ */

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

:root {
  --paper:   #FAFCFF;
  --grid:    rgba(173, 204, 240, 0.55);
  --margin:  #F5A0A0;
  --ink:     #1A1A2E;
  --ink-mid: #4A4A6A;
  --teal:    #6FA7A3;
  --coral:   #DD6F56;
  --yellow:  #FFF176;
  --font-hand: 'Caveat', cursive;
  --font-body: 'DM Sans', sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
}

/* ── Graph paper background ─────────────────────────────── */

.page {
  position: relative;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  overflow: hidden;
}

/* ── Red margin line ────────────────────────────────────── */

.margin-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 88px;
  width: 2px;
  background: var(--margin);
  opacity: 0.7;
  pointer-events: none;
  z-index: 1;
}

/* ── Content ────────────────────────────────────────────── */

.content {
  position: relative;
  z-index: 10;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 1.5rem 2.5rem 1.5rem 7rem;
  animation: fade-in 0.5s ease both;
}

/* ── Header ─────────────────────────────────────────────── */

.header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--grid);
}

.header img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.header__text {
  display: flex;
  flex-direction: column;
}

.header__name {
  font-family: var(--font-hand);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.header__sub {
  font-family: var(--font-hand);
  font-size: 0.85rem;
  color: var(--ink-mid);
}

/* ── Main ───────────────────────────────────────────────── */

.main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: 1rem 0;
}

/* Decorative doodles */
.doodle {
  position: absolute;
  font-family: var(--font-hand);
  color: var(--teal);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

.doodle--star   { top: 1rem;   right: 2rem;  font-size: 2rem; transform: rotate(15deg); }
.doodle--arrow  { top: 40%;    right: 8rem;  font-size: 1.5rem; transform: rotate(-10deg); }
.doodle--circle { bottom: 1rem; right: 4rem;  font-size: 2.5rem; opacity: 0.3; }

.label {
  font-family: var(--font-hand);
  font-size: 1rem;
  color: var(--ink-mid);
  margin-bottom: 0.5rem;
}

/* ── Heading ────────────────────────────────────────────── */

.heading {
  display: flex;
  flex-direction: column;
  line-height: 1;
  margin-bottom: 1.5rem;
}

.heading__line {
  font-family: var(--font-hand);
  font-size: clamp(4rem, 11vw, 9rem);
  font-weight: 700;
  color: var(--ink);
  display: block;
  line-height: 0.95;
}

.heading__line--underline {
  position: relative;
  display: inline-block;
}

.heading__line--underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--coral);
  border-radius: 2px;
  transform: rotate(-0.5deg);
}

.heading__dot { color: var(--coral); }

/* ── Ruled block ────────────────────────────────────────── */

.ruled-block {
  max-width: 500px;
  margin-bottom: 2rem;
}

.note {
  font-family: var(--font-hand);
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--ink-mid);
}

/* ── Sticky note form ───────────────────────────────────── */

.sticky {
  background: var(--yellow);
  padding: 1.25rem 1.5rem;
  max-width: 360px;
  box-shadow: 2px 4px 12px rgba(0,0,0,0.12), inset 0 -2px 0 rgba(0,0,0,0.06);
  transform: rotate(-1deg);
  position: relative;
}

.sticky__hed {
  font-family: var(--font-hand);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form__input {
  height: 40px;
  padding: 0 0.75rem;
  background: rgba(255,255,255,0.7);
  border: none;
  border-bottom: 2px solid rgba(26,26,46,0.3);
  font-family: var(--font-hand);
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}

.form__input::placeholder { color: rgba(26,26,46,0.35); }
.form__input:focus { border-bottom-color: var(--ink); }

.form__btn {
  align-self: flex-start;
  padding: 0.4rem 1rem;
  background: var(--coral);
  color: #fff;
  border: none;
  font-family: var(--font-hand);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.2s;
}

.form__btn:hover { background: #c45e46; }
.form__btn:disabled { opacity: 0.55; cursor: default; }

.form__confirm {
  font-family: var(--font-hand);
  font-size: 1rem;
  color: var(--ink);
  font-weight: 700;
}
.form__confirm[hidden] { display: none; }

/* ── Footer ─────────────────────────────────────────────── */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 2px solid var(--grid);
  font-family: var(--font-hand);
  font-size: 0.85rem;
  color: var(--ink-mid);
}

.footer nav {
  display: flex;
  gap: 1rem;
}

.footer nav a {
  font-family: var(--font-hand);
  font-size: 0.85rem;
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ── Keyframes ──────────────────────────────────────────── */

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 640px) {
  .margin-line { display: none; }
  .content { padding: 1.5rem 1.25rem; }
  .doodle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; }
}
